V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  mutex369  ›  全部回复第 1 页 / 共 1 页
回复总数  2
@mutex369 找到原因了,https://www.reddit.com/r/Ubuntu/comments/nu8bij/issue_with_wmctrl_and_firefox_after_upgrading_to/。
新版 firefox 默认使用 wayland 启动了,而 wmctrl 只能操纵 X11 的窗口。
以 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 ,虽然它已经打开了。有人能教导一下吗?
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2920 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms · UTC 14:48 · PVG 22:48 · LAX 07:48 · JFK 10:48
Developed with CodeLauncher
♥ Do have faith in what you're doing.