blob: 175fb7baa7a06fe94174ea61d28006f3b53947c1 [file] [log] [blame]
Skyler Greya16cb702023-03-11 19:20:06 +00001{ lib, pkgs, ... }: {
Skyler Grey81dd90e2023-03-26 10:45:11 +00002 config.boot.kernelParams = [
Skyler Greye6e151f2023-05-01 08:07:28 +00003 "video=eDP-1:2256x1504@60"
4 "video=HDMI-1-1:1920x1080@144"
5 "video=DP-1-3:3840x2160@76"
Skyler Grey81dd90e2023-03-26 10:45:11 +00006 ];
Skyler Greya16cb702023-03-11 19:20:06 +00007 home = {
8 services.grobi = {
9 enable = true;
10 rules = (map
11 (output: {
12 name = "Docked (${output})";
13 outputs_connected = [ output "eDP-1" ];
Skyler Grey494bba22023-04-17 08:14:02 +000014 configure_command = "xrandr --output eDP-1 --primary --mode 2256x1504 --pos 0x1454 --rotate normal --output ${output} --mode 3840x2160 --pos 2256x0 --rotate normal";
Skyler Greya16cb702023-03-11 19:20:06 +000015 atomic = true;
16 primary = "eDP-1";
17 })
Skyler Greye6e151f2023-05-01 08:07:28 +000018 ([ "HDMI-A-1" "HDMI-A-1-0" ] ++
Skyler Greya16cb702023-03-11 19:20:06 +000019 (map (num: "DP-" + toString num) (lib.range 1 8))
20 )) ++ [
21 {
Skyler Greye6e151f2023-05-01 08:07:28 +000022 name = "Docked (HDMI-1-1 + DP-1-3)";
23 outputs_connected = [ "HDMI-1-1" "eDP-1" "DP-1-3" ];
24 configure_command = "xrandr --output HDMI-1-1 --mode 1920x1080 --pos 0x0 --rotate normal --output eDP-1 --primary --mode 2256x1504 --pos 0x1454 --rotate normal --output DP-1-3 --mode 3840x2160 --pos 2256x0 --rotate normal";
25 atomic = true;
26 primary = "eDP-1";
27 }
28 {
Skyler Greya16cb702023-03-11 19:20:06 +000029 name = "Free";
30 outputs_connected = [ "eDP-1" ];
Skyler Greye6e151f2023-05-01 08:07:28 +000031 outputs_disconnected = [ "HDMI-A-1" "HDMI-1-1" "DP-1-3" ];
Skyler Greya16cb702023-03-11 19:20:06 +000032 configure_single = "eDP-1";
33 }
34 {
35 name = "Fallback";
36 configure_single = "eDP-1";
37 }
38 ];
39 };
40
Skyler Grey047664c2023-04-15 14:34:48 +000041 home.file.".config/prelaunch/displays.sh".text = ''
Skyler Greya16cb702023-03-11 19:20:06 +000042 ${pkgs.grobi}/bin/grobi watch -v
43 '';
Skyler Grey047664c2023-04-15 14:34:48 +000044 home.file.".config/prelaunch/displays.sh".executable = true;
Skyler Greya16cb702023-03-11 19:20:06 +000045 systemd.user.services.grobi.Install.WantedBy = lib.mkForce [ ];
Skyler Grey73c49312023-01-26 00:45:17 +000046 };
47}