现记录如下:
- 使用列出所有窗口的列表。
- [bl@bailiang-home:~]$ wmctrl -lx
- 0x01600002 -1 unity-2d-panel.Unity-2d-panel bailiang-home unity-2d-panel
- 0x0160000e -1 unity-2d-panel.Unity-2d-panel bailiang-home unity-2d-panel
- 0x03000004 -1 desktop_window.Nautilus bailiang-home 桌面
- 0x01800002 -1 unity-2d-shell.Unity-2d-shell bailiang-home unity-2d-shell
- 0x01800047 -1 unity-2d-shell.Unity-2d-shell bailiang-home unity-2d-shell
- 0x052000b9 0 Navigator.Firefox bailiang-home bailiangcn-ChinaUnix博客 - Pentadactyl
- 0x03000897 1 nautilus.Nautilus bailiang-home 视频
- 0x05000004 0 terminator.Terminator bailiang-home bl@bailiang-home: ~
- 使用能够实现自动激活Firefox窗口。
- $ wmctrl -a Firefox -x
- 制作一个脚本文件active_ghci,内容如下:
- #!/bin/sh
- # active Terminator
- if [ -f /tmp/.ghci.shaded ];
- then
- wmctrl -x -a Terminator
- rm /tmp/.ghci.shaded
- # active Firefox
- else
- wmctrl -x -a Firefox
- touch /tmp/.ghci.shaded
- fi
- 把上面的文件赋予执行权限,然后制作一个快捷键F12