dmenu-scripts/dmenu-kill

18 lines
377 B
Plaintext
Raw Normal View History

2022-03-21 18:05:05 +01:00
#!/bin/sh
2022-04-05 16:59:13 +02:00
# kill those pesky proceses
2022-07-17 11:03:13 +02:00
source $HOME/.config/dmenu/config
2022-08-01 17:51:24 +02:00
pid=$(ps -u $USER -o pid,%mem,%cpu,comm,cmd | sort -b -k3 -r | dmenu -l 15 -i -p "Choose procces to kill: " | awk '{print $1}')
2022-03-21 18:05:05 +01:00
2022-08-01 17:51:24 +02:00
[ -n "$pid" ] || exit
2022-03-21 18:05:05 +01:00
2022-07-17 11:03:13 +02:00
answer=$(printf "yes\\nno" | $DMENU -p "Are you sure?")
2022-03-21 18:05:05 +01:00
[ $answer = "yes" ] || exit
2022-08-01 17:51:24 +02:00
kill -15 $pid 2>/dev/null
2022-03-21 18:05:05 +01:00
2022-08-01 17:51:24 +02:00
quick-notify "Killed Procces" "$pid"