mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-25 16:58:38 -05:00
34 lines
506 B
Bash
Executable File
34 lines
506 B
Bash
Executable File
#!/bin/bash
|
|
|
|
case $1 in
|
|
--bemenu)
|
|
menu="bemenu -i -p kill -l 10"
|
|
;;
|
|
--dmenu)
|
|
menu="dmenu -i -p kill -l 10"
|
|
;;
|
|
--fzf)
|
|
menu="fzf --multi"
|
|
;;
|
|
--wofi)
|
|
menu="wofi -d -i -p kill"
|
|
;;
|
|
--rofi)
|
|
menu="rofi -dmenu -p kill"
|
|
;;
|
|
*)
|
|
exit
|
|
;;
|
|
esac
|
|
|
|
if [ "$UID" != "0" ]; then
|
|
pid=$(ps -f -u $UID | sed 1d | ${menu} | awk '{print $2}')
|
|
else
|
|
pid=$(ps -ef | sed 1d | ${menu} | awk '{print $2}')
|
|
fi
|
|
|
|
if [ "x$pid" != "x" ]
|
|
then
|
|
echo $pid | xargs kill -${1:-9}
|
|
fi
|