1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/private_dot_config/polybar/bin/executable_services

22 lines
466 B
Plaintext
Raw Normal View History

2020-03-08 18:11:07 +00:00
#!/usr/bin/env sh
. ~/.cache/wal/colors.sh
selected=$(systemctl list-unit-files --no-pager --type=service --no-legend | dmenu -nb "$color0" -nf "$color15" -sb "$color1" -sf "$color15" | awk '{print $1;}')
selected=$(echo $selected | awk '{print $1;}')
action=$(echo -e "start\nstop\nrestart" | dmenu)
case "$action" in
"start")
sudo systemctl start $selected
;;
"stop")
sudo systemctl stop $selected
;;
"restart")
sudo systemctl restart $selected
;;
esac