diff options
Diffstat (limited to 'polybar/scripts/power-menu.sh')
| -rwxr-xr-x | polybar/scripts/power-menu.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/polybar/scripts/power-menu.sh b/polybar/scripts/power-menu.sh new file mode 100755 index 0000000..ab59352 --- /dev/null +++ b/polybar/scripts/power-menu.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -euo pipefail + +export DISPLAY="${DISPLAY:-:0}" +if [ -z "${XAUTHORITY:-}" ] && [ -r "$HOME/.Xauthority" ]; then + export XAUTHORITY="$HOME/.Xauthority" +fi + +choice="$( + printf '%s\n' lock logout suspend reboot shutdown | + dmenu -i -p power \ + -fn "FiraCode Nerd Font-14" \ + -nb "#282828" -nf "#ebdbb2" \ + -sb "#d79921" -sf "#282828" +)" + +case "$choice" in + lock) + i3lock + ;; + logout) + i3-msg exit + ;; + suspend) + loginctl suspend + ;; + reboot) + loginctl reboot + ;; + shutdown) + loginctl poweroff + ;; +esac |
