]> git.openpandora.org Git - openpandora.oe.git/commitdiff
op_nubmode: Added nub reset and made interface cleaner
authorMichael Mrozek <EvilDragon@openpandora.org>
Tue, 18 May 2010 02:32:10 +0000 (04:32 +0200)
committerMichael Mrozek <EvilDragon@openpandora.org>
Tue, 18 May 2010 02:32:10 +0000 (04:32 +0200)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/gui.conf
recipes/pandora-system/pandora-scripts/op_nubmode.desktop
recipes/pandora-system/pandora-scripts/op_nubmode.sh
recipes/pandora-system/pandora-scripts/pandorascripts.pnd
recipes/pandora-system/pandora-sudoers.bb
recipes/pandora-system/pandora-sudoers/50_openpandora

index 5513be21c6cfab3855b11ba774086abd0e267c5c..12dccf40778ddecb61960678cc087d25bddb0ecc 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r21"
+PR = "r22"
 
 SRC_URI = " \
           file://op_bright.sh \
index 773845dc7d9aa68bf83e6171b23f14ae359ff6fc..bb42dee429b72ebbf7568c150413201f7fdcf4fa 100644 (file)
@@ -1,3 +1,2 @@
 XFCE4;The full desktop Environment;startxfce4;xfce4-session-logout --logout
 MiniMenu;A very simple but flexible menu;startmmenu;killall mmwrapper
-PMenu;A gaming-console-style Launcher;pmenu;killall pmenu
index c5b6ba2997f8c5a808e3995b988d606267d377bd..0a1bdb06b85b7711fbc76f42fe94d54f5a0b4e9b 100644 (file)
@@ -2,7 +2,7 @@
 Name=Set Nub mode
 Comment=You can set the nubs to use them as mouse, scrollwheel or stick.
 StartupNotify=false
-Exec=/usr/pandora/scripts/op_nubmode.sh
+Exec=sudo /usr/pandora/scripts/op_nubmode.sh
 Icon=gnome-dev-mouse-optical
 Terminal=false
 Type=Application
index 23f73f0af499b78aecf2a308d233a48d5b4042c0..c139290ad14c209e4993bbd822d43e1031e2b5ab 100755 (executable)
 #!/bin/bash
 # Released under the GPL
-# Nub-Settings, v1.0, written by Michael Mrozek aka EvilDragon 2010
+# Nub-Settings, v1.1, written by Michael Mrozek aka EvilDragon 2010
 # This scripts allows you to configure all parameters of the Pandora-Nubs. The left and right nub can both be configured individually.
 
-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
+while mainsel=$(zenity --title="Nub-Configuration" --width="380" --height="200" --list --column "id" --column "Please select" --hide-column=1 --text="What do you want to do?" "leftnub" "Configure left nub" "rightnub" "Configure right nub" "default" "Restore default settings for both nubs"); do
 
 case $mainsel in
+  "leftnub")
 
-  "nub0mode")
-      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
+   while leftsel=$(zenity --title="Configure Left Nub" --width="430" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="What do you want to do?" "nub0mode" "Change Nub mode" "nub0msense" "Change the mouse speed" "nub0ssense" "Change the scroll sensitivity" "nub0rate" "Change the scroll speed" "nub0thres" "Change the mouse button sensitivity" "nub0reset" "Reset Nub"); do
+   case $leftsel in
 
-      echo $nubm > /proc/pandora/nub0/mode
-      fi;;
+    "nub0mode")
+        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
 
-  "nub0msense")
-      curmsense=$(cat /proc/pandora/nub0/mouse_sensitivity)
-      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)
-      echo $newmsense > /proc/pandora/nub0/mouse_sensitivity
-      ;;
+        echo $nubm > /proc/pandora/nub0/mode
+        fi;;
+
+    "nub0msense")
+        curmsense=$(cat /proc/pandora/nub0/mouse_sensitivity)
+        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)
+        echo $newmsense > /proc/pandora/nub0/mouse_sensitivity
+        ;;
     
-  "nub0ssense")
-      curssense=$(cat /proc/pandora/nub0/scrollx_sensitivity)
-      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)
-      echo $newssense > /proc/pandora/nub0/scrollx_sensitivity
-      curssense=$(cat /proc/pandora/nub0/scrolly_sensitivity)
-      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)
-      echo $newssense > /proc/pandora/nub0/scrolly_sensitivity
-      ;;
+    "nub0ssense")
+        curssense=$(cat /proc/pandora/nub0/scrollx_sensitivity)
+        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)
+        echo $newssense > /proc/pandora/nub0/scrollx_sensitivity
+        curssense=$(cat /proc/pandora/nub0/scrolly_sensitivity)
+        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)
+        echo $newssense > /proc/pandora/nub0/scrolly_sensitivity
+        ;;
 
-  "nub0rate")
-      currate=$(cat /proc/pandora/nub0/scroll_rate)
-      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)
-      echo $newrate > /proc/pandora/nub0/scroll_rate
-      ;;
+    "nub0rate")
+        currate=$(cat /proc/pandora/nub0/scroll_rate)
+        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)
+        echo $newrate > /proc/pandora/nub0/scroll_rate
+        ;;
      
-  "nub0thres")
-      curthres=$(cat /proc/pandora/nub0/mbutton_threshold)
-      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)
-      echo $newthres > /proc/pandora/nub0/mbutton_threshold
-      ;;
-
-  "nub1mode")
-      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
+    "nub0thres")
+        curthres=$(cat /proc/pandora/nub0/mbutton_threshold)
+        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)
+        echo $newthres > /proc/pandora/nub0/mbutton_threshold
+        ;;
+ 
+    "nub0reset")
+        echo 1 > /sys/bus/i2c/drivers/vsense/3-0066/reset
+        sleep 1
+        echo 0 > /sys/bus/i2c/drivers/vsense/3-0066/reset
+        curmode=$(cat /proc/pandora/nub0/mode)
+        echo mouse > /proc/pandora/nub0/mode
+        while ! zenity --question --title="Resetted left nub" --text="The left nub has been resetted.\nPlease try to move the mouse cursor\nto test if it is working properly." --ok-label="Working properly" --cancel-label="Reset again"; do
+        echo 1 > /sys/bus/i2c/drivers/vsense/3-0066/reset
+        sleep 1
+        echo 0 > /sys/bus/i2c/drivers/vsense/3-0066/reset      
+        done
+        echo curmode > /proc/pandora/nub0/mode
+        ;;
+     esac
+   done
+  ;;
+  
+  "rightnub")
+  
+   while rightsel=$(zenity --title="Configure Right Nub" --width="430" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="What do you want to do?" "nub1mode" "Change Nub mode" "nub1msense" "Change the mouse speed" "nub1ssense" "Change the scroll sensitivity" "nub1rate" "Change the scroll speed" "nub1thres" "Change the mouse button sensitivity" "nub1reset" "Reset Nub"); do
+   case $rightsel in
+  
+    "nub1mode")
+        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
 
-      echo $nubm > /proc/pandora/nub1/mode
-      fi;;
+        echo $nubm > /proc/pandora/nub1/mode
+        fi;;
 
-  "nub1msense")
-      curmsense=$(cat /proc/pandora/nub1/mouse_sensitivity)
-      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)
-      echo $newmsense > /proc/pandora/nub1/mouse_sensitivity
-      ;;
+    "nub1msense")
+        curmsense=$(cat /proc/pandora/nub1/mouse_sensitivity)
+        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)
+        echo $newmsense > /proc/pandora/nub1/mouse_sensitivity
+        ;;
     
-  "nub1ssense")
-       curssense=$(cat /proc/pandora/nub1/scrollx_sensitivity)
-      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)
-      echo $newssense > /proc/pandora/nub1/scrollx_sensitivity
-      curssense=$(cat /proc/pandora/nub1/scrolly_sensitivity)
-      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)
-      echo $newssense > /proc/pandora/nub1/scrolly_sensitivity
-      ;;
+    "nub1ssense")
+        curssense=$(cat /proc/pandora/nub1/scrollx_sensitivity)
+        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)
+        echo $newssense > /proc/pandora/nub1/scrollx_sensitivity
+        curssense=$(cat /proc/pandora/nub1/scrolly_sensitivity)
+        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)
+        echo $newssense > /proc/pandora/nub1/scrolly_sensitivity
+        ;;
 
-  "nub1rate")
-      currate=$(cat /proc/pandora/nub1/scroll_rate)
-      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)
-      echo $newrate > /proc/pandora/nub1/scroll_rate
-      ;;
+    "nub1rate")
+        currate=$(cat /proc/pandora/nub1/scroll_rate)
+        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)
+        echo $newrate > /proc/pandora/nub1/scroll_rate
+        ;;
      
-  "nub1thres")
-      curthres=$(cat /proc/pandora/nub1/mbutton_threshold)
-      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)
-      echo $newthres > /proc/pandora/nub1/mbutton_threshold
-      ;;
-  "default")
+    "nub1thres")
+        curthres=$(cat /proc/pandora/nub1/mbutton_threshold)
+        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)
+        echo $newthres > /proc/pandora/nub1/mbutton_threshold
+        ;;
+
+    "nub1reset")
+        echo 1 > /sys/bus/i2c/drivers/vsense/3-0067/reset
+        sleep 1
+        echo 0 > /sys/bus/i2c/drivers/vsense/3-0067/reset
+        curmode=$(cat /proc/pandora/nub1/mode)
+        echo mouse > /proc/pandora/nub1/mode
+        while ! zenity --question --title="Resetted right nub" --text="The right nub has been resetted.\nPlease try to move the mouse cursor\nto test if it is working properly." --ok-label="Working properly" --cancel-label="Reset again"; do
+        echo 1 > /sys/bus/i2c/drivers/vsense/3-0067/reset
+        sleep 1
+        echo 0 > /sys/bus/i2c/drivers/vsense/3-0067/reset      
+        done
+        echo curmode > /proc/pandora/nub1/mode
+        ;;
+     esac
+   done
+   ;;
+
+"default")
       echo mouse > /proc/pandora/nub0/mode
       echo 150 > /proc/pandora/nub0/mouse_sensitivity
       echo 7 > /proc/pandora/nub0/scrollx_sensitivity
index 653c744cee235d5553262b6d58e236cd0f3dd1c4..ccd0d6225f9738119df1742f025469af3f3b912e 100644 (file)
Binary files a/recipes/pandora-system/pandora-scripts/pandorascripts.pnd and b/recipes/pandora-system/pandora-scripts/pandorascripts.pnd differ
index e2e48ffccea73949cff0017d9755197b144b0ea9..e7029c20ed02ca5bddc476d67641444836641fd0 100644 (file)
@@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 
 RDEPENDS = "sudo"
 
-PR = "r3"
+PR = "r4"
 
 SRC_URI = " \
           file://50_openpandora \
index c35a4c5bb86582232f422c629c26d7020da82759..415caddb5133424e675676e1597e60a4cd7c6d20 100755 (executable)
@@ -19,4 +19,4 @@
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_datetime.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_wifi.sh
 %wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_lcdsettings.sh
-
+%wheel ALL=(ALL) NOPASSWD: /usr/pandora/scripts/op_nubmode.sh