diff options
| author | David Moc <personal@cdatgoose.org> | 2026-05-24 11:48:07 +0200 |
|---|---|---|
| committer | David Moc <personal@cdatgoose.org> | 2026-05-24 11:48:07 +0200 |
| commit | 5fb19f10389b70ee2389755106092a9ef6c64598 (patch) | |
| tree | 969eb0466de581cb14aa09f751a95138620fc720 /polybar/scripts/power-menu.sh | |
Go
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 |
