Setup monitors

This commit is contained in:
muon 2024-06-14 15:54:47 +00:00
parent b5e7be0747
commit 2aa3d272c9
4 changed files with 63 additions and 35 deletions

View file

@ -42,25 +42,43 @@ in {
services.xserver.libinput.mouse.accelProfile = "flat";
## Monitors
mods.monitor.main.resolution = res;
services.xserver.xrandrHeads = [
{
output = "DP-2";
mods.monitors = {
primary = {
name = "DP-2";
config = {
enable = true;
mode = res;
position = "0x480";
primary = true;
monitorConfig = ''
Option "PreferredMode" "${res}"
Option "Position" "0x480"
'';
}
{
output = "HDMI-1";
monitorConfig = ''
Option "PreferredMode" "1920x1080"
Option "Position" "2560x-480"
Option "Rotate" "right"
'';
}
];
rate = "144.00";
};
};
secondary = {
name = "HDMI-1";
config = {
enable = true;
mode = "1920x1080";
position = "2560x0";
rate = "60.00";
rotate = "right";
};
};
};
services.autorandr = {
enable = true;
profiles."${config.mods.user.name}" = {
fingerprint = {
"${config.mods.monitors.primary.name}" = "00ffffffffffff000469a827528b01002f1a0104a53c22783ba595a65650a0260d5054bfef00714f95008180d1c00101010101010101e8e40050a0a067500820980455502100001e565e00a0a0a029503020350055502100001e000000fd002890dede3c010a202020202020000000fc0041535553204d473237380a202001cd02031e714b1213041f900e0f1d1e0514230917078301000065030c001000e8e40050a0a067500820980455502100001e909b0050a0a046500820880c55502100001e662156aa51001e30468f330055502100001e565e00a0a0a029503020350055502100001e87bc0050a0a055500820780055502100001e0000000000000056";
"${config.mods.monitors.secondary.name}" = "00ffffffffffff00410c00000101010107160103804024780af9aba2554a9a250f474a21080081800101010101010101010101010101023a801871382d40582c450080682100001e1b2150a051001e3048883500806821000018000000fc005048494c495053204654560a20000000fd00384c1e5311000a20202020202001ca020326714e9f10202122140513041102150601260907031507508301000067030c001000b82d023a80d072382d40102c458080682100001e011d803e73382d407e2c458080682100001e011d80d0721c1620102c258080682100009e011d00bc52d01e20b828554080682100001e00000000000000000000000000000000002c";
};
config = {
"${config.mods.monitors.primary.name}" =
config.mods.monitors.primary.config;
"${config.mods.monitors.secondary.name}" =
config.mods.monitors.secondary.config;
};
};
};
# Backup environment
services.xserver.windowManager.qtile.enable = true;

View file

@ -19,15 +19,13 @@ let cfg = osConfig.mods; in {
# Host specific
## Monitors
xsession.windowManager.i3.config.workspaceOutputAssign = [
{
xsession.windowManager.i3.config.workspaceOutputAssign = [{
workspace = "1";
output = "DP-2";
output = "${osConfig.mods.monitors.primary.name}";
} {
workspace = "2";
output = "HDMI-1";
}
];
output = "${osConfig.mods.monitors.secondary.name}";
}];
wayland.windowManager.hyprland.settings = {
monitor = [

View file

@ -9,7 +9,7 @@
enable = true;
efiSupport = true;
device = "nodev";
gfxmodeEfi = config.mods.monitor.main.resolution;
gfxmodeEfi = config.mods.monitors.primary.config.mode;
};
};
}

View file

@ -1,11 +1,23 @@
{ pkgs, lib, config, ... }: {
{ pkgs, lib, config, ... }: let
monitorModule = lib.types.submodule {
options = {
name = lib.mkOption {
type = lib.types.string;
description = "monitor name";
example = "HDMI-1";
};
config = lib.mkOption {
type = lib.types.attrs;
description = "autorandr profile config";
};
};
};
in {
options.mods = {
xorg.enable = lib.mkEnableOption "enables xorg";
monitor.main.resolution = lib.mkOption {
description = "main monitor resolution";
type = lib.types.string;
default = "1920x1080";
example = "2560x1440";
monitors = lib.mkOption {
type = lib.types.attrsOf monitorModule;
default = { };
};
};