aboutsummaryrefslogtreecommitdiff
path: root/common/scripts/utils/kill-process
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-09-24 05:45:26 +0200
committersrdusr <trevorgray@srdusr.com>2025-09-24 05:45:26 +0200
commitd96a422496fe3a6b80659a720e63c6abc41b7de9 (patch)
tree20f90abb5ce91875a40027333efbb52877902132 /common/scripts/utils/kill-process
parent521215add7da7fef6722c7b5adec839b84d72db0 (diff)
parenta1627ac743289e768b138f1a60753a62e0869cc4 (diff)
downloaddotfiles-d96a422496fe3a6b80659a720e63c6abc41b7de9.tar.gz
dotfiles-d96a422496fe3a6b80659a720e63c6abc41b7de9.zip
Add 'common/scripts/' from commit 'a1627ac743289e768b138f1a60753a62e0869cc4'
git-subtree-dir: common/scripts git-subtree-mainline: 521215add7da7fef6722c7b5adec839b84d72db0 git-subtree-split: a1627ac743289e768b138f1a60753a62e0869cc4
Diffstat (limited to 'common/scripts/utils/kill-process')
-rwxr-xr-xcommon/scripts/utils/kill-process6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/scripts/utils/kill-process b/common/scripts/utils/kill-process
new file mode 100755
index 0000000..5247e5f
--- /dev/null
+++ b/common/scripts/utils/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")