diff options
| -rw-r--r-- | home/desktops/hyprland/binds.nix | 9 | ||||
| -rw-r--r-- | home/desktops/hyprland/settings.nix | 14 | ||||
| -rw-r--r-- | hosts/shinji/default.nix | 19 | ||||
| -rw-r--r-- | options.nix | 45 |
4 files changed, 74 insertions, 13 deletions
diff --git a/home/desktops/hyprland/binds.nix b/home/desktops/hyprland/binds.nix index edd7d44..df4ecc0 100644 --- a/home/desktops/hyprland/binds.nix +++ b/home/desktops/hyprland/binds.nix @@ -126,14 +126,5 @@ ", XF86MonBrightnessDown, exec, brightnessctl set 5%-" ", XF86MonBrightnessUp, exec, brightnessctl set 5%+" ]; - - bindl = let - monitor = builtins.elemAt config.monitors 0; - cfg = "highres, auto, ${toString monitor.scale}, bitdepth, ${toString monitor.bitdepth}"; - in [ - # Laptops when docked - ", switch:on:Lid, exec, hyprctl keyword monitor \"${monitor.name}, disable\"" - ", switch:off:Lid, exec, hyprctl keyword monitor \"${monitor.name}, ${cfg}\"" - ]; }; } diff --git a/home/desktops/hyprland/settings.nix b/home/desktops/hyprland/settings.nix index a82b6db..2f7d4fb 100644 --- a/home/desktops/hyprland/settings.nix +++ b/home/desktops/hyprland/settings.nix @@ -16,8 +16,18 @@ # Monitors monitorv2 = map (monitor: { - output = monitor.name; - mode = "highres"; + output = + if monitor.desc == "" + then monitor.port + else "desc:${monitor.desc}"; + mode = + if monitor.size.enabled + then "${toString monitor.size.x}x${toString monitor.size.y}" + else "preferred"; + position = + if monitor.position.enabled + then "${toString monitor.position.x}x${toString monitor.position.y}" + else "auto"; scale = toString monitor.scale; bitdepth = toString monitor.bitdepth; }) diff --git a/hosts/shinji/default.nix b/hosts/shinji/default.nix index bb0a495..dae86a8 100644 --- a/hosts/shinji/default.nix +++ b/hosts/shinji/default.nix @@ -16,10 +16,27 @@ hostName = "shinji"; monitors = [ { - name = "eDP-1"; + port = "eDP-1"; scale = 1.25; bitdepth = 10; } + # desktop when docked + { + desc = "ASUSTek COMPUTER INC ASUS VA24E LALMTF215939"; + position = { + enabled = true; + x = 2048; + y = 240; + }; + } + { + desc = "Acer Technologies EB321HQU T5NAA0023E00"; + position = { + enabled = true; + x = 3968; + y = 0; + }; + } ]; # set power btn to suspend diff --git a/options.nix b/options.nix index e423433..9a24dc5 100644 --- a/options.nix +++ b/options.nix @@ -7,9 +7,52 @@ with lib; let # monitor options monitorOpts = self: { options = { - name = mkOption { + port = mkOption { type = types.str; description = "Name of the monitor."; + default = ""; + }; + + desc = mkOption { + type = types.str; + description = "Description of the monitor"; + default = ""; + }; + + position = { + enabled = mkEnableOption { + description = "Enables hardcoded position of the monitor."; + }; + + x = mkOption { + type = types.int; + description = "The X position of the monitor."; + default = 0; + }; + + y = mkOption { + type = types.int; + description = "The Y position of the monitor."; + default = 0; + }; + }; + + size = { + enabled = mkEnableOption { + description = "Enables hardcoded size of the monitor."; + }; + + x = mkOption { + type = types.int; + description = "The X size of the monitor."; + default = 0; + }; + + y = mkOption { + type = types.int; + description = "The Y size of the monitor."; + default = 0; + }; }; scale = mkOption { |