mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
feat[client]: add swayidle
This commit is contained in:
parent
116a099732
commit
870c55b889
4 changed files with 74 additions and 4 deletions
|
|
@ -11649,7 +11649,7 @@ Also in firefox `about:config > toolkit.legacyUserProfileCustomizations.styleshe
|
||||||
"tridactyl/tridactylrc".source = self + /files/firefox/tridactyl/tridactylrc;
|
"tridactyl/tridactylrc".source = self + /files/firefox/tridactyl/tridactylrc;
|
||||||
"tridactyl/themes/base16-codeschool.css".source = self + /files/firefox/tridactyl/themes/base16-codeschool.css;
|
"tridactyl/themes/base16-codeschool.css".source = self + /files/firefox/tridactyl/themes/base16-codeschool.css;
|
||||||
"tridactyl/themes/swarsel.css".source = self + /files/firefox/tridactyl/themes/swarsel.css;
|
"tridactyl/themes/swarsel.css".source = self + /files/firefox/tridactyl/themes/swarsel.css;
|
||||||
"swayidle/config".source = self + /files/swayidle/config;
|
# "swayidle/config".source = self + /files/swayidle/config;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -14003,7 +14003,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se
|
||||||
# exec_always autotiling
|
# exec_always autotiling
|
||||||
|
|
||||||
exec systemctl --user import-environment
|
exec systemctl --user import-environment
|
||||||
exec swayidle -w
|
# exec swayidle -w
|
||||||
|
|
||||||
seat * hide_cursor 2000
|
seat * hide_cursor 2000
|
||||||
|
|
||||||
|
|
@ -14873,6 +14873,43 @@ This service changes the screen hue at night. I am not sure if that really does
|
||||||
}
|
}
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
**** swayidle
|
||||||
|
|
||||||
|
#+begin_src nix-ts :tangle modules/home/common/swayidle.nix
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
moduleName = "swayidle";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings";
|
||||||
|
config = lib.mkIf config.swarselmodules.${moduleName} {
|
||||||
|
services.${moduleName} =
|
||||||
|
let
|
||||||
|
brightnessctl = "${lib.getExe pkgs.brightnessctl}";
|
||||||
|
swaylock = "${lib.getExe pkgs.swaylock-effects}";
|
||||||
|
suspend = "${pkgs.systemd}/bin/systemctl";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
systemdTarget = config.wayland.systemd.target;
|
||||||
|
extraArgs = [ "-w" ];
|
||||||
|
timeouts = [
|
||||||
|
{ timeout = 60; command = "${brightnessctl} -s; ${brightnessctl} set 80%-"; resumeCommand = "${brightnessctl} -r"; }
|
||||||
|
# { timeout = 300; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; }
|
||||||
|
{ timeout = 300; command = "${swaylock} -f"; }
|
||||||
|
# { timeout = 600; command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"; resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on''; }
|
||||||
|
{ timeout = 600; command = "${suspend}"; }
|
||||||
|
];
|
||||||
|
events = [
|
||||||
|
# { event = "before-sleep"; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; }
|
||||||
|
{ event = "before-sleep"; command = "${swaylock} -f "; }
|
||||||
|
{ event = "lock"; command = "${swaylock} -f "; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
#+end_src
|
||||||
|
|
||||||
**** swaylock
|
**** swaylock
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
exec systemctl --user import-environment
|
exec systemctl --user import-environment
|
||||||
exec swayidle -w
|
# exec swayidle -w
|
||||||
|
|
||||||
seat * hide_cursor 2000
|
seat * hide_cursor 2000
|
||||||
|
|
||||||
|
|
|
||||||
33
modules/home/common/swayidle.nix
Normal file
33
modules/home/common/swayidle.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
moduleName = "swayidle";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.swarselmodules.${moduleName} = lib.mkEnableOption "enable ${moduleName} and settings";
|
||||||
|
config = lib.mkIf config.swarselmodules.${moduleName} {
|
||||||
|
services.${moduleName} =
|
||||||
|
let
|
||||||
|
brightnessctl = "${lib.getExe pkgs.brightnessctl}";
|
||||||
|
swaylock = "${lib.getExe pkgs.swaylock-effects}";
|
||||||
|
suspend = "${pkgs.systemd}/bin/systemctl";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
systemdTarget = config.wayland.systemd.target;
|
||||||
|
extraArgs = [ "-w" ];
|
||||||
|
timeouts = [
|
||||||
|
{ timeout = 60; command = "${brightnessctl} -s; ${brightnessctl} set 80%-"; resumeCommand = "${brightnessctl} -r"; }
|
||||||
|
# { timeout = 300; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; }
|
||||||
|
{ timeout = 300; command = "${swaylock} -f"; }
|
||||||
|
# { timeout = 600; command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"; resumeCommand = "${pkgs.sway}/bin/swaymsg output * dpms on''; }
|
||||||
|
{ timeout = 600; command = "${suspend}"; }
|
||||||
|
];
|
||||||
|
events = [
|
||||||
|
# { event = "before-sleep"; command = "${lib.getExe pkgs.swaylock-effects} -f --screenshots --clock --effect-blur 7x5 --effect-vignette 0.5:0.5 --fade-in 0.2"; }
|
||||||
|
{ event = "before-sleep"; command = "${swaylock} -f "; }
|
||||||
|
{ event = "lock"; command = "${swaylock} -f "; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
"tridactyl/tridactylrc".source = self + /files/firefox/tridactyl/tridactylrc;
|
"tridactyl/tridactylrc".source = self + /files/firefox/tridactyl/tridactylrc;
|
||||||
"tridactyl/themes/base16-codeschool.css".source = self + /files/firefox/tridactyl/themes/base16-codeschool.css;
|
"tridactyl/themes/base16-codeschool.css".source = self + /files/firefox/tridactyl/themes/base16-codeschool.css;
|
||||||
"tridactyl/themes/swarsel.css".source = self + /files/firefox/tridactyl/themes/swarsel.css;
|
"tridactyl/themes/swarsel.css".source = self + /files/firefox/tridactyl/themes/swarsel.css;
|
||||||
"swayidle/config".source = self + /files/swayidle/config;
|
# "swayidle/config".source = self + /files/swayidle/config;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue