commit 78aee1968fa33d935a72c701671cc7bcdb0c5e8a
parent 232a32a021e8a43dc41316672f3f775baccadce2
Author: Vincent Demeester <vincent@sbr.pm>
Date: Tue, 26 Mar 2019 16:34:29 +0100
modules: migrate screen saver to desktop…
… and enhance screensaver with a cool dim :)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Diffstat:
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/modules/profiles/desktop.nix b/modules/profiles/desktop.nix
@@ -3,6 +3,15 @@
with lib;
let
cfg = config.profiles.desktop;
+ dim-screen = pkgs.writeScript "dim-sreen.sh" ''
+#!${pkgs.stdenv.shell}
+export PATH=${lib.getBin pkgs.xlibs.xbacklight}/bin:$PATH
+trap "exit 0" INT TERM
+trap "kill \$(jobs -p); xbacklight -steps 1 -set $(xbacklight -get);" EXIT
+xbacklight -time 5000 -steps 400 -set 0 &
+sleep 2147483647 &
+wait
+ '';
in
{
options = {
@@ -12,6 +21,11 @@ in
description = "Enable desktop profile";
type = types.bool;
};
+ lockCmd = mkOption {
+ default = "-n ${dim-screen} -- ${pkgs.slim}/bin/slimlock";
+ description = "Lock command to use";
+ type = types.str;
+ };
xsession = {
enable = mkOption {
default = true;
@@ -62,6 +76,11 @@ in
longitude = "7.5";
tray = true;
};
+ screen-locker = {
+ enable = true;
+ lockCmd = cfg.lockCmd;
+ inactiveInterval = 15;
+ };
};
home.file.".XCompose".source = ./assets/xorg/XCompose;
home.file.".Xmodmap".source = ./assets/xorg/Xmodmap;
diff --git a/modules/profiles/i3.nix b/modules/profiles/i3.nix
@@ -13,11 +13,6 @@ in
description = "Enable i3 profile";
type = types.bool;
};
- lockCmd = mkOption {
- default = "slimlock"; # "i3lock-color --clock --color=606060"
- description = "Lock command to use";
- type = types.str;
- };
};
};
config = mkIf cfg.enable {
@@ -55,11 +50,6 @@ in
};
udiskie.enable = true;
network-manager-applet.enable = true;
- screen-locker = {
- enable = true;
- lockCmd = cfg.lockCmd;
- inactiveInterval = 15;
- };
random-background = {
enable = true;
imageDirectory = "${config.home.homeDirectory}/desktop/pictures/walls";