Use autorandr instead of grobi

This commit is contained in:
Cyryl Płotnicki 2021-06-27 13:32:54 +01:00
parent 478941e330
commit b9c7041efa
2 changed files with 37 additions and 0 deletions

36
nixos/i3/autorandr.nix Normal file
View file

@ -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";
};
};
};
};
};
}

View file

@ -1,6 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
imports = [ imports = [
./autorandr.nix
./i3.nix ./i3.nix
./i3-status.nix ./i3-status.nix
./dunst.nix ./dunst.nix