[Sync] Lua Hyprland chain, licence cleanup

This commit is contained in:
Coja committed 2026-11-09 18:25:35 +01:00
1 parent 93b4f695ce
commit 47166d877f
183 files changed
+5618 -5839

No files matched your search

+1
View File
@@ -0,0 +1 @@
../../../gui/.config/hypr/.luarc.json
-15
View File
@@ -1,15 +0,0 @@
# wm host extras (sourced last by ~/.config/hypr/hyprland.conf)
source = ~/.config/hypr/nvidia.conf
# THEME OVERRIDES — personal deltas on top of wm's themes/theme.conf (tracked in this
# overlay while wm's HyDE is old enough to hard-source it; that file is generated, so
# anything edited in there is lost on the next theme switch — keep the deltas here,
# where they are sourced after every theme file and therefore win).
general {
gaps_in = 2
gaps_out = 4
}
decoration {
rounding = 8
}
+96
View File
@@ -0,0 +1,96 @@
-- wm host layer — loaded by gui/.config/hypr/hyprland.lua via check_require("host").
-- Ports wm/.config/hypr/{monitors,host,nvidia}.conf to the Lua chain.
-- ── Monitors ─────────────────────────────────────────────────────────────────
-- DP-2 (the LG 4K) is the only fixed screen. Anything else works when plugged in,
-- without editing this file: the 1080 Ti has four other connectors (DP-1, DVI-D-1,
-- HDMI-A-1, HDMI-A-2), so extras are read from hl.get_monitors() in connection
-- order instead of being named here. The first extra sits right of DP-2 and owns
-- workspaces 11-20, a second sits left and owns 21-30.
local mainScreen = "DP-2"
local mainW, mainH, mainScale = 3840, 2160, 1.25
hl.monitor({ output = mainScreen, mode = mainW .. "x" .. mainH .. "@60", position = "0x0", scale = mainScale })
-- Catch-all for a screen with no rule of its own yet (the empty output name is
-- the default rule) — covers the moment between plug-in and the re-pin reload.
-- Not scale "auto": that picked 2 for a 1080p screen.
hl.monitor({ output = "", mode = "preferred", position = "auto-right", scale = 1 })
local function extra_screens()
local ok, monitors = pcall(hl.get_monitors)
local found = {}
for _, m in ipairs(ok and monitors or {}) do
if m.name ~= mainScreen and not m.is_mirror then
found[#found + 1] = m
end
end
table.sort(found, function(a, b)
return a.id < b.id
end)
return found
end
-- A 4K extra gets DP-2's scale, anything smaller 1; placed beside DP-2 and
-- vertically centred on it (what the old fixed 3072x350 rule approximated).
local function place(m, side)
local scale = m.width >= 3840 and mainScale or 1
local w, h = math.floor(m.width / scale), math.floor(m.height / scale)
local x = side == "right" and math.floor(mainW / mainScale) or -w
local y = math.max(0, math.floor((mainH / mainScale - h) / 2))
hl.monitor({ output = m.name, mode = "preferred", position = x .. "x" .. y, scale = scale })
end
local extras = extra_screens()
local rightScreen, leftScreen
if extras[1] then
rightScreen = extras[1].name
place(extras[1], "right")
end
if extras[2] then
leftScreen = extras[2].name
place(extras[2], "left")
end
-- ── Workspace pins (1-10 main, 11-20 right, 21-30 left) ──────────────────────
-- These are what make the r~N binds land on the focused monitor's set.
for i = 1, 10 do
hl.workspace_rule({ workspace = tostring(i), monitor = mainScreen, default = (i == 1) })
if rightScreen then
hl.workspace_rule({ workspace = tostring(i + 10), monitor = rightScreen, default = (i == 1) })
end
if leftScreen then
hl.workspace_rule({ workspace = tostring(i + 20), monitor = leftScreen, default = (i == 1) })
end
end
-- Pins are only computed at load, so a hotplug that changes the set of extras
-- reloads once to re-pin. DP-2's own link drop/return (it sleeps as a hotplug)
-- leaves the extras unchanged and does not reload.
local function names(list)
local out = {}
for i, m in ipairs(list) do
out[i] = m.name
end
return table.concat(out, ",")
end
local pinned = names(extras)
local function repin_if_changed()
if names(extra_screens()) ~= pinned then
hl.exec_cmd("hyprctl reload")
end
end
hl.on("monitor.added", repin_if_changed)
hl.on("monitor.removed", repin_if_changed)
-- ── Theme overrides (was host.conf) ──────────────────────────────────────────
-- Loads after dynamic.lua's theme state, so these still win over the theme.
hl.config({
general = { gaps_in = 2, gaps_out = 4 },
decoration = { rounding = 8 },
})
-- ── NVIDIA extras (was nvidia.conf) ──────────────────────────────────────────
-- LIBVA_DRIVER_NAME / __GLX_VENDOR_LIBRARY_NAME / GBM_BACKEND are already set
-- by HyDE's env.lua when the driver probe passes; only the two extras remain.
hl.env("NVD_BACKEND", "direct") -- va-api via libva-nvidia-driver
hl.config({ cursor = { no_hardware_cursors = true } }) -- avoid cursor hitches
-53
View File
@@ -1,53 +0,0 @@
# █▀▄▀█ █▀█ █▄░█ █ ▀█▀ █▀█ █▀█ █▀
# █░▀░█ █▄█ █░▀█ █ ░█░ █▄█ █▀▄ ▄█
# Set your monitor configuration here
# See https://wiki.hyprland.org/Configuring/Monitors/
# For a sample file, please refer to https://github.com/prasanthrangan/hyprdots/blob/main/Configs/.config/hypr/monitors.t2
$mainScreen = DP-2
$leftScreen = eDP-1 # FIXME: eDP is a laptop panel (leftover from lw) — set the real connector when wm's third monitor exists; harmless meanwhile
$rightScreen = HDMI-A-1
monitor = $mainScreen, 3840x2160@60.00, 0x0, 1.25 # main screen
monitor = $rightScreen, 1920x1080@60, 3072x350, 1 # right
# monitor = $mainScreen, 1920x1080@59.99, 0x0, 2 # main screen
# monitor = $leftScreen, 1920x1080@60, -1920x0, 1 # left
#Main Monitor
workspace = 1, monitor:$mainScreen, default:true
workspace = 2, monitor:$mainScreen
workspace = 3, monitor:$mainScreen
workspace = 4, monitor:$mainScreen
workspace = 5, monitor:$mainScreen
workspace = 6, monitor:$mainScreen
workspace = 7, monitor:$mainScreen
workspace = 8, monitor:$mainScreen
workspace = 9, monitor:$mainScreen
workspace = 10,monitor:$mainScreen
# Second Monitor
workspace = 11, monitor:$rightScreen, default:true
workspace = 12, monitor:$rightScreen
workspace = 13, monitor:$rightScreen
workspace = 14, monitor:$rightScreen
workspace = 15, monitor:$rightScreen
workspace = 16, monitor:$rightScreen
workspace = 17, monitor:$rightScreen
workspace = 18, monitor:$rightScreen
workspace = 19, monitor:$rightScreen
workspace = 20, monitor:$rightScreen
# Third Monitor
workspace = 21, monitor:$leftScreen, default:true
workspace = 22, monitor:$leftScreen
workspace = 23, monitor:$leftScreen
workspace = 24, monitor:$leftScreen
workspace = 25, monitor:$leftScreen
workspace = 26, monitor:$leftScreen
workspace = 27, monitor:$leftScreen
workspace = 28, monitor:$leftScreen
workspace = 29, monitor:$leftScreen
workspace = 30, monitor:$leftScreen
-30
View File
@@ -1,30 +0,0 @@
# █▄░█ █░█ █ █▀▄ █ ▄▀█
# █░▀█ ▀▄▀ █ █▄▀ █ █▀█
# Hyprland Nvidia Configuration
# See https://wiki.hyprland.org/Nvidia/
env = LIBVA_DRIVER_NAME,nvidia
env = __GLX_VENDOR_LIBRARY_NAME,nvidia # Disable this if you have issues with screensharing
# If you want to try hardware cursors,
# you can enable them by setting `cursor:no_hardware_cursors = false` ,
# but it will require also enabling `cursor:allow_dumb_copy`
# which may cause small to major hitches whenever the cursor shape changes.
# If this is a problem on your system, keep hardware cursors disabled.
cursor:no_hardware_cursors = true # Set to true to avoid hitches
# cursor:allow_dumb_copy = true
# https://wiki.hyprland.org/Nvidia/#va-api-hardware-video-acceleration
# Hardware video acceleration on Nvidia and Wayland is
# possible with the nvidia-vaapi-driver.
# This may solve specific issues in Electron apps.
env = NVD_BACKEND,direct # Requires 'libva-nvidia-driver' package
# https://wiki.hyprland.org/Nvidia/#regarding-environment-variables
# If you encounter crashes in Firefox, remove this line
env = GBM_BACKEND,nvidia-drm
# If you have a multi-GPU setup and you are facing lag in external monitor.
# See https://wiki.hyprland.org/Configuring/Multi-GPU/