2022-03-21 18:05:05 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
2022-04-05 16:59:13 +02:00
|
|
|
# kill those pesky proceses
|
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
load_config() {
|
|
|
|
. $HOME/.config/dmenu/config
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
2022-07-17 11:03:13 +02:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
main() {
|
|
|
|
load_config
|
2022-03-21 18:05:05 +01:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
pid=$(ps -e -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
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
[ -n "$pid" ] || exit
|
2022-03-21 18:05:05 +01:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
answer=$(printf "yes\\nno" | $DMENU -p "Are you sure?")
|
2022-03-21 18:05:05 +01:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
[ $answer = "yes" ] || exit
|
2022-03-21 18:05:05 +01:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
kill -15 $pid 2>/dev/null
|
2022-11-04 14:54:08 +01:00
|
|
|
|
2023-11-04 22:03:43 +01:00
|
|
|
quick-notify "Killed Procces" "$pid"
|
2022-11-04 14:54:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
main $@
|