monitors.lua picks the main external (Studio Display, else the Samsung S34CG50 ultrawide, matched on EDID) and reloads the config when it changes. Workspaces 1-4, the Wacom mapping, and its active-area aspect follow it. eDP-1 uses auto-right so it sits beside whichever external is connected. Also unbinds SUPER+RETURN / SUPER+SHIFT+RETURN (terminal and browser live on SUPER+CTRL+ALT+J/K) and pins the Fastmail/Beeper scratch workspaces' comments to eDP-1.
62 lines
2.6 KiB
Lua
62 lines
2.6 KiB
Lua
-- See https://wiki.hypr.land/Configuring/Basics/Monitors/
|
|
-- List current monitors and supported resolutions with: hyprctl monitors all
|
|
|
|
local omarchy_gdk_scale = 3
|
|
local omarchy_monitor_scale = 3.2
|
|
|
|
hl.env("GDK_SCALE", tostring(omarchy_gdk_scale))
|
|
hl.monitor({ output = "", mode = "preferred", position = "auto", scale = omarchy_monitor_scale })
|
|
|
|
-- The main external display sits on the left, the laptop panel (eDP-1) to its
|
|
-- right; auto-right puts eDP-1 at the external's logical width (2560 for the
|
|
-- Studio Display at scale 2, 3440 for the ultrawide at scale 1), or at 0x0
|
|
-- when undocked. Apple Studio Display over Thunderbolt, Samsung ultrawide on
|
|
-- a USB-C to HDMI cable from the iGPU (DP alt mode, so it shows up as DP-n;
|
|
-- matched on EDID, so the connector name doesn't matter).
|
|
hl.monitor({ output = "eDP-1", mode = "2560x1600@180", position = "auto-right", scale = 2 })
|
|
hl.monitor({ output = "DP-4", mode = "5120x2880@60", position = "0x0", scale = 2 })
|
|
hl.monitor({ output = "desc:Samsung Electric Company S34CG50 HNTY501103", mode = "3440x1440@100", position = "0x0", scale = 1 })
|
|
|
|
-- Configure a specific monitor.
|
|
-- hl.monitor({ output = "DP-2", mode = "2560x1440@144", position = "0x0", scale = 1 })
|
|
|
|
-- Portrait/rotated secondary monitor (transform: 1 = 90°, 3 = 270°).
|
|
-- hl.monitor({ output = "DP-2", mode = "preferred", position = "auto", scale = 1, transform = 1 })
|
|
|
|
-- Main external display: the first of these that is connected. Workspaces
|
|
-- 1-4 (hypr/hyprland.lua) and the Wacom tablet (hypr/input.lua) follow it.
|
|
-- Entries are Hyprland monitor selectors: a connector name or
|
|
-- desc:<EDID description>.
|
|
local M = {
|
|
externals = {
|
|
"desc:Apple Computer Inc StudioDisplay 0x984262A7",
|
|
"desc:Samsung Electric Company S34CG50 HNTY501103",
|
|
},
|
|
}
|
|
|
|
-- The connected main external as (selector, monitor), or nil.
|
|
function M.external()
|
|
for _, selector in ipairs(M.externals) do
|
|
for _, monitor in ipairs(hl.get_monitors()) do
|
|
if selector == monitor.name or selector == "desc:" .. monitor.description then
|
|
return selector, monitor
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- Workspace rules only create persistent workspaces at config load, so a
|
|
-- change of main external reloads the config rather than patching rules in
|
|
-- place; the reload re-runs every user of M.external() against the new
|
|
-- monitor. Omarchy's reload guard skips it mid package update.
|
|
local loaded = M.external()
|
|
local function reload_on_change()
|
|
if M.external() ~= loaded then
|
|
hl.exec_cmd("omarchy-hyprland-reload-guard paused || hyprctl reload")
|
|
end
|
|
end
|
|
hl.on("monitor.added", reload_on_change)
|
|
hl.on("monitor.removed", reload_on_change)
|
|
|
|
return M
|