home/programs/swayidle: add configuration, setup with loginctl
This commit is contained in:
parent
7f98200cd8
commit
c5fdfffaf6
3 changed files with 31 additions and 4 deletions
|
@ -9,6 +9,7 @@
|
|||
"${self}/home/programs/fuzzel.nix"
|
||||
"${self}/home/programs/swaybg.nix"
|
||||
"${self}/home/programs/swaylock.nix"
|
||||
"${self}/home/programs/swayidle.nix"
|
||||
|
||||
"${self}/home/terminal/emulators/foot.nix"
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
{config, ...}: let
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
appLauncher = "fuzzel";
|
||||
terminal = "foot";
|
||||
screenLocker = "swaylock";
|
||||
in {
|
||||
programs.niri.settings.binds = {
|
||||
"Mod+D".action.spawn = appLauncher;
|
||||
|
@ -114,8 +118,10 @@ in {
|
|||
"Alt+Print".action = config.lib.niri.actions.screenshot-window;
|
||||
|
||||
# System
|
||||
"Mod+Shift+P".action = config.lib.niri.actions.power-off-monitors;
|
||||
"Mod+Alt+L".action.spawn = screenLocker;
|
||||
"Mod+Alt+L".action.spawn = [
|
||||
"${lib.getExe' pkgs.systemd "loginctl"}"
|
||||
"lock-session"
|
||||
];
|
||||
|
||||
# Media keys
|
||||
"XF86AudioRaiseVolume" = {
|
||||
|
|
20
home/programs/swayidle.nix
Normal file
20
home/programs/swayidle.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
events = [
|
||||
{
|
||||
event = "lock";
|
||||
command = "${lib.getExe config.programs.swaylock.package}";
|
||||
}
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${lib.getExe config.programs.swaylock.package}";
|
||||
}
|
||||
];
|
||||
};
|
||||
systemd.user.services.swayidle.Unit.After = lib.mkForce ["graphical-session.target"];
|
||||
}
|
Loading…
Reference in a new issue