aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/pwrman
blob: ef0823b29a356a381654692d37d5291d28d63bd1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env zsh

dmenu_fn=Roboto
dmenu_nb="#0e2133"
dmenu_nf="#e6e0cf"
dmenu_sb="#7390bf"
dmenu_sf="#0e2133"

menu() {
  dmenu -fn "$dmenu_fn" -nf "$dmenu_nf" -nb "$dmenu_nb" -sb "$dmenu_sb" -sf "$dmenu_sf" -p "$1"
}

action=$(echo "lock screen\nreboot\nshutdown" | menu "Action:")
if [[ "$action" == "lock screen" ]]; then
  i3lock-fancy -- scrot -z
elif [[ "$action" == "reboot" ]]; then
  i3-nagbar -t warning -m "Are you sure you want to reboot?" -B "Reboot" "reboot"
elif [[ "$action" == "shutdown" ]]; then
  i3-nagbar -t warning -m "Are you sure you want to shut down?" -B "Shut Down" "sudo shutdown -h now"
fi