simplified the kill script.

This commit is contained in:
Crony Akatsuki 2022-08-01 17:51:24 +02:00
parent 4ad6661c5f
commit 436a2b9505

View File

@ -4,14 +4,14 @@
source $HOME/.config/dmenu/config source $HOME/.config/dmenu/config
selected=$(ps --user "$USER" -F | $DMENU -p "Select procces to kill:" -l 5 | awk '{print $2" "$11}') 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}')
[ -n "$selected" ] || exit [ -n "$pid" ] || exit
answer=$(printf "yes\\nno" | $DMENU -p "Are you sure?") answer=$(printf "yes\\nno" | $DMENU -p "Are you sure?")
[ $answer = "yes" ] || exit [ $answer = "yes" ] || exit
kill -9 "${selected%% *}" kill -15 $pid 2>/dev/null
quick-notify "Killed Procces" "$selected" quick-notify "Killed Procces" "$pid"