Re: toggle mouse buttons by script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Just to finish ths thread here is my new script:

<<< snip-here >>>
#!/bin/sh
# script for toggling mouse buttons and save the settings for kde

# what is the current setting, or better where to switch to ?
mouse_what_to_set() {
  xmodmap -pp | cut -c 9,24 | grep -q 11 && echo "Left" || echo "Right"
}

# switch to Left or Right
switch_mouse() {
  if [ "$1" == "Right" ]; then
    list="1 2 3"
  else
   list="3 2 1"
  fi
  xmodmap -e "pointer = $list" && kwriteconfig --file kcminputrc --group Mouse --key MouseButtonMapping "${like}Handed"
}

# do the job
switch_mouse `mouse_what_to_set`

<<< snip-here >>>


Best regards

Stephan
___________________________________________________
.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

[Index of Archives]     [Trinity (TDE) Desktop Users]     [Fedora KDE]     [Fedora Desktop]     [Linux Kernel]     [Gimp]     [GIMP for Windows]     [Gnome]     [Yosemite Hiking]
  Powered by Linux