Auto brightness + dunst notification
This commit is contained in:
parent
6d5925d6a5
commit
4befb01e03
3 changed files with 14 additions and 21 deletions
|
|
@ -3,31 +3,20 @@
|
|||
with lib;
|
||||
|
||||
let
|
||||
xscreensaverCmd = "${pkgs.xscreensaver}/bin/xscreensaver-command -activate";
|
||||
lockCmd = "${pkgs.lockscreen}/bin/lockscreen";
|
||||
xbacklightCmd = "${pkgs.xorg.xbacklight}/bin/xbacklight";
|
||||
lightLevel = 10;
|
||||
in
|
||||
{
|
||||
services.xidlehook = {
|
||||
enable = true;
|
||||
# not-when-audio = false;
|
||||
not-when-audio = true;
|
||||
not-when-fullscreen = true;
|
||||
timers = [
|
||||
{
|
||||
command = lockCmd;
|
||||
delay = 300;
|
||||
}
|
||||
{
|
||||
command = xscreensaverCmd;
|
||||
delay = 120;
|
||||
command = "${xbacklightCmd} -get > /tmp/xbacklight_v && ${xbacklightCmd} -set ${toString lightLevel}";
|
||||
canceller = "${xbacklightCmd} -set $(cat /tmp/xbacklight_v || echo 100)";
|
||||
delay = 30;
|
||||
}
|
||||
];
|
||||
};
|
||||
services.xscreensaver = {
|
||||
enable = true;
|
||||
settings = {
|
||||
mode = "blank";
|
||||
fadeTicks = 20;
|
||||
lock = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue