2023-08-31 11:24:39 +00:00
|
|
|
# A monitor list and common sway set up
|
|
|
|
{ config, pkgs, lib, ... }: with lib;
|
|
|
|
let
|
|
|
|
monitors = {
|
|
|
|
# Internal
|
2024-01-19 10:36:36 +00:00
|
|
|
"framework" = {
|
|
|
|
name = "BOE 0x0BCA Unknown";
|
2025-01-16 03:23:20 +00:00
|
|
|
meta.mode = { width = 2256; height = 1504; refresh = 60.0; };
|
2024-01-19 10:36:36 +00:00
|
|
|
scale = 1.25;
|
|
|
|
};
|
2023-08-31 11:24:39 +00:00
|
|
|
# External
|
|
|
|
## Work @ EPFL
|
|
|
|
"work" = {
|
|
|
|
name = "LG Electronics LG ULTRAFINE 301MAXSGHD10";
|
2025-01-16 03:23:20 +00:00
|
|
|
meta.mode = { width = 3840; height = 2160; refresh = 60.0; };
|
2023-09-01 08:38:24 +00:00
|
|
|
scale = 1.25;
|
2023-08-31 11:24:39 +00:00
|
|
|
};
|
|
|
|
"home_4k" = {
|
|
|
|
name = "AOC U28G2G6B PPYP2JA000013";
|
2023-09-01 08:38:24 +00:00
|
|
|
scale = 1.5;
|
2023-08-31 11:24:39 +00:00
|
|
|
adaptive_sync = "on";
|
2025-01-16 03:23:20 +00:00
|
|
|
meta = {
|
|
|
|
connection = "DP-2";
|
|
|
|
mode = { width = 3840; height = 2160; refresh = 60.0; };
|
|
|
|
fixedPosition = { x = 0; y = 0; };
|
|
|
|
niriName = "PNP(AOC) U28G2G6B PPYP2JA000013";
|
|
|
|
};
|
2023-08-31 11:24:39 +00:00
|
|
|
};
|
2023-09-30 22:05:08 +00:00
|
|
|
"home_1440" = {
|
|
|
|
name = "AOC Q27G2G3R3B VXJP6HA000442";
|
2023-08-31 11:24:39 +00:00
|
|
|
adaptive_sync = "on";
|
2025-01-16 03:23:20 +00:00
|
|
|
meta = {
|
|
|
|
connection = "DP-3";
|
|
|
|
mode = { width = 2560; height = 1440; refresh = 165.0; };
|
|
|
|
fixedPosition = { x = 2560; y = 0; };
|
|
|
|
niriName = "PNP(AOC) Q27G2G3R3B VXJP6HA000442";
|
|
|
|
};
|
2023-08-31 11:24:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
"viewsonic_1080" = {
|
|
|
|
name = "ViewSonic Corporation XG2402 SERIES V4K182501054";
|
2025-01-16 03:23:20 +00:00
|
|
|
meta.mode = { width = 1920; height = 1080; refresh = 144.0; };
|
2023-08-31 11:24:39 +00:00
|
|
|
adaptive_sync = "on";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
eachMonitor = _name: monitor: {
|
|
|
|
name = monitor.name;
|
2025-01-16 03:23:20 +00:00
|
|
|
value = builtins.removeAttrs monitor [ "scale" "name" "meta" ] // (lib.optionalAttrs (monitor ? scale) {
|
2023-09-01 08:38:24 +00:00
|
|
|
scale = toString monitor.scale;
|
2025-01-16 03:23:20 +00:00
|
|
|
}) // {
|
|
|
|
mode = with monitor.meta.mode; "${toString width}x${toString height}@${toString refresh}Hz";
|
|
|
|
} // (lib.optionalAttrs (monitor.meta ? fixedPosition) {
|
|
|
|
position = with monitor.meta.fixedPosition; "${toString x} ${toString y}";
|
|
|
|
});
|
2023-08-31 11:24:39 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.common.monitors = mkOption {
|
|
|
|
type = types.attrsOf types.attrs;
|
|
|
|
description = "A list of monitors";
|
|
|
|
};
|
|
|
|
config.common.monitors = monitors;
|
|
|
|
config.home.packages = mkIf config.wayland.windowManager.sway.enable (with pkgs; [ kanshi ]);
|
|
|
|
config.wayland.windowManager.sway.config.output = mkIf config.wayland.windowManager.sway.enable (
|
2023-09-01 08:38:24 +00:00
|
|
|
mapAttrs' eachMonitor config.common.monitors
|
2023-08-31 11:24:39 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|