X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-libraries.git;a=blobdiff_plain;f=testdata%2Fscripts%2Fop_menu.sh;h=6aef745f28d84ac0a2fc9b10a6fc0d1c99505538;hp=267472d2b7536457897c00a3bfb2364bf0a5ef45;hb=8075d3dba75ec1bf935e452595897d160f39244a;hpb=45028c728dc3cf3e4cb5dc83081ae1d2b7018a4f diff --git a/testdata/scripts/op_menu.sh b/testdata/scripts/op_menu.sh index 267472d..6aef745 100755 --- a/testdata/scripts/op_menu.sh +++ b/testdata/scripts/op_menu.sh @@ -2,14 +2,15 @@ #actions done when the menu button is pressed #only argument is the time the button was pressed in seconds -if [ "$1" -ge "3" ]; then #button was pressed 3 sec or longer, show list of apps to kill instead of launcher +if [ "$1" -ge "2" ]; then #button was pressed 3 sec or longer, show list of apps to kill instead of launcher killist=y fi -xpid=$(pidof X) +xpid=$(pidof xfce4-session) if [ $xpid ]; then - echo "x is running" - xfceuser=$(ps u -C xfce4-session | tail -n1 | awk '{print $1}') + echo "xfce4 is running" + # note: max username length ps can output is 19, otherwise it prints uid + xfceuser=$(ps -o user:20= -C xfce4-session | tail -n1 | awk '{print $1}') if [ $killist ]; then echo "displaying kill list" pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*-\(.*\)(\([0-9]\+\))/\2\n \1/p' | su -c 'DISPLAY=:0.0 zenity --list --multiple --column "pid" --column "name" --title "kill" --text "which apps should be killed"' - $xfceuser | sed 's/|/\n/') @@ -18,11 +19,19 @@ if [ $xpid ]; then kill -9 $PID done else - echo "starting appfinder" - su -c 'DISPLAY=:0.0 xfce4-appfinder' - $xfceuser + # echo "starting appfinder" + # 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 fi else - echo "no x, killing all pnd aps so x gets restarted" + echo "no x, killing all pnd aps so x or DE gets restarted" pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p') for PID in $pidlist do