aboutsummaryrefslogtreecommitdiff
path: root/utils/kill-process
blob: 5247e5fc996d40d2c2d649aee488546d71f1bead (plain)
1
2
3
4
5
6
#!/bin/sh
# pipes list of processes into rofi/dmenu and kills the selection

proc=$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | dmenu -i -p "Kill" | awk '{print $1,$4}')

[ -z "$proc" ] || (kill -15 $(echo $proc | awk '{print $1}') 2>/dev/null && notify-send "$(echo $proc | awk '{print $2}') killed")