Friday, April 23, 2010

Toggle Window Selection Mode (Focus Mode)

之前用synergy太習慣了,滑鼠移到另外一個螢幕視窗就自動會變active的,就不用再點一下...
gnome也有這個功能,就是在System->Preference->Windows下可以選擇把"Select window when the mouse moves over them"打勾,這樣一來當滑鼠移到任何一個視窗上就會馬上變成active了,不過有的時候又不希望這樣,所以只好寫一個script來用熱鍵toggle這個選項:


#!/bin/sh
FOCUS_MODE=`gconftool --get /apps/metacity/general/focus_mode`
if [ "$FOCUS_MODE" = "click" ]; then
echo "focus mode = $FOCUS_MODE, setting to sloppy mode"
gconftool --type string --set /apps/metacity/general/focus_mode "sloppy"
else
echo "focus mode = $FOCUS_MODE, setting to click mode"
gconftool --type string --set /apps/metacity/general/focus_mode "click"
fi

0 Comments: