summaryrefslogtreecommitdiff
path: root/.scripts/pidkill
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-08-01 13:06:41 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-08-01 13:06:41 +0530
commita92b011530cbfa250700d403b4c706ad0240cd07 (patch)
treed7f0942c36ff6ec9014cba355b43ae96872d7c5f /.scripts/pidkill
parent542d2e988b4b489b9038c55bcac919d0b026dbb8 (diff)
sxhkd pidkillall + blank notif correction
Diffstat (limited to '.scripts/pidkill')
-rwxr-xr-x.scripts/pidkill6
1 files changed, 3 insertions, 3 deletions
diff --git a/.scripts/pidkill b/.scripts/pidkill
index e75687f..754a610 100755
--- a/.scripts/pidkill
+++ b/.scripts/pidkill
@@ -1,9 +1,9 @@
#!/bin/sh
-prok=$(ps -u $USER -o pid,%mem,%cpu,comm | sort -b -k2 -r | sed -n '1!p' | dmenu -i -l 15 )
+prok=$(ps -u $USER -o pid,%mem,%cpu,comm | sed -n '1!p' | sort -b -k2 -r | dmenu -i -l 15 )
pid=$(echo $prok | awk '{print $1}')
pname=$(echo $prok | awk '{print $4}')
-kill -15 $pid 2>/dev/null
-[ -z $pname ] || dunstify "Terminated process Successfully" "$pname was killed"
+kill -15 $pid 2>/dev/null &&
+[ -n $pname ] && dunstify "Terminated process Successfully" "$pname was killed"