From daa325a42518f1725f807f90fac281deb16bd7ae Mon Sep 17 00:00:00 2001 From: Alexandre LUCAZEAU Date: Tue, 24 May 2022 20:57:18 +0200 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20DELL/nixpkgs/home.nix=20=09modifi=C3=A9=C2=A0:=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20DELL/nixpkgs/variables.nix=20=09nouveau=20fichie?= =?UTF-8?q?r=C2=A0:=20DELL/nixpkgs/xidlehook.nix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DELL/nixpkgs/home.nix | 1 + DELL/nixpkgs/variables.nix | 1 + DELL/nixpkgs/xidlehook.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 DELL/nixpkgs/xidlehook.nix diff --git a/DELL/nixpkgs/home.nix b/DELL/nixpkgs/home.nix index 2151555..134f893 100644 --- a/DELL/nixpkgs/home.nix +++ b/DELL/nixpkgs/home.nix @@ -18,4 +18,5 @@ xdg.configFile = { "i3/config".source = ./configs/i3config; }; + xsession.numlock.enable = true; } diff --git a/DELL/nixpkgs/variables.nix b/DELL/nixpkgs/variables.nix index 0ec515d..5011333 100644 --- a/DELL/nixpkgs/variables.nix +++ b/DELL/nixpkgs/variables.nix @@ -7,6 +7,7 @@ TERMINAL = "xfce4-terminal"; BROWSER = "firefox"; PRIVATE_BROWSER = "firefox -private"; + default-web-browser = "firefox"; # }; }; } diff --git a/DELL/nixpkgs/xidlehook.nix b/DELL/nixpkgs/xidlehook.nix new file mode 100644 index 0000000..3ae0b1a --- /dev/null +++ b/DELL/nixpkgs/xidlehook.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: +{ + services.xidlehook = { + enable = true; + not-when-audio = true; + not-when-fullscreen = true; + environment = { + "PRIMARY_DISPLAY" = "$(xrandr | awk '/ primary/{print $1}')"; + }; + timers = [ + { + delay = 60; + command = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness .1"; + canceller = "xrandr --output \"$PRIMARY_DISPLAY\" --brightness 1"; + } + { + delay = 600; + command = "${pkgs.writeShellScript "my-script" '' + xrandr --output "$PRIMARY_DISPLAY" --brightness 1 + systemctl suspend + ''}"; + } + ]; + + }; +} +