From cc1d36538b3ba02bfa97f3e6ac6a12d1a536bff9 Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Tue, 14 Jun 2011 03:00:12 +0200 Subject: [PATCH] pandora-scripts: op_menu: Pandora button now opens / closes xfce-Menu --- recipes/pandora-system/pandora-scripts.bb | 6 ++++-- recipes/pandora-system/pandora-scripts/op_menu.sh | 7 +------ recipes/pandora-system/pandora-scripts/op_xfcemenu.sh | 9 +++++++++ 3 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 recipes/pandora-system/pandora-scripts/op_xfcemenu.sh diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index a80a15d..c970151 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -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/ diff --git a/recipes/pandora-system/pandora-scripts/op_menu.sh b/recipes/pandora-system/pandora-scripts/op_menu.sh index 6aef745..8ec9fd8 100644 --- a/recipes/pandora-system/pandora-scripts/op_menu.sh +++ b/recipes/pandora-system/pandora-scripts/op_menu.sh @@ -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 index 0000000..45d7fab --- /dev/null +++ b/recipes/pandora-system/pandora-scripts/op_xfcemenu.sh @@ -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 -- 2.39.2