treewide: spawn wlogout on power button short press
This commit is contained in:
parent
881ffab221
commit
bc2ebd6c82
4 changed files with 78 additions and 8 deletions
|
@ -8,14 +8,19 @@
|
|||
terminal = "foot";
|
||||
browser = "firefox";
|
||||
prefix = "Alt";
|
||||
guiFileManager = "nautilus";
|
||||
cliFileManager = "${terminal} -e yazi";
|
||||
in {
|
||||
programs.niri.settings.binds = {
|
||||
"${prefix}+D".action.spawn = appLauncher;
|
||||
"${prefix}+Return".action.spawn = terminal;
|
||||
"${prefix}+W".action.spawn = browser;
|
||||
"${prefix}+Shift+E".action.quit.skip-confirmation = true;
|
||||
"${prefix}+E".action.spawn = guiFileManager;
|
||||
"${prefix}+Shift+E".action.spawn = cliFileManager;
|
||||
|
||||
"${prefix}+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay;
|
||||
"${prefix}+Q".action = config.lib.niri.actions.close-window;
|
||||
"${prefix}+Shift+Q".action.quit.skip-confirmation = true;
|
||||
"${prefix}+F".action = config.lib.niri.actions.maximize-column;
|
||||
"${prefix}+Shift+F".action = config.lib.niri.actions.fullscreen-window;
|
||||
"${prefix}+C".action = config.lib.niri.actions.center-column;
|
||||
|
@ -157,5 +162,7 @@ in {
|
|||
"XF86AudioMedia" = {
|
||||
action.spawn = ["sh" "-c" "env XDG_CURRENT_DESKTOP=gnome gnome-control-center"];
|
||||
};
|
||||
|
||||
"XF86PowerOff".action.spawn = "wlogout";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -26,10 +26,13 @@ in {
|
|||
|
||||
programs.niri = {
|
||||
settings = {
|
||||
input.keyboard.xkb = {
|
||||
input = {
|
||||
power-key-handling.enable = false;
|
||||
keyboard.xkb = {
|
||||
layout = "us";
|
||||
options = "compose:ralt";
|
||||
};
|
||||
};
|
||||
|
||||
prefer-no-csd = true;
|
||||
hotkey-overlay.skip-at-startup = true;
|
||||
|
@ -117,4 +120,64 @@ in {
|
|||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
|
||||
programs.wlogout = {
|
||||
enable = true;
|
||||
|
||||
layout = let
|
||||
systemd = let
|
||||
systemd = lib.getExe' pkgs.systemd;
|
||||
in {
|
||||
loginctl = systemd "loginctl";
|
||||
systemctl = systemd "systemctl";
|
||||
};
|
||||
in [
|
||||
{
|
||||
action = "${systemd.loginctl} lock-session";
|
||||
keybind = "l";
|
||||
label = "lock";
|
||||
text = "Lock";
|
||||
}
|
||||
|
||||
{
|
||||
action = "${systemd.systemctl} hibernate";
|
||||
keybind = "h";
|
||||
label = "hibernate";
|
||||
text = "Hibernate";
|
||||
}
|
||||
|
||||
{
|
||||
action = "${
|
||||
systemd.loginctl
|
||||
} terminate-user ${
|
||||
config.home.username
|
||||
}";
|
||||
|
||||
keybind = "q";
|
||||
label = "logout";
|
||||
text = "Logout";
|
||||
}
|
||||
|
||||
{
|
||||
action = "${systemd.systemctl} poweroff";
|
||||
keybind = "p";
|
||||
label = "shutdown";
|
||||
text = "Shutdown";
|
||||
}
|
||||
|
||||
{
|
||||
action = "${systemd.systemctl} suspend";
|
||||
keybind = "s";
|
||||
label = "suspend";
|
||||
text = "Suspend";
|
||||
}
|
||||
|
||||
{
|
||||
action = "${systemd.systemctl} reboot";
|
||||
keybind = "r";
|
||||
label = "reboot";
|
||||
text = "Reboot";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{
|
||||
services.logind = {
|
||||
lidSwitch = "suspend";
|
||||
extraConfig = ''
|
||||
HandlePowerKey=ignore
|
||||
HandlePowerKeyLongPress=poweroff
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{
|
||||
services = {
|
||||
logind.extraConfig = ''
|
||||
HandlePowerKey=suspend
|
||||
'';
|
||||
|
||||
power-profiles-daemon.enable = true;
|
||||
|
||||
# battery info
|
||||
|
|
Loading…
Reference in a new issue