My Scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
bin/killd

29 lines
414 B

#!/usr/bin/env bash
# Kill programs, using dmenu to get input
declare -A map
# Setup accronyms
map[tg]=telegram-desktop
map[cord]=Discord
map[spot]=spotify
# Get input
input=$(printf '' | dmenu)
# Translate
kill=( )
for prog in $input
do
if [ -n "${map[$prog]}" ]
then
kill+=( "${map[$prog]}" )
else
kill+=( "$prog" )
fi
done
[ -z "$input" ] && exit
echo "Killing ${kill[*]}"
killall -9 "${kill[@]}"