擁抱自由,使用 linux !

在Linux底下真是太幸福了,有好多東西可以玩。想從windows解脫就是現在!

Jan-4-10

Devil’s Pie 管理視窗位置

posted by Thomas

Devil’s Pie 管理視窗位置是個相當好用的工具。該工具可以根據視窗名稱、程式名稱等寫成規則,定義出出現的位置、出現的workspace等。

舉個例子:如果想讓thunderbird3 出現在第2的worspace
建立檔案 .devilspie/thunderbird.ds

;http://foosel.org/linux/devilspie
; Move thunderbird to workspace 2
(if
(or
(matches (window_name) "Shredder")
(matches (application_name) "alltray -st -s -l thunderbird-3.1")
)
(set_workspace 2)
)

規則的定義看似複雜,其實蘊含著非常大的彈性。有程式基礎者容易操作,因為就像是寫regular expression

基本上一定是 “(if” 中間可以自訂描述 並以 “)” 結尾

;http://foosel.org/linux/devilspie                                // 註解
(if                                                               // 開始
    (or                                                           // 開始規則 (或者)
    (matches (window_name) "Shredder")                            // 視窗名稱包含 Shredder
    (matches (application_name) "alltray -st -s -l thunde...")    //或者程式名稱包含 alltray...
    )                                                             // 結束規則判斷
    (set_workspace 2)                                             // 動作就是 放到第二個桌面
)                                                                 // 結束

ps: 如果跟 alltray 配合,alltray 要加 -st 參數!

see also:
http://foosel.org/linux/devilspie
http://live.gnome.org/DevilsPie
http://burtonini.com/blog/computers/devilspie/

Tags:

Add A Comment