mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 11:35:41 +00:00
24 lines
572 B
Nix
Executable file
24 lines
572 B
Nix
Executable file
{ pkgs, ... }:
|
|
|
|
{
|
|
home.packages = [
|
|
(pkgs.writeShellScriptBin "powermenu" ''
|
|
choice=$(printf """
|
|
Logout
|
|
⏻ Shutdown
|
|
Reboot
|
|
Suspend
|
|
Hibernate
|
|
""" | ${pkgs.tofi}/bin/tofi)
|
|
|
|
case "$choice" in
|
|
" Logout") ${pkgs.uwsm}/bin/uwsm stop ;;
|
|
"⏻ Shutdown") ${pkgs.systemd}/bin/systemctl poweroff ;;
|
|
" Reboot") ${pkgs.systemd}/bin/systemctl reboot ;;
|
|
" Suspend") ${pkgs.systemd}/bin/systemctl suspend ;;
|
|
" Hibernate") ${pkgs.systemd}/bin/systemctl hibernate ;;
|
|
esac
|
|
'')
|
|
];
|
|
}
|
|
|