pandora-scripts: op_menu: Pandora button now opens / closes xfce-Menu
authorMichael Mrozek <EvilDragon@openpandora.de>
Tue, 14 Jun 2011 01:00:12 +0000 (03:00 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Tue, 14 Jun 2011 01:01:00 +0000 (03:01 +0200)
recipes/pandora-system/pandora-scripts.bb
recipes/pandora-system/pandora-scripts/op_menu.sh
recipes/pandora-system/pandora-scripts/op_xfcemenu.sh [new file with mode: 0644]

index a80a15d..c970151 100644 (file)
@@ -6,7 +6,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 DEPENDS = "zenity dbus"
 RDEPENDS = "zenity dbus"
 
-PR = "r64"
+PR = "r65"
 
 SRC_URI = " \
           file://op_bright.sh \
@@ -69,6 +69,7 @@ SRC_URI = " \
          file://op_battlow.sh \ 
          file://op_bright_up.sh \  
          file://op_menu.sh \ 
+         file://op_xfcemenu.sh \
 "
 
 do_install() {
@@ -95,6 +96,7 @@ do_install() {
          install -m 0755 ${WORKDIR}/op_battlow.sh ${D}${prefix}/pandora/scripts/ 
          install -m 0755 ${WORKDIR}/op_bright_up.sh ${D}${prefix}/pandora/scripts/  
          install -m 0755 ${WORKDIR}/op_menu.sh ${D}${prefix}/pandora/scripts/ 
+         install -m 0755 ${WORKDIR}/op_xfcemenu.sh ${D}${prefix}/pandora/scripts/ 
          install -m 0755 ${WORKDIR}/reset_nubs.sh ${D}${prefix}/pandora/scripts/ 
          install -m 0644 ${WORKDIR}/pndlogo.png ${D}${prefix}/pandora/scripts/ 
          install -m 0644 ${WORKDIR}/nubmode.glade ${D}${prefix}/pandora/scripts/ 
@@ -137,7 +139,7 @@ do_install() {
          install -m 0644 ${WORKDIR}/cpu.conf ${D}${sysconfdir}/pandora/conf/cpu.conf
           install -m 0644 ${WORKDIR}/gamma.conf ${D}${sysconfdir}/pandora/conf/gamma.conf
           install -m 0644 ${WORKDIR}/service.conf ${D}${sysconfdir}/pandora/conf/service.conf
-         install -m 0644 ${WORKDIR}/nub_profiles.conf ${D}${sysconfdir}/pandora/conf/nub_profiles.conf
+         install -m 0666 ${WORKDIR}/nub_profiles.conf ${D}${sysconfdir}/pandora/conf/nub_profiles.conf
 
           install -d ${D}${sysconfdir}/pandora/conf/dss_fir/
           install -m 0644 ${WORKDIR}/default_up ${D}${sysconfdir}/pandora/conf/dss_fir/
index 6aef745..8ec9fd8 100644 (file)
@@ -23,12 +23,7 @@ if [ $xpid ]; then
     # invoke the appfinder; nice app, but it takes a few seconds to come up
     #su -c 'DISPLAY=:0.0 xfce4-appfinder' - $xfceuser
     # invoke the bottom-left popup menu, for launching new apps, instead.
-    popuppid=$(pidof xfce4-popup-menu)
-    if [ $popuppid ]; then
-       echo "popup menu is already running"
-    else
-       su -c 'DISPLAY=:0.0 xfce4-popup-menu' - $xfceuser
-    fi
+    su -c 'DISPLAY=:0.0 /usr/pandora/scripts/op_xfcemenu.sh' - $xfceuser
   fi
 else
   echo "no x, killing all pnd aps so x or DE gets restarted"
diff --git a/recipes/pandora-system/pandora-scripts/op_xfcemenu.sh b/recipes/pandora-system/pandora-scripts/op_xfcemenu.sh
new file mode 100644 (file)
index 0000000..45d7fab
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+POSMENU=`DISPLAY=:0.0 xwininfo -name xfce4-menu-plugin | egrep 'Absolute upper-left X|Absolute upper-left Y' | awk '{print $4}'`
+Xold=`DISPLAY=:0.0 xdotool getmouselocation | awk  '{print $1}' | sed 's/^..//'`
+Yold=`DISPLAY=:0.0 xdotool getmouselocation | awk  '{print $2}' | sed 's/^..//'`
+Xnew=`echo $POSMENU|awk '{print $1}'`
+Ynew=`echo $POSMENU|awk '{print $2}'`
+DISPLAY=:0.0 xdotool mousemove $Xnew $Ynew
+DISPLAY=:0.0 xdotool click 1
+DISPLAY=:0.0 xdotool mousemove $Xold $Yold