#actions done when the menu button is pressed
#only argument is the time the button was pressed in seconds
+if [ -x /usr/pandora/scripts/op_menu_custom.sh ]; then
+ exec /usr/pandora/scripts/op_menu_custom.sh "$@"
+fi
+
+do_kill()
+{
+ for PID in "$@"; do
+ kill $PID
+ done
+ sleep 1
+ for PID in "$@"; do
+ kill -9 $PID
+ done
+}
+
if [ "$1" -ge "2" ]; then #button was pressed 3 sec or longer, show list of apps to kill instead of launcher
killist=y
+
+ # if something uses fb1 or SGX, try killing them instead
+ fb_users=`lsof -t /dev/fb1 /dev/pvrsrvkm`
+ if [ -n "$fb_users" ]; then
+ do_kill $fb_users
+ fi
+ exit 1
fi
xpid=$(pidof xfce4-session)
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/')
- for PID in $pidlist
- do
- kill -9 $PID
- done
+ do_kill $pidlist
else
# echo "starting appfinder"
# invoke the appfinder; nice app, but it takes a few seconds to come up
else
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
- kill -9 $PID
- done
+ do_kill $pidlist
fi