mirror of
https://github.com/EdenQwQ/nixos.git
synced 2026-05-11 17:35:56 +08:00
22 lines
778 B
Bash
Executable file
22 lines
778 B
Bash
Executable file
#!/bin/sh
|
|
|
|
. ~/scripts/tofi/config
|
|
|
|
entry=$(printf "⏻ poweroff\n reboot\n mode\n exit\n suspend" | tofi_full "power")
|
|
entry=$(echo $entry | cut -d' ' -f2 )
|
|
|
|
if [ "$entry" = "poweroff" ] || [ "$entry" = "reboot" ]; then
|
|
if [ "$(~/scripts/tofi/confirm "confirm")" = "yes" ]; then
|
|
doas $entry
|
|
fi
|
|
elif [ "$entry" = "suspend" ]; then
|
|
systemctl suspend
|
|
elif [ "$entry" = "mode" ]; then
|
|
~/scripts/tofi/mode
|
|
elif [ "$entry" = "exit" ]; then
|
|
if [ "$(~/scripts/tofi/confirm "exit?")" = "yes" ]; then
|
|
doas killall swhkd swhks
|
|
systemctl --user stop waybar.service blueman-applet.service 'app-nm\\x2dapplet@autostart.service' app-org.fcitx.Fcitx5@autostart.service niri-blur-wallpaper.service
|
|
wayland-logout
|
|
fi
|
|
fi
|