mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-26 06:08:35 +01:00
33 lines
605 B
Django/Jinja
Executable File
33 lines
605 B
Django/Jinja
Executable File
#!/usr/bin/env bash
|
|
|
|
action=$(echo -e "suspend\nlock\nlogout\nshutdown\nreboot" | wofi -d -p "power:" -L 7)
|
|
|
|
if [[ "$action" == "lock" ]]
|
|
then
|
|
swaylock-fancy --font "JetBrains-Mono-Light"
|
|
fi
|
|
|
|
if [[ "$action" == "suspend" ]]
|
|
then
|
|
{% if ansible_distribution_release == "void" %}
|
|
swaylock-fancy --font "JetBrains-Mono-Light" && sudo zzz
|
|
{% else %}
|
|
swaylock-fancy --font "JetBrains-Mono-Light" && systemctl suspend
|
|
{% endif %}
|
|
fi
|
|
|
|
if [[ "$action" == "logout" ]]
|
|
then
|
|
swaymsg exit
|
|
fi
|
|
|
|
if [[ "$action" == "shutdown" ]]
|
|
then
|
|
shutdown now
|
|
fi
|
|
|
|
if [[ "$action" == "reboot" ]]
|
|
then
|
|
reboot
|
|
fi
|