2 #actions done when the menu button is pressed
3 #only argument is the time the button was pressed in seconds
5 if [ "$1" -ge "1" ]; then #button was pressed 3 sec or longer, show list of apps to kill instead of launcher
12 xfceuser=$(ps u -C xfce4-session | tail -n1 | awk '{print $1}')
14 echo "displaying kill list"
15 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/')
21 echo "starting appfinder"
22 su -c 'DISPLAY=:0.0 xfce4-appfinder' - $xfceuser
25 echo "no x, killing all pnd aps so x gets restarted"
26 pidlist=$(pstree -lpA | grep pnd_run.sh | sed -ne 's/.*(\([0-9]\+\))/\1/p')