【问题标题】:How to use pipe ( | ) in dwm (dynamic window manager) config in linux?如何在 linux 的 dwm(动态窗口管理器)配置中使用管道(|)?
【发布时间】:2021-12-28 10:25:59
【问题描述】:

我正在将我的快捷键直接配置到 dwm 配置文件 (config.def.h)。 例如:添加快捷方式打开雷鸟: static const char *mailclient[] = { "thunderbird", NULL };

然后在静态 Key keys[ ] 中添加一个键绑定: { Mod4Mask, XK_m, spawn, {.v = mailclient} },

但我想做的是打开邮件客户端并发送通知“Thunderbird Opened”;这可以通过thunderbird | notify-send "Thunderbird Opened" 在终端中简单地完成。 那么,如何在 dwm config 的上述快捷方式中添加“| notify-send "Thunderbird Opened”?

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: c linux archlinux x-dwm


【解决方案1】:

找到的解决方案:

应该创建一个字符数组字面量而不是一个指针。

即使用: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} },

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-17
    • 2020-09-06
    • 2011-10-13
    相关资源
    最近更新 更多