multi monitor setup with autorandr

This commit is contained in:
Ingolf Wagner 2022-10-22 15:01:11 +02:00
parent 90532b9662
commit 2c8aeb0ce6
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
4 changed files with 63 additions and 2 deletions

View file

@ -845,7 +845,8 @@
"private_assets": "private_assets",
"retiolum": "retiolum",
"secrets": "secrets",
"sops-nix": "sops-nix"
"sops-nix": "sops-nix",
"thinkpad-dock": "thinkpad-dock"
}
},
"rotate-text": {
@ -949,6 +950,22 @@
"type": "github"
}
},
"thinkpad-dock": {
"flake": false,
"locked": {
"lastModified": 1617280004,
"narHash": "sha256-nhmYoiHNHk64CjgG7dutVpmrWpdwE3+4G8fGWNANTi8=",
"owner": "oxzi",
"repo": "nixos-thinkpad-dock",
"rev": "c18fe4116b20886c112acec19294e9b96e919526",
"type": "github"
},
"original": {
"owner": "oxzi",
"repo": "nixos-thinkpad-dock",
"type": "github"
}
},
"ts-fold": {
"flake": false,
"locked": {

View file

@ -59,7 +59,10 @@
url = "github:krebs/retiolum";
flake = false;
};
thinkpad-dock = {
url = "github:oxzi/nixos-thinkpad-dock";
flake = false;
};
};
outputs =
@ -80,6 +83,7 @@
, secrets
, sops-nix
, retiolum
, thinkpad-dock
}:
let
system = "x86_64-linux";

View file

@ -26,6 +26,8 @@ in
};
}))
autorandr
(nextcloudSync "InstantUpload")
(nextcloudSync "Pictures")
(nextcloudSync "Unterlagen")

View file

@ -268,6 +268,44 @@ in
"${cfg.config.modifier}+r" = "mode resize";
# multiple monitors
# autorandr --save docked # to save setup
# autorandr --save undocked # to save setup
# autorandr --change # automatically detects the setup
"${cfg.config.modifier}+BackSpace" =
let
xmodmapConfig = pkgs.writeText "xmodmap" ''
!
! Swap Caps_Lock and Control_L
!
! replace capslock keys with Escape Keys
! remove Lock = Caps_Lock
clear Lock
add Lock = Scroll_Lock
keysym Caps_Lock = Escape
! Set Right function Key to Windows-key
keycode 135 = Super_R NoSymbol Super_R NoSymbol Super_R
! Map umlauts to RIGHT ALT + <key>
keycode 108 = Mode_switch
keysym e = e E EuroSign
keysym c = c C cent
keysym a = a A adiaeresis Adiaeresis
keysym o = o O odiaeresis Odiaeresis
keysym u = u U udiaeresis Udiaeresis
keysym s = s S ssharp
'';
script = pkgs.writers.writeBash "autorandr" ''
${pkgs.autorandr}/bin/autorandr --change
${pkgs.xorg.xmodmap}/bin/xmodmap ${xmodmapConfig}
${backgroundCommand}
'';
in
"exec ${toString script}";
# like vimperator
"${cfg.config.modifier}+a" = "exec ${pkgs.i3-easyfocus}/bin/i3-easyfocus";