#!/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