Around emacs, linux, etc.
没有sawfish的时候怎么用jump-or-exec来切换窗口
最初是因为compiz不成熟,所以一直在用sawfish,最近切到了compiz后就不能用sawfish了,非常好用的jump-or-exec也没了,本来打算自己搞个的,发现已经有人弄过了。地址在 http://pluskid.lifegoo.com/wiki/JumpOrExec.html
通过一个python脚本和wmctrl来实现的jump-or-exec,配合xbindkeys,基本上不用再担心切换wm的问题了
不过python脚本的启动明显没有shell脚本来的快,改写成shell脚本代码如下
#!/bin/bash
case $1 in
emacs)
REXP="Emacs -x"
CMD="emacs"
;;
browser)
REXP="Chromium -x"
CMD="chromium-browser"
;;
firefox)
REXP="Firefox"
CMD="firefox"
;;
thunderbird)
REXP="Thunderbird"
CMD="thunderbird"
;;
qterm)
REXP="qterm.Qterm -x"
CMD="qterm"
;;
*)
exit
;;
esac
wmctrl -a $REXP && exit
exec $CMD &
| Print article | This entry was posted by Jay Xie on 2008/10/06 at 10:04 pm, and is filed under Emacs. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
搜狐微博
新浪微博
about 3 years ago
请问这个怎么用啊? 把他扔到bin目录下,开机就执行? 怎么进行键绑定呢?
about 3 years ago
这个只是在切换程序的时候用的
比如用xbindkeys绑定win+f为命令”~/bin/jump-or-exec firefox”
而jump-or-exec里对firefox的处理为查找标题中含有Firefox的窗口,如果有就激活,没有就执行firefox
这样win+f这个快捷键就可以达到这个效果了
about 3 years ago
谢谢,太好用了,以后不一定非要用sawfish了,感觉sawfish搭配其他de还是有很多不方便的地方。