I would like to use natural scroll with touchpad and normal scroll when I am using a normal USB mouse. I don't want to go to the preferences dialog to change the settings every time I need the switch. Thus I need a command line tool to help me with that.
Here is what I put in my ~/.bashrc
:
alias scr-natural='defaults write NSGlobalDomain com.apple.swipescrolldirection -bool TRUE && killall cfprefsd'
alias scr-normal='defaults write NSGlobalDomain com.apple.swipescrolldirection -bool FALSE && killall cfprefsd'
After I run scr-normal
and then
defaults read NSGlobalDomain com.apple.swipescrolldirection
I can see the value is 0
. However the behavior is still the natural scrolling.
I searched a lot of places and it says the preference dialog will set the new value and force system to reload the ~/Library/Preferences/.GlobalPreferences.plist
file. I couldn't find anyway to force system to reload that file through command line and I get stuck over there.
Can anyone help out?
sudo pkill loginwindow
, which forces you to logout and seems to be the only way to apply the setting.