~cyplo/dotfiles

536799b9aed6c0e6db5c435e3e2b90d5b1edf5a8 — Cyryl Płotnicki 2 months ago c1aa21e
Use autorandr instead of grobi
2 files changed, 37 insertions(+), 0 deletions(-)

A nixos/i3/autorandr.nix
M nixos/i3/home.nix
A nixos/i3/autorandr.nix => nixos/i3/autorandr.nix +36 -0
@@ 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";
          };
        };
      };
    };
  };

}

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