V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  mutex369  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2024 年 3 月 26 日
回复了 jeesk 创建的主题 Linux gnome 下面有什么什么办法为程序绑定全局快捷键?
@mutex369 找到原因了,https://www.reddit.com/r/Ubuntu/comments/nu8bij/issue_with_wmctrl_and_firefox_after_upgrading_to/。
新版 firefox 默认使用 wayland 启动了,而 wmctrl 只能操纵 X11 的窗口。
2024 年 3 月 23 日
回复了 jeesk 创建的主题 Linux gnome 下面有什么什么办法为程序绑定全局快捷键?
以 Ubuntu20 为例:Settings -> Keyboard -> View and Customize Shortcuts -> Custom Shortcuts -> Add Custom Shortcut
在 Command 一行加入如下代码:
```
/bin/bash -c 'if ps -A | grep 那个程序可能的名字; then wmctrl -a 那个程序可能显示的窗体名字; else 运行那个程序的命令 ; fi;'
```
----------
但我现在也遇到了一个问题,wmctlr -l 显示的窗体里没有 firefox ,虽然它已经打开了。有人能教导一下吗?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1422 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 9ms · UTC 17:03 · PVG 01:03 · LAX 10:03 · JFK 13:03
♥ Do have faith in what you're doing.