aboutsummaryrefslogtreecommitdiff
path: root/dmenu-dwm-sessionmanager
blob: 74ddcf03057c4ae3e078bd75ad8537d76b4a377c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

# Prompts menu to shutdown/reboot/close dwm
# Requires: dmenu (or equivalent), dwm (optional)

menu=${MENU:-dmenu}
menuopts="-i -p"
menuprompt="Do you want to quit?"
wmname="dwm"

shutdown_cmd="sudo shutdown -h now"
reboot_cmd="sudo reboot"
closewm_cmd="pkill $wmname"

value=$(echo "Shutdown\nReboot\nQuit dwm" | $menu $menuopts "$menuprompt")

if [ "$value" = "Shutdown" ]; then
	$shutdown_cmd
elif [ "$value" = "Reboot" ]; then
	$reboot_cmd
elif [ "$value" = "Quit $wmname" ]; then
	$closewm_cmd
fi

Generated with cgit - Back to sebastiano.tronto.net