Configured swayidle
This commit is contained in:
parent
d1063519b5
commit
bcd4db1758
40
modules/desktop/addons/swayidle/default.nix
Normal file
40
modules/desktop/addons/swayidle/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
options,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.aa.desktop.addons.swayidle;
|
||||||
|
in {
|
||||||
|
options.aa.desktop.addons.swayidle = with types; {
|
||||||
|
enable = mkEnableOption "swayidle";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [swayidle];
|
||||||
|
|
||||||
|
aa.home.extraOptions = {
|
||||||
|
services.swayidle = {
|
||||||
|
timeouts = [
|
||||||
|
{
|
||||||
|
timeout = 300;
|
||||||
|
command = "${pkgs.swaylock}/bin/swaylock";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
timeout = 600;
|
||||||
|
command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
|
||||||
|
resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
events = [
|
||||||
|
{
|
||||||
|
event = "before-sleep";
|
||||||
|
command = "${pkgs.swaylock}/bin/swaylock";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -31,6 +31,7 @@ in {
|
||||||
mako.enable = true;
|
mako.enable = true;
|
||||||
playerctl.enable = true;
|
playerctl.enable = true;
|
||||||
rofi.enable = true;
|
rofi.enable = true;
|
||||||
|
swayidle.enable = true;
|
||||||
swaylock.enable = true;
|
swaylock.enable = true;
|
||||||
waybar.enable = true;
|
waybar.enable = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue