diff --git a/home-manager/features/hypr/config/hyprland.lua b/home-manager/features/hypr/config/hyprland.lua index b817019..92302f1 100644 --- a/home-manager/features/hypr/config/hyprland.lua +++ b/home-manager/features/hypr/config/hyprland.lua @@ -84,35 +84,8 @@ hl.device({ sensitivity = -0.200000, }) --- for i = 1, 10 do --- hl.workspace_rule({ workspace = i, monitor = "DP-1", default_name = "L" .. tostring(i) }) --- hl.workspace_rule({ workspace = i + 10, monitor = "DP-1", default_name = "R" .. tostring(i) }) --- end - -hl.window_rule({ match = "match:class Rofi", stay_focused = true }) --- hl.window_rule({ match = { class = "suppress_event maximize" }, "match:class" = ".*" }) --- hl.window_rule({ match = { class = "fullscreen 1" }, "match:class" = "^steam_app_d+$" }) --- PATTERN: MERGED with line 208 --- MIGRATION_WARNING: Window rule conflict for 'center on': 'match:class ^steam_app_d+$' (line 199) vs 'match:class Rofi' (line 208) --- hl.window_rule({ match = { class = "center on" }, match:class = "^steam_app_d+$", match:class = "Rofi" }) --- PATTERN: MERGED with line 202 --- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Battle.net$' (line 202) --- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Balatro$' (line 204) --- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:class steam_app_1091500' (line 206) --- hl.window_rule({ --- match = { class = "monitor 1" }, --- match:title = "^World of Warcraft$", --- match:title = "^Battle.net$", --- match:title = "^Balatro$", --- match:class = "steam_app_1091500", --- }) --- PATTERN: MERGED with line 207 --- MIGRATION_WARNING: Window rule conflict for 'fullscreen on': 'match:title ^World of Warcraft$' (line 201) vs 'match:class steam_app_1091500' (line 207) --- hl.window_rule({ match = { class = "fullscreen on" }, match:title = "^World of Warcraft$", match:class = "steam_app_1091500" }) --- hl.window_rule({ match = { class = "float on" }, match:title = "^Battle.net$" }) --- hl.window_rule({ match = { class = "tile on" }, match:title = "^Balatro$" }) - -- Additional configs require("config.autostart") require("config.binds") require("config.animation") +require("config.windows") diff --git a/home-manager/features/hypr/config/windows.lua b/home-manager/features/hypr/config/windows.lua new file mode 100644 index 0000000..e3be2bf --- /dev/null +++ b/home-manager/features/hypr/config/windows.lua @@ -0,0 +1,20 @@ +hl.window_rule({ + match = { + class = "Rofi", + }, + stay_focused = true, +}) + +-- Set border color to red if window is fullscreen +hl.window_rule({ + match = { fullscreen = true }, + border_color = "rgb(FF0000) rgb(880808)", +}) + +-- Suppress maximize events +hl.window_rule({ + match = { + class = ".*", + }, + suppress_event = "maximize", +}) diff --git a/home-manager/features/hypr/hyprland.nix b/home-manager/features/hypr/hyprland.nix index df107df..28efbe0 100644 --- a/home-manager/features/hypr/hyprland.nix +++ b/home-manager/features/hypr/hyprland.nix @@ -47,7 +47,6 @@ ]; extraConfig = '' - require("monitors") require("config.hyprland") ''; diff --git a/home-manager/options/monitors.nix b/home-manager/options/monitors.nix index 4de9aca..49e9f9f 100644 --- a/home-manager/options/monitors.nix +++ b/home-manager/options/monitors.nix @@ -35,66 +35,66 @@ }; }; - config = { - xdg.configFile."hypr/monitors.lua" = lib.mkIf config.wayland.windowManager.hyprland.enable { - text = - let - workspaceSettings = ( - lib.imap0 ( - idx: - { name, value }: - let - offset = idx * 10; - in - lib.concatMapStrings ( - i: - let - ws = offset + i; - in - '' - hl.workspace_rule({ workspace = ${toString ws}, monitor = "${name}", default_name = "${toString i}" }) - '' - ) (lib.range 1 10) - ) (lib.attrsToList config.hardware.monitors) - ); - transformMap = { - "none" = { - normal = 0; - flipped = 4; - }; - "90" = { - normal = 1; - flipped = 5; - }; - "180" = { - normal = 2; - flipped = 6; - }; - "270" = { - normal = 3; - flipped = 7; - }; - }; - - monitorTransform = - m: - let - t = transformMap.${m.rotation}; - in - if m.flipped then t.flipped else t.normal; - - monitorString = name: m: '' - hl.monitor({ - output = "${name}", - mode = "${m.mode}", - position = "${m.position}", - transform = ${toString (monitorTransform m)}, - }) - ''; - - monitorSettings = lib.mapAttrsToList monitorString config.hardware.monitors; - in - lib.concatStringsSep "\n" (workspaceSettings ++ monitorSettings); - }; - }; + # config = { + # xdg.configFile."hypr/monitors.lua" = lib.mkIf config.wayland.windowManager.hyprland.enable { + # text = + # let + # workspaceSettings = ( + # lib.imap0 ( + # idx: + # { name, value }: + # let + # offset = idx * 10; + # in + # lib.concatMapStrings ( + # i: + # let + # ws = offset + i; + # in + # '' + # hl.workspace_rule({ workspace = ${toString ws}, monitor = "${name}", default_name = "${toString i}" }) + # '' + # ) (lib.range 1 10) + # ) (lib.attrsToList config.hardware.monitors) + # ); + # transformMap = { + # "none" = { + # normal = 0; + # flipped = 4; + # }; + # "90" = { + # normal = 1; + # flipped = 5; + # }; + # "180" = { + # normal = 2; + # flipped = 6; + # }; + # "270" = { + # normal = 3; + # flipped = 7; + # }; + # }; + # + # monitorTransform = + # m: + # let + # t = transformMap.${m.rotation}; + # in + # if m.flipped then t.flipped else t.normal; + # + # monitorString = name: m: '' + # hl.monitor({ + # output = "${name}", + # mode = "${m.mode}", + # position = "${m.position}", + # transform = ${toString (monitorTransform m)}, + # }) + # ''; + # + # monitorSettings = lib.mapAttrsToList monitorString config.hardware.monitors; + # in + # lib.concatStringsSep "\n" (workspaceSettings ++ monitorSettings); + # }; + # }; } diff --git a/system/hosts/altair/drew.nix b/system/hosts/altair/drew.nix index 9877e40..bdca0ff 100644 --- a/system/hosts/altair/drew.nix +++ b/system/hosts/altair/drew.nix @@ -56,6 +56,16 @@ "secondary-statusbar" ]; + xdg.configFile = { + "hypr/altair.lua" = { + source = ./hyprland.lua; + }; + }; + + wayland.windowManager.hyprland.extraConfig = '' + require("altair") + ''; + # TODO: Still merging these into the LUA config # wayland.windowManager.hyprland.settings = { # exec_once = [ diff --git a/system/hosts/altair/hyprland.lua b/system/hosts/altair/hyprland.lua new file mode 100644 index 0000000..96cbde4 --- /dev/null +++ b/system/hosts/altair/hyprland.lua @@ -0,0 +1,52 @@ +-- These configs are specifically for Altair +----------------------------------------------------------- + +for i = 1, 10 do + hl.workspace_rule({ workspace = i, monitor = "DP-1", default_name = tostring(i) }) + hl.workspace_rule({ workspace = i + 10, monitor = "DP-2", default_name = tostring(i) }) +end + +hl.monitor({ + output = "DP-1", + mode = "2560x1440", + position = "-1440x-510", + transform = 1, +}) + +hl.monitor({ + output = "DP-2", + mode = "3440x1440@164", + position = "0x0", + transform = 0, +}) + +hl.window_rule({ + match = { + class = "^steam_app_\\d+$", + }, + fullscreen = true, + monitor = "DP-2", + center = true, +}) + +-- hl.window_rule({ match = { class = "suppress_event maximize" }, "match:class" = ".*" }) +-- hl.window_rule({ match = { class = "fullscreen 1" }, "match:class" = "^steam_app_d+$" }) +-- PATTERN: MERGED with line 208 +-- MIGRATION_WARNING: Window rule conflict for 'center on': 'match:class ^steam_app_d+$' (line 199) vs 'match:class Rofi' (line 208) +-- hl.window_rule({ match = { class = "center on" }, match:class = "^steam_app_d+$", match:class = "Rofi" }) +-- PATTERN: MERGED with line 202 +-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Battle.net$' (line 202) +-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:title ^Balatro$' (line 204) +-- MIGRATION_WARNING: Window rule conflict for 'monitor 1': 'match:title ^World of Warcraft$' (line 200) vs 'match:class steam_app_1091500' (line 206) +-- hl.window_rule({ +-- match = { class = "monitor 1" }, +-- match:title = "^World of Warcraft$", +-- match:title = "^Battle.net$", +-- match:title = "^Balatro$", +-- match:class = "steam_app_1091500", +-- }) +-- PATTERN: MERGED with line 207 +-- MIGRATION_WARNING: Window rule conflict for 'fullscreen on': 'match:title ^World of Warcraft$' (line 201) vs 'match:class steam_app_1091500' (line 207) +-- hl.window_rule({ match = { class = "fullscreen on" }, match:title = "^World of Warcraft$", match:class = "steam_app_1091500" }) +-- hl.window_rule({ match = { class = "float on" }, match:title = "^Battle.net$" }) +-- hl.window_rule({ match = { class = "tile on" }, match:title = "^Balatro$" })