summaryrefslogtreecommitdiff
path: root/.scripts/pidkillall
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-07-09 23:06:02 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-07-09 23:06:02 +0530
commit86339c76d98cc0f150e147bcc5cdd5fdfe956a01 (patch)
treedd10286487d6f1f4cc48d1996d5200fdade79e34 /.scripts/pidkillall
parent9e4565b838df7949d6c60f21d3e06cdc0ef8d2a3 (diff)
.scripts: Adding old pdfconv,pidkillall and get current pipewire volume script
Diffstat (limited to '.scripts/pidkillall')
-rwxr-xr-x.scripts/pidkillall10
1 files changed, 10 insertions, 0 deletions
diff --git a/.scripts/pidkillall b/.scripts/pidkillall
new file mode 100755
index 0000000..f4c0e6c
--- /dev/null
+++ b/.scripts/pidkillall
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+psout=$(ps -u $USER -o pid,%cpu,%mem,comm | sed -n '1!p' | sort -b -k2 -r| cut --characters=1-18 --complement | awk '!x[$0]++'| dmenu -i -l 15 )
+##uniq without piping into sort before with the help of awk
+
+##pname of telegram-desktop is displayed as telegram-deskto
+[ "$psout" == telegram-deskto ] && psout=telegram-desktop
+
+killall $psout 2>/dev/null &&
+[ -n "$psout" ] && dunstify "Terminated all processes Successfully" "$psout was killed" -i skull