sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-desktoponly-20230806-e81f17d.diff (1290B)


      1 From 72ec0ec3c504ba348db9f6e8218d2a5d3cc6812a Mon Sep 17 00:00:00 2001
      2 From: Maxim Mihaylin <slimbox.sdb@gmail.com>
      3 Date: Sun, 6 Aug 2023 12:12:15 +0600
      4 Subject: [PATCH] Patch for dmenu-desktoponly
      5 
      6 ---
      7  config.def.h | 2 ++
      8  dwm.c        | 3 +++
      9  2 files changed, 5 insertions(+)
     10 
     11 diff --git a/config.def.h b/config.def.h
     12 index 9efa774..1062702 100644
     13 --- a/config.def.h
     14 +++ b/config.def.h
     15 @@ -55,6 +55,8 @@ static const Layout layouts[] = {
     16  /* helper for spawning shell commands in the pre dwm-5.0 fashion */
     17  #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
     18  
     19 +static const int dmenudesktop = 1; /* 1 means dmenu will use only desktop files from [/usr/share/applications/] */
     20 +
     21  /* commands */
     22  static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
     23  static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
     24 diff --git a/dwm.c b/dwm.c
     25 index f1d86b2..949badd 100644
     26 --- a/dwm.c
     27 +++ b/dwm.c
     28 @@ -1650,6 +1650,9 @@ spawn(const Arg *arg)
     29  	struct sigaction sa;
     30  
     31  	if (arg->v == dmenucmd)
     32 +    if (dmenudesktop)
     33 +     dmenucmd[0] = "dmenu_run_desktop";
     34 +
     35  		dmenumon[0] = '0' + selmon->num;
     36  	if (fork() == 0) {
     37  		if (dpy)
     38 -- 
     39 2.40.1
     40