mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 15:01:59 +01:00
powermenu void
This commit is contained in:
parent
ef93c0ccd7
commit
6c53fd0df8
32
roles/wofi/templates/powermenu.sh.j2
Executable file
32
roles/wofi/templates/powermenu.sh.j2
Executable file
@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
action=$(echo -e "suspend\nlock\nlogout\nshutdown\nreboot" | wofi -d -p "power:" -L 5)
|
||||
|
||||
if [[ "$action" == "lock" ]]
|
||||
then
|
||||
swaylock-fancy
|
||||
fi
|
||||
|
||||
if [[ "$action" == "suspend" ]]
|
||||
then
|
||||
{% if ansible_distribution_release == "void" %}
|
||||
sudo zzz
|
||||
{% else %}
|
||||
swaylock-fancy && systemctl suspend && echo '*/reconnect' >~/.weechat/weechat_fifo
|
||||
{% endif %}
|
||||
fi
|
||||
|
||||
if [[ "$action" == "logout" ]]
|
||||
then
|
||||
swaymsg exit
|
||||
fi
|
||||
|
||||
if [[ "$action" == "shutdown" ]]
|
||||
then
|
||||
shutdown now
|
||||
fi
|
||||
|
||||
if [[ "$action" == "reboot" ]]
|
||||
then
|
||||
reboot
|
||||
fi
|
Loading…
Reference in New Issue
Block a user