0

I am configuring my shortcut keys directly to dwm config file (config.def.h). For eg: To add shortcut to open thunderbird: static const char *mailclient[] = { "thunderbird", NULL };

and then you add a key-binding to it in static Key keys[ ]: { Mod4Mask, XK_m, spawn, {.v = mailclient} },

But what i want to do is open the mail client and send the notification "Thunderbird Opened"; which can simply be done in terminal by thunderbird | notify-send "Thunderbird Opened". So, how to append "| notify-send "Thunderbird Opened" in above shortcut in dwm config?

4

1 回答 1

0

找到的解决方案:

应该创建一个 char 数组文字而不是指针。

即,使用:static const char mailclient[] = "thunderbird && notify-send 'Thunderbird Opened'"; 代替:static const char *mailclient[] = { "thunderbird", NULL }; 和使用:{ Mod4Mask, XK_m, spawn, SHCMD(mailclient) }, 代替:{ Mod4Mask, XK_m, spawn, {.v = mailclient} },

于 2021-12-30T04:07:36.627 回答