dotfiles/nixos/i3/autorandr.nix

62 lines
2.4 KiB
Nix
Raw Normal View History

2022-03-10 12:25:23 +00:00
{ config, pkgs, ... }: {
2021-11-04 08:39:27 +00:00
services.autorandr.enable = true;
2022-05-02 09:59:47 +01:00
home-manager.users.cyryl = _: {
2021-11-04 08:39:27 +00:00
programs.autorandr = {
enable = true;
hooks.postswitch = {
"change-dpi" = ''
2021-06-27 13:32:54 +01:00
case "$AUTORANDR_CURRENT_PROFILE" in
2021-11-04 08:39:27 +00:00
foureighty-docked)
2021-11-12 22:36:04 +00:00
DPI=144
;;
2021-11-04 08:39:27 +00:00
foureighty)
2021-11-12 22:36:04 +00:00
DPI=144
;;
2021-11-04 08:39:27 +00:00
*)
2021-11-12 22:36:04 +00:00
echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE"
exit 1
2021-06-27 13:32:54 +01:00
esac
echo "changing DPI to $DPI"
${pkgs.xorg.xrandr}/bin/xrandr --dpi $DPI
2021-11-04 08:39:27 +00:00
'';
"restart-i3" = "sudo ${pkgs.i3}/bin/i3-msg restart";
2021-06-27 13:32:54 +01:00
};
2021-11-04 08:39:27 +00:00
profiles = {
2021-11-07 09:34:26 +00:00
"foureighty-docked" = {
2022-12-09 11:48:01 +00:00
2021-11-04 08:39:27 +00:00
fingerprint = {
2022-12-05 15:11:11 +00:00
eDP1 =
2022-07-16 08:04:28 +01:00
"00ffffffffffff0030e4ee0500000000001c0104a51f1178e272e5a15148a2280e505400000001010101010101010101010101010101695e00a0a0a029503020a50035ae1000001a000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503134305148322d535044310060";
2022-12-09 11:48:01 +00:00
DP1 =
2022-03-10 12:25:23 +00:00
"00ffffffffffff0026cd4e66f3030000271d0104b53c22783ef6d5a7544b9e250d5054bfef80714f8140818081c09500b300d1c001014dd000a0f0703e8030203500544f2100001a000000ff0031313636333933393031303131000000fd00184c1fa03c000a202020202020000000fc00504c3237393255480a202020200176020320f15390050403020716011f121314201511065d5e5f2309070783010000023a801871382d40582c4500544f2100001f011d8018711c1620582c2500544f2100009fa76600a0f0701f8030205500544f2100001ff45100a0f070198030203500544f2100001f565e00a0a0a0295030203500544f2100001b000000000059";
2021-11-04 08:39:27 +00:00
};
config = {
2022-12-05 15:11:11 +00:00
eDP1 = { enable = false; };
2022-12-09 11:48:01 +00:00
DP1 = {
2021-11-04 08:39:27 +00:00
enable = true;
2021-11-07 09:34:26 +00:00
primary = true;
position = "0x0";
mode = "3840x2160";
2021-11-04 08:39:27 +00:00
};
};
2021-10-30 12:19:33 +01:00
};
2021-11-07 09:34:26 +00:00
"foureighty" = {
2021-11-04 08:39:27 +00:00
fingerprint = {
2022-12-05 15:11:11 +00:00
eDP1 =
2022-07-16 08:04:28 +01:00
"00ffffffffffff0030e4ee0500000000001c0104a51f1178e272e5a15148a2280e505400000001010101010101010101010101010101695e00a0a0a029503020a50035ae1000001a000000000000000000000000000000000000000000fe004c4720446973706c61790a2020000000fe004c503134305148322d535044310060";
2021-10-30 12:19:33 +01:00
};
2021-11-04 08:39:27 +00:00
config = {
2022-12-05 15:11:11 +00:00
eDP1 = {
2021-11-04 08:39:27 +00:00
enable = true;
primary = true;
position = "0x0";
2021-11-07 09:34:26 +00:00
mode = "2560x1440";
2021-11-04 08:39:27 +00:00
};
2021-10-30 12:19:33 +01:00
};
};
};
2021-06-27 13:32:54 +01:00
};
};
}