2 # Released under the GPL
3 # Nub-Settings, v1.0, written by Michael Mrozek aka EvilDragon 2010
4 # This scripts allows you to configure all parameters of the Pandora-Nubs. The left and right nub can both be configured individually.
6 while mainsel=$(zenity --title="Nub-Configuration" --width="430" --height="400" --list --column "id" --column "Please select" --hide-column=1 --text="What do you want to do?" "nub0mode" "Change the mode for the left nub" "nub0msense" "Change the mouse speed for the left nub" "nub0ssense" "Change the scroll sensitivity for the left nub" "nub0rate" "Change the scroll speed for the left nub" "nub0thres" "Change the mouse button sensitivity for the left nub" "nub1mode" "Change the mode for the right nub" "nub1msense" "Change the mouse speed for the right nub" "nub1ssense" "Change the scroll sensitivity for the right nub" "nub1rate" "Change the scroll speed for the right nub" "nub1thres" "Change the mouse button sensitivity for the right nub" "default" "Restore default settings for both nubs"); do
11 if nubm=$(zenity --height=300 --list --title="Select Nub-mode for the left nub" --text="Please select the modus for the left nub.\n\nNote: This can affect running programs.\nSome programs also may change the nub mode themselves." --column "return" --hide-column=1 --column "Nub Mode" "mouse" "Use the nub as mouse" "mbuttons" "Use the nub for mousebuttons" "scroll" "Use the nub for scrolling" "absolute" "Use the nub as joystick") ; then
13 echo $nubm > /proc/pandora/nub0/mode
17 curmsense=$(cat /proc/pandora/nub0/mouse_sensitivity)
18 newmsense=$(zenity --scale --text "Set speed for left nub mouse.\nThe default value is 150. Higher value means faster mouse." --min-value=50 --max-value=300 --value=$curmsense --step 1)
19 echo $newmsense > /proc/pandora/nub0/mouse_sensitivity
23 curssense=$(cat /proc/pandora/nub0/scrollx_sensitivity)
24 newssense=$(zenity --scale --text "Set the scroll sensitivity for the left nub for the X-Axis.\nThe default value is 7. Higher value means more sensitive.\nA negative value inverts the axis." --min-value=-32 --max-value=32 --value=$curssense --step 1)
25 echo $newssense > /proc/pandora/nub0/scrollx_sensitivity
26 curssense=$(cat /proc/pandora/nub0/scrolly_sensitivity)
27 newssense=$(zenity --scale --text "Set the scroll sensitivity for the left nub for the Y-Axis.\nThe default value is 7. Higher value means more sensitive.\nA negative value inverts the axis." --min-value=-32 --max-value=32 --value=$curssense --step 1)
28 echo $newssense > /proc/pandora/nub0/scrolly_sensitivity
32 currate=$(cat /proc/pandora/nub0/scroll_rate)
33 newrate=$(zenity --scale --text "Set the scroll speed for the left nub.\nThe default value is 20. Higher value means more sensitive." --min-value=1 --max-value=40 --value=$currate --step 1)
34 echo $newrate > /proc/pandora/nub0/scroll_rate
38 curthres=$(cat /proc/pandora/nub0/mbutton_threshold)
39 newthres=$(zenity --scale --text "Change the mousebutton sensitivity for the left nub.\nThe default value is 20.\nThe higher the value the higher you need to move the nub" --min-value=1 --max-value=40 --value=$curthres --step 1)
40 echo $newthres > /proc/pandora/nub0/mbutton_threshold
44 if nubm=$(zenity --height=300 --list --title="Select Nub-mode for the right nub" --text="Please select the modus for the right nub.\n\nNote: This can affect running programs.\nSome programs also may change the nub mode themselves." --column "return" --hide-column=1 --column "Nub Mode" "mouse" "Use the nub as mouse" "mbuttons" "Use the nub for mousebuttons" "scroll" "Use the nub for scrolling" "absolute" "Use the nub as joystick") ; then
46 echo $nubm > /proc/pandora/nub1/mode
50 curmsense=$(cat /proc/pandora/nub1/mouse_sensitivity)
51 newmsense=$(zenity --scale --text "Set speed for right nub mouse.\nThe default value is 150. Higher value means faster mouse." --min-value=50 --max-value=300 --value=$curmsense --step 1)
52 echo $newmsense > /proc/pandora/nub1/mouse_sensitivity
56 curssense=$(cat /proc/pandora/nub1/scrollx_sensitivity)
57 newssense=$(zenity --scale --text "Set the scroll sensitivity for the right nub for the X-Axis.\nThe default value is 7. Higher value means more sensitive.\nA negative value inverts the axis." --min-value=-32 --max-value=32 --value=$curssense --step 1)
58 echo $newssense > /proc/pandora/nub1/scrollx_sensitivity
59 curssense=$(cat /proc/pandora/nub1/scrolly_sensitivity)
60 newssense=$(zenity --scale --text "Set the scroll sensitivity for the right nub for the Y-Axis.\nThe default value is 7. Higher value means more sensitive.\nA negative value inverts the axis." --min-value=-32 --max-value=32 --value=$curssense --step 1)
61 echo $newssense > /proc/pandora/nub1/scrolly_sensitivity
65 currate=$(cat /proc/pandora/nub1/scroll_rate)
66 newrate=$(zenity --scale --text "Set the scroll speed for the right nub.\nThe default value is 20. Higher value means more sensitive." --min-value=1 --max-value=40 --value=$currate --step 1)
67 echo $newrate > /proc/pandora/nub1/scroll_rate
71 curthres=$(cat /proc/pandora/nub1/mbutton_threshold)
72 newthres=$(zenity --scale --text "Change the mousebutton sensitivity for the right nub.\nThe default value is 20.\nThe higher the value the higher you need to move the nub" --min-value=1 --max-value=40 --value=$curthres --step 1)
73 echo $newthres > /proc/pandora/nub1/mbutton_threshold
76 echo mouse > /proc/pandora/nub0/mode
77 echo 150 > /proc/pandora/nub0/mouse_sensitivity
78 echo 7 > /proc/pandora/nub0/scrollx_sensitivity
79 echo 7 > /proc/pandora/nub0/scrolly_sensitivity
80 echo 20 > /proc/pandora/nub0/scroll_rate
81 echo 20 > /proc/pandora/nub0/mbutton_threshold
82 echo mbuttons > /proc/pandora/nub1/mode
83 echo 150 > /proc/pandora/nub1/mouse_sensitivity
84 echo 7 > /proc/pandora/nub1/scrollx_sensitivity
85 echo 7 > /proc/pandora/nub1/scrolly_sensitivity
86 echo 20 > /proc/pandora/nub1/scroll_rate
87 echo 20 > /proc/pandora/nub1/mbutton_threshold
88 zenity --info --title="Settings restored" --text "The default nub-settings have been restored." --timeout 6