From 6d76ce80a655192364ed564cd4463dd0129fbefd Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 2 Nov 2022 22:13:19 +0100 Subject: [PATCH] First hikari specific configuration Add a way to detect the current system. --- home/packages/lib/default.nix | 3 +++ home/xsession.nix | 31 ++++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 home/packages/lib/default.nix diff --git a/home/packages/lib/default.nix b/home/packages/lib/default.nix new file mode 100644 index 0000000..595470c --- /dev/null +++ b/home/packages/lib/default.nix @@ -0,0 +1,3 @@ +{ + onHikari = _: builtins.readFile(/etc/hostname) == "hikari\n"; +} diff --git a/home/xsession.nix b/home/xsession.nix index e5ef350..30f46fc 100644 --- a/home/xsession.nix +++ b/home/xsession.nix @@ -1,14 +1,29 @@ { config, pkgs }: -{ +let + ownLib = import ./packages/lib; + + initExtraHikari = '' + xrandr --auto --output eDP-1 --brightness 1 --scale 1.25x1.25 + + # Use natural scrolling for trackpad + xinput --set-prop bcm5974 'libinput Natural Scrolling Enabled' 1 + ''; + initExtraHikari2 = '' + xrandr --auto --brightness 1 + + # Enable tapping instead of phsyical click + xinput --set-prop 'DELL07E6:00 06CB:76AF Touchpad' 'libinput Tapping Enabled' 1 + + # Use natural scrolling for trackpad + xinput --set-prop 'DELL07E6:00 06CB:76AF Touchpad' 'libinput Natural Scrolling Enabled' 1 + ''; +in { enable = true; numlock.enable = true; - initExtra = '' - # Auto setup output and set brightness - xrandr --auto --brightness 1 - + initExtra = (if ownLib.onHikari {} then initExtraHikari else initExtraHikari2) + '' # Set backlight of output xbacklight -set 25 @@ -18,12 +33,6 @@ # Disable screen saver xset s off - # Enable tapping instead of phsyical click - xinput --set-prop 'DELL07E6:00 06CB:76AF Touchpad' 'libinput Tapping Enabled' 1 - - # Use natural scrolling for trackpad - xinput --set-prop 'DELL07E6:00 06CB:76AF Touchpad' 'libinput Natural Scrolling Enabled' 1 - # Increase mouse speed xinput --set-prop 13 'libinput Accel Speed' 1 '';