From b9c7041efa7ee4745b6adbf441458b3bf630842e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 27 Jun 2021 13:32:54 +0100 Subject: [PATCH] Use autorandr instead of grobi --- nixos/i3/autorandr.nix | 36 ++++++++++++++++++++++++++++++++++++ nixos/i3/home.nix | 1 + 2 files changed, 37 insertions(+) create mode 100644 nixos/i3/autorandr.nix diff --git a/nixos/i3/autorandr.nix b/nixos/i3/autorandr.nix new file mode 100644 index 00000000..4eff1449 --- /dev/null +++ b/nixos/i3/autorandr.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: +{ + + programs.autorandr = { + enable = true; + hooks.postswitch = { + "change-dpi" = '' + case "$AUTORANDR_CURRENT_PROFILE" in + foureighty) + DPI=144 + ;; + *) + echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE" + exit 1 + esac + echo "changing DPI to $DPI" + ${pkgs.xorg.xrandr}/bin/xrandr --dpi $DPI + ''; + "restart-i3" = "sudo ${pkgs.i3}/bin/i3-msg restart"; + }; + profiles = { + "foureighty" = { + fingerprint = { + eDP-1 = "00ffffffffffff0006af362300000000001b0104a51f117802f4f5a4544d9c270f505400000001010101010101010101010101010101e65f00a0a0a040503020350035ae100000180000000f0000000000000000000000000020000000fe0041554f0a202020202020202020000000fe004231343051414e30322e33200a00b2"; + }; + config = { + eDP-1 = { + enable = true; + mode = "2560x1440"; + }; + }; + }; + }; + }; + +} diff --git a/nixos/i3/home.nix b/nixos/i3/home.nix index b32b4794..34963dc8 100644 --- a/nixos/i3/home.nix +++ b/nixos/i3/home.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { imports = [ + ./autorandr.nix ./i3.nix ./i3-status.nix ./dunst.nix