diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-03-19 23:14:56 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-03-19 23:14:56 +0200 |
| commit | 52d87e2329eaa5f56a1f0bad3913bd5820537f53 (patch) | |
| tree | 7792709b11e868bfaa47a2563d12984c11dc9900 /kill-process | |
| parent | d61d656e6f5ea67c6e41a20af024190fabc7d219 (diff) | |
| download | dotfiles-52d87e2329eaa5f56a1f0bad3913bd5820537f53.tar.gz dotfiles-52d87e2329eaa5f56a1f0bad3913bd5820537f53.zip | |
Add kill-process script
Diffstat (limited to 'kill-process')
| -rwxr-xr-x | kill-process | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kill-process b/kill-process new file mode 100755 index 0000000..5247e5f --- /dev/null +++ b/kill-process @@ -0,0 +1,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") |
