mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 15:45:39 +00:00
feat: refactor home-manager configuration for multi-host support
This commit is contained in:
parent
f20c875a48
commit
6d1fd47bea
47 changed files with 51 additions and 14 deletions
24
home/modules/graphical/powermenu.nix
Executable file
24
home/modules/graphical/powermenu.nix
Executable file
|
@ -0,0 +1,24 @@
|
|||
{ 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
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue