hyprland: migrate to Lua config, add pc/laptop profiles

hyprlang has been deprecated since Hyprland 0.55 and is dropped after 1-2
releases; this box runs 0.56.2. Migrate Hyprland's own config to Lua and
split the machine-specific parts into profiles.

Config:
- hyprland.lua entry point; the .conf tree is left in place as a rollback
  path (Hyprland prefers hyprland.lua and only decides at startup).
- Each require() is its own Lua scope, so hyprlang's global "$VAR" no longer
  crosses files: vars.lua / apps.lua / theme/colors.lua return tables.
- hypridle, hyprlock, plugins/* and pyprland.toml stay hyprlang -- the other
  hypr* tools keep it.

Profiles (configs/profiles/):
- pc     -> DP-1 / HDMI-A-1 / DP-2, all 1920x1080
- laptop -> eDP-1 3072x1920@120 scale 2.0, DP-1, HDMI-A-1 mirroring eDP-1
- Each owns its monitors and workspace-to-monitor mapping; common.lua
  generates the 30 workspace rules from the three outputs.
- Selected by $HYPR_PROFILE, else hostname (mainPC -> pc), else laptop.

Fixes:
- pyprland.toml called swww, which is not installed; the wallpaper backend
  here is awww. The rotation timer failed silently and both outputs stayed
  at color: 000000.
- XF86InputRaiseVolume / XF86InputLowerVolume are not real keysyms (no
  XF86Input* family in xkbcommon). They were dead in .conf too; hyprlang
  ignored them silently, hl.bind rejects them. Commented out.
- SUPER+SHIFT+R was bound twice (notification reload + bar reload). hyprlang
  ran both; in Lua the second would shadow the first, so they are merged.
- The waybar layer rule set no effects and was a no-op; dropped.
- Polkit autostart now picks hyprpolkitagent or polkit-gnome by what is
  installed, so one file works on both machines.

Verified with `Hyprland --verify-config` on both profiles (config ok).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StGBghPW9Dm7z7uj2VNWHr
This commit is contained in:
2026-09-03 18:36:30 +02:00
parent d949f471e8
commit 900cea0188
19 changed files with 897 additions and 4 deletions

26
hypr/configs/apps.lua Normal file
View File

@@ -0,0 +1,26 @@
-- Was: configs/default_apps.conf
local bar = "waybar"
local notifications = "swaync-client"
local terminal = "kitty"
return {
launcher = "rofi -show drun",
bar = bar,
bar_toggle = "killall -SIGUSR1 " .. bar,
bar_reload = "killall " .. bar .. "; " .. bar,
notifications = notifications,
notifications_read = notifications .. " -C",
notifications_toggle = notifications .. " -t",
notifications_reload = notifications .. " -R && " .. notifications .. " -rs",
browser = "firefox",
notetaking = "notesh",
terminal = terminal,
office_suite = "libreoffice",
editor = terminal .. " vim",
ide = "code",
file_manager = "nemo",
}

237
hypr/configs/binds.lua Normal file
View File

@@ -0,0 +1,237 @@
-- Was: configs/binds.conf
--
-- Translation notes (hyprlang -> Lua):
-- bind = MOD, KEY, dispatcher, arg -> hl.bind("MOD + KEY", hl.dsp....)
-- bindm -> { mouse = true }
-- bindl -> { locked = true }
-- binde -> { repeating = true }
-- bindle -> { locked = true, repeating = true }
-- killactive -> hl.dsp.window.close()
-- fullscreen, 0 -> hl.dsp.window.fullscreen({ mode = "fullscreen" })
-- movefocus, l -> hl.dsp.focus({ direction = "left" })
-- movewindow, l -> hl.dsp.window.move({ direction = "left" })
-- workspace, N -> hl.dsp.focus({ workspace = N })
-- movetoworkspace, N -> hl.dsp.window.move({ workspace = N })
-- movetoworkspacesilent -> hl.dsp.window.move({ workspace = N, follow = false })
-- togglegroup -> hl.dsp.group.toggle()
-- lockactivegroup,toggle-> hl.dsp.group.lock_active({ action = "toggle" })
-- changegroupactive -> hl.dsp.group.next()
-- resizeactive, X Y -> hl.dsp.window.resize({ x = X, y = Y, relative = true })
-- submap -> hl.dsp.submap() + hl.define_submap()
-- bare numeric keys (20/21/23) were keycodes -> "code:20" etc.
local vars = require("configs.vars")
local apps = require("configs.apps")
local mainMod = vars.mods.main -- SUPER
local altMod = vars.mods.alt -- ALT
local altrMod = vars.mods.altr -- SUPER + MOD5
local scripts = vars.paths.scripts
local launcher = vars.paths.launcher
local launch = scripts .. "/launch_app "
----------------------
---- APPLICATIONS ----
----------------------
hl.bind(mainMod .. " + S", hl.dsp.exec_cmd(launch .. apps.browser))
hl.bind(mainMod .. " + V", hl.dsp.exec_cmd(launch .. apps.ide))
hl.bind(mainMod .. " + O", hl.dsp.exec_cmd(launch .. apps.office_suite))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(launch .. apps.file_manager))
hl.bind(mainMod .. " + C", hl.dsp.exec_cmd(launch .. apps.terminal))
hl.bind(mainMod .. " + SHIFT + C", hl.dsp.exec_cmd(launch .. apps.terminal .. " docker exec -it yocto zsh"))
hl.bind(altMod .. " + C", hl.dsp.exec_cmd(launch .. apps.terminal .. " ssh Hetzner"))
hl.bind(altMod .. " + SHIFT + C", hl.dsp.exec_cmd(launch .. apps.terminal .. " docker exec -it ros2 zsh"))
hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(launch .. "element-desktop"))
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd(launch .. "thunderbird"))
---- Notifications Menu
hl.bind(mainMod .. " + N", hl.dsp.exec_cmd(apps.notifications_toggle))
hl.bind(mainMod .. " + SHIFT + N", hl.dsp.exec_cmd(apps.notifications_read))
---- Bar
-- NOTE: in binds.conf, SUPER+SHIFT+R was bound twice (notifications reload and
-- bar reload). hyprlang ran both; in Lua the later bind would shadow the
-- earlier one, so both are dispatched explicitly here.
hl.bind(mainMod .. " + SHIFT + R", function()
hl.dispatch(hl.dsp.exec_cmd(apps.notifications_reload))
hl.dispatch(hl.dsp.exec_cmd(apps.bar_reload))
end)
hl.bind(mainMod .. " + SHIFT + T", hl.dsp.exec_cmd(apps.bar_toggle))
-----------------------------
---- PICKERS / LAUNCHERS ----
-----------------------------
hl.bind(mainMod .. " + R", hl.dsp.exec_cmd(apps.launcher))
hl.bind(mainMod .. " + SHIFT + P", hl.dsp.exec_cmd(launcher .. "/wallpaper/wallpaper"))
hl.bind(altMod .. " + P", hl.dsp.exec_cmd(launcher .. "/wireguard/wireguard_selection menu"))
hl.bind(mainMod .. " + ESCAPE", hl.dsp.exec_cmd(launcher .. "/powermenu/powermenu"))
hl.bind(mainMod .. " + Y", hl.dsp.exec_cmd(launcher .. "/clipboard/clipboard"))
---- Screenshots
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.exec_cmd("hyprshot -m window --clipboard-only"))
hl.bind(altMod .. " + SHIFT + S", hl.dsp.exec_cmd("hyprshot -m region --clipboard-only"))
------------------
---- PYPRLAND ----
------------------
hl.bind(mainMod .. " + B", hl.dsp.exec_cmd("pypr toggle btop"))
-- hl.bind(mainMod .. " + RETURN", hl.dsp.exec_cmd("pypr toggle kitty"))
hl.bind(mainMod .. " + P", hl.dsp.exec_cmd(scripts .. "/random_wallpaper"))
-----------------
---- WINDOWS ----
-----------------
---- Basic Operations
hl.bind(mainMod .. " + Q", hl.dsp.window.close())
hl.bind(altMod .. " + Q", hl.dsp.window.close())
hl.bind(mainMod .. " + W", hl.dsp.exec_cmd(scripts .. "/toggle_floating"))
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ mode = "fullscreen" }))
-- hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
---- Mouse
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
---- Focusing
hl.bind(mainMod .. " + LEFT", hl.dsp.focus({ direction = "left" }))
hl.bind(mainMod .. " + RIGHT", hl.dsp.focus({ direction = "right" }))
hl.bind(mainMod .. " + UP", hl.dsp.focus({ direction = "up" }))
hl.bind(mainMod .. " + DOWN", hl.dsp.focus({ direction = "down" }))
---- Moving
hl.bind(altMod .. " + LEFT", hl.dsp.window.move({ direction = "left" }))
hl.bind(altMod .. " + RIGHT", hl.dsp.window.move({ direction = "right" }))
hl.bind(altMod .. " + UP", hl.dsp.window.move({ direction = "up" }))
hl.bind(altMod .. " + DOWN", hl.dsp.window.move({ direction = "down" }))
---- Center and Split
-- hl.bind(mainMod .. " + D", hl.dsp.layout("togglesplit"))
---- Group Control
hl.bind(mainMod .. " + G", hl.dsp.group.toggle())
hl.bind(mainMod .. " + CTRL + G", hl.dsp.group.lock_active({ action = "toggle" }))
hl.bind("ALT + TAB", hl.dsp.group.next())
---- Resizing Windows (submap)
hl.bind(mainMod .. " + code:23", hl.dsp.submap("resize")) -- keycode 23 = TAB
hl.define_submap("resize", function()
hl.bind("RIGHT", hl.dsp.window.resize({ x = 40, y = 0, relative = true }), { repeating = true })
hl.bind("LEFT", hl.dsp.window.resize({ x = -40, y = 0, relative = true }), { repeating = true })
hl.bind("UP", hl.dsp.window.resize({ x = 0, y = -40, relative = true }), { repeating = true })
hl.bind("DOWN", hl.dsp.window.resize({ x = 0, y = 40, relative = true }), { repeating = true })
hl.bind("ESCAPE", hl.dsp.submap("reset"))
end)
--------------------
---- WORKSPACES ----
--------------------
-- 1-10 on mainMod, 11-20 on altMod, 21-30 on altrMod.
-- Key 0 maps to the 10th workspace of each block.
local wsBlocks = {
{ mod = mainMod, offset = 0 },
{ mod = altMod, offset = 10 },
{ mod = altrMod, offset = 20 },
}
for _, block in ipairs(wsBlocks) do
for i = 1, 10 do
local key = i % 10 -- 10 -> key 0
local ws = block.offset + i
-- Focus a workspace
hl.bind(block.mod .. " + " .. key, hl.dsp.focus({ workspace = ws }))
-- Move the active window to a workspace (following it)
hl.bind(block.mod .. " + SHIFT + " .. key, hl.dsp.window.move({ workspace = ws }))
-- Move the active window to a workspace silently (staying put)
hl.bind(block.mod .. " + CTRL + " .. key, hl.dsp.window.move({ workspace = ws, follow = false }))
end
end
---- Moving to other Workspace with Mouse Control
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "m-1" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "m+1" }))
---------------
---- MEDIA ----
---------------
local locked = { locked = true }
local lockrep = { locked = true, repeating = true }
---- Mute
hl.bind(mainMod .. " + CTRL + mouse:280", hl.dsp.exec_cmd("swayosd-client --output-volume mute-toggle"), locked) -- Extra Up Button
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("swayosd-client --output-volume mute-toggle"), locked)
hl.bind(mainMod .. " + CTRL + mouse:281", hl.dsp.exec_cmd("swayosd-client --input-volume mute-toggle"), locked) -- Extra Down Button
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("swayosd-client --input-volume mute-toggle"), locked)
---- Playback
hl.bind("XF86AudioPlay", hl.dsp.exec_cmd("playerctl play-pause"), locked)
hl.bind("XF86AudioPause", hl.dsp.exec_cmd("playerctl play-pause"), locked)
hl.bind(mainMod .. " + CTRL + mouse:282", hl.dsp.exec_cmd("playerctl play-pause"), locked) -- Extra Center Button
hl.bind(mainMod .. " + CTRL + RETURN", hl.dsp.exec_cmd("playerctl play-pause"), locked)
hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), locked)
hl.bind(mainMod .. " + CTRL + mouse:275", hl.dsp.exec_cmd("playerctl previous"), locked) -- Extra Back Button
hl.bind(mainMod .. " + CTRL + code:20", hl.dsp.exec_cmd("playerctl previous"), locked) -- Minus Key
hl.bind("XF86AudioNext", hl.dsp.exec_cmd("playerctl next"), locked)
hl.bind(mainMod .. " + CTRL + mouse:276", hl.dsp.exec_cmd("playerctl next"), locked) -- Extra Forward Button
hl.bind(mainMod .. " + CTRL + code:21", hl.dsp.exec_cmd("playerctl next"), locked) -- Plus Key
---- Output Volume
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("swayosd-client --output-volume +10"), lockrep)
hl.bind(mainMod .. " + ALT + code:21", hl.dsp.exec_cmd("swayosd-client --output-volume raise"), lockrep)
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("swayosd-client --output-volume -10"), lockrep)
hl.bind(mainMod .. " + ALT + code:20", hl.dsp.exec_cmd("swayosd-client --output-volume lower"), lockrep)
---- Input Volume
-- NOTE: binds.conf had `XF86InputRaiseVolume` / `XF86InputLowerVolume` here.
-- Those keysyms do not exist in xkbcommon (there is no XF86Input* family), so
-- these two binds never did anything -- hyprlang accepted the line and silently
-- ignored it, while hl.bind() validates the keysym and reports an error.
-- They are left commented out; the SUPER+SHIFT binds below are the working ones.
-- hl.bind("XF86InputRaiseVolume", hl.dsp.exec_cmd("swayosd-client --input-volume raise"), lockrep)
-- hl.bind("XF86InputLowerVolume", hl.dsp.exec_cmd("swayosd-client --input-volume lower"), lockrep)
hl.bind(mainMod .. " + SHIFT + code:21", hl.dsp.exec_cmd("swayosd-client --input-volume raise"), lockrep)
hl.bind(mainMod .. " + SHIFT + code:20", hl.dsp.exec_cmd("swayosd-client --input-volume lower"), lockrep)
---- Brightness
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("swayosd-client --brightness +10"), lockrep)
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("swayosd-client --brightness -10"), lockrep)
---------------
---- OTHER ----
---------------
-- Color picker
hl.bind(mainMod .. " + INSERT", hl.dsp.exec_cmd(scripts .. "/color_picker"))
-- Disable anim, blur, etc
hl.bind(mainMod .. " + F12", hl.dsp.exec_cmd(scripts .. "/performance"))
-- Freeze active window
hl.bind(mainMod .. " + H", hl.dsp.exec_cmd(scripts .. "/hyprfreeze -a"))
-- Open Wikis
-- hl.bind(mainMod .. " + F1", hl.dsp.exec_cmd("xdg-open https://wiki.hypr.land/"))
-- Zoom
-- hl.bind(mainMod .. " + SHIFT + mouse:276", hl.dsp.exec_cmd("hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor | awk '/^float.*/ {print $2 + 0.5}')"))
-- hl.bind(mainMod .. " + SHIFT + mouse:275", hl.dsp.exec_cmd("hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor | awk '/^float.*/ {print $2 - 0.5}')"))
-- Lock
hl.bind(mainMod .. " + L", hl.dsp.exec_cmd("swaylock"))

31
hypr/configs/env.lua Normal file
View File

@@ -0,0 +1,31 @@
-- Was: configs/env.conf
--
-- NOTE: hyprlang had both `env` and `envd` (the latter also exported into the
-- systemd/D-Bus activation environment). Lua only has hl.env(); Hyprland now
-- manages systemd/D-Bus activation vars by default for everything set here
-- (that is what HYPRLAND_NO_SD_VARS=1 turns off), so the former `envd` entries
-- are plain hl.env() calls now.
-- XDG
hl.env("XDG_CURRENT_DESKTOP", "Hyprland")
hl.env("XDG_SESSION_TYPE", "wayland")
hl.env("XDG_SESSION_DESKTOP", "Hyprland")
-- QT
hl.env("QT_QPA_PLATFORM", "wayland")
hl.env("QT_QPA_PLATFORMTHEME", "qt5ct")
hl.env("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1")
hl.env("QT_AUTO_SCREEN_SCALE_FACTOR", "1")
hl.env("QT_STYLE_OVERRIDE", "kvantum")
-- Tearing
hl.env("WLR_DRM_NO_ATOMIC", "0")
-- Themes
hl.env("GTK_THEME", "catppuccin-macchiato-lavender-standard+default")
hl.env("XCURSOR_THEME", "catppuccin-macchiato-dark-cursors")
-- hl.env("XCURSOR_THEME", "Wii-Pointer-P1")
hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_THEME", "catppuccin-macchiato-dark-cursors")
-- hl.env("HYPRCURSOR_THEME", "Wii-Pointer-P1")
hl.env("HYPRCURSOR_SIZE", "24")

17
hypr/configs/input.lua Normal file
View File

@@ -0,0 +1,17 @@
-- Was: configs/input.conf
hl.config({
input = {
kb_layout = "de",
kb_options = "compose:rctrl, level3:ralt_switch, grp:win_space_toggle",
follow_mouse = 1,
numlock_by_default = true,
touchpad = {
natural_scroll = true,
disable_while_typing = true,
scroll_factor = 0.5,
},
},
})

36
hypr/configs/misc.lua Normal file
View File

@@ -0,0 +1,36 @@
-- Was: configs/misc.conf
hl.config({
general = {
allow_tearing = false,
},
misc = {
always_follow_on_dnd = true,
disable_hyprland_logo = true,
vrr = 0,
animate_manual_resizes = true,
animate_mouse_windowdragging = false,
enable_swallow = true,
font_family = "JetBrainsMono Nerd Font",
enable_anr_dialog = false,
},
binds = {
movefocus_cycles_fullscreen = false,
},
xwayland = {
force_zero_scaling = true,
},
dwindle = {
-- pseudotile = true, -- Master switch for pseudotiling
preserve_split = true, -- You probably want this
force_split = 0,
},
})
-- The `gestures {}` block in misc.conf was fully commented out. The modern
-- equivalent is hl.gesture(); uncomment to enable a 4-finger workspace swipe.
-- hl.gesture({ fingers = 4, direction = "horizontal", action = "workspace" })

23
hypr/configs/plugins.lua Normal file
View File

@@ -0,0 +1,23 @@
-- Was: configs/plugins.conf
--
-- All the individual plugin blocks were commented out; only the hyprpm reload
-- was live. Plugin config files under plugins/ are still hyprlang .conf and are
-- NOT loaded from here (they weren't before either -- their source lines were
-- commented out).
hl.on("hyprland.start", function()
hl.exec_cmd("hyprpm reload -n")
end)
-- Hyprtrails
-- hl.exec_cmd("hyprpm enable hyprtrails"); require("plugins.hyprtrails")
-- Hyprexpo
-- hl.exec_cmd("hyprpm enable hyprexpo"); require("plugins.hyprexpo")
-- Hyprsplit
-- hl.exec_cmd("hyprpm enable hyprsplit"); require("plugins.hyprsplit")
-- Hyprtasking
-- hl.exec_cmd("hyprpm enable hyprtasking"); require("plugins.hyprtasking")
-- Hyprspace
-- hl.exec_cmd("hyprpm enable hyprspace"); require("plugins.hyprspace")
-- Dynamic-cursors
-- hl.exec_cmd("hyprpm enable dynamic-cursors"); require("plugins.dynamic-cursors")

View File

@@ -0,0 +1,31 @@
-- Shared profile logic: given three outputs, lay out the 30 workspaces.
--
-- 1-10 -> MONITOR1, 11-20 -> MONITOR2, 21-30 -> MONITOR3.
-- The first workspace of each block is that monitor's default.
-- Was: configs/workspaces.conf (byte-identical on both machines, because it
-- only ever referred to $MONITOR1/2/3).
local M = {}
function M.workspaces(monitors)
local blocks = {
{ first = 1, last = 10, monitor = monitors[1] },
{ first = 11, last = 20, monitor = monitors[2] },
{ first = 21, last = 30, monitor = monitors[3] },
}
for _, block in ipairs(blocks) do
for ws = block.first, block.last do
hl.workspace_rule({
workspace = tostring(ws),
monitor = block.monitor,
default = (ws == block.first),
})
end
end
end
-- Gaming workspaces (10 / 20 / 30) had these commented out in workspaces.conf:
-- no_rounding = true, decorate = false, gaps_in = -1, gaps_out = 0, no_border = true
return M

View File

@@ -0,0 +1,35 @@
-- Machine profile selection.
--
-- Each profile owns the two things that genuinely differ between machines:
-- the monitor layout and the workspace-to-monitor assignment.
--
-- Selection order:
-- 1. $HYPR_PROFILE, if set (e.g. `HYPR_PROFILE=laptop Hyprland`)
-- 2. hostname match
-- 3. fallback: "laptop"
--
-- To add a machine: create configs/profiles/<name>.lua and add it to `byHost`.
local byHost = {
mainPC = "pc",
}
local fallback = "laptop"
local function hostname()
-- Cheap file read at config-load time (not in a bind callback, so it is
-- safe to block on). os.getenv("HOSTNAME") is not reliably exported.
local f = io.open("/etc/hostname")
if not f then return nil end
local h = f:read("l")
f:close()
-- strip stray whitespace
return h and h:match("^%s*(.-)%s*$") or nil
end
local host = hostname()
local profile = os.getenv("HYPR_PROFILE") or byHost[host] or fallback
require("configs.profiles." .. profile)
return { name = profile, host = host }

View File

@@ -0,0 +1,22 @@
-- Profile: laptop
-- Internal hidpi panel plus two external 1080p outputs.
-- Was: the committed configs/monitors.conf in the dotfiles repo.
local common = require("configs.profiles.common")
local MONITOR1 = "eDP-1" -- internal panel
local MONITOR2 = "DP-1" -- second
local MONITOR3 = "HDMI-A-1" -- third
-- Main Monitor
hl.monitor({ output = MONITOR1, mode = "3072x1920@120.00", position = "0x0", scale = 2.0, vrr = 1 })
-- Second Monitor
hl.monitor({ output = MONITOR2, mode = "1920x1080@60.00", position = "0x1920", scale = 1.0 })
-- FSIT: position = "-1920x-800"
-- mirror = MONITOR1
-- Third Monitor
hl.monitor({ output = MONITOR3, mode = "1920x1080@60.00", position = "0x1920", scale = 1.0, mirror = MONITOR1 })
common.workspaces({ MONITOR1, MONITOR2, MONITOR3 })

View File

@@ -0,0 +1,24 @@
-- Profile: pc (hostname "mainPC")
-- Three 1080p outputs, no internal panel.
-- Was: the live ~/.config/hypr/configs/monitors.conf on this machine.
local common = require("configs.profiles.common")
local MONITOR1 = "DP-1" -- main
local MONITOR2 = "HDMI-A-1" -- second
local MONITOR3 = "DP-2" -- third
-- Main Monitor
hl.monitor({ output = MONITOR1, mode = "1920x1080@120.00", position = "0x0", scale = 1.0 })
-- add vrr = 1 to the above if wanted
-- Second Monitor
hl.monitor({ output = MONITOR2, mode = "1920x1080@60.00", position = "-1920x280", scale = 1.0 })
-- FSIT Arbeitsplatz: position = "-1920x-800"
-- mirror = MONITOR3
-- Third Monitor
hl.monitor({ output = MONITOR3, mode = "1920x1080@60.00", position = "0x1920", scale = 1.0 })
-- mirror = MONITOR1
common.workspaces({ MONITOR1, MONITOR2, MONITOR3 })

19
hypr/configs/vars.lua Normal file
View File

@@ -0,0 +1,19 @@
-- Shared values used by several config modules.
-- In Lua each require() is its own scope, so hyprlang's global "$VAR"
-- no longer leaks across files: modules return a table instead.
--
-- Monitor names are NOT here -- they are per-machine and live in
-- configs/profiles/{pc,laptop}.lua.
return {
mods = {
main = "SUPER",
alt = "ALT",
altr = "SUPER + MOD5",
},
paths = {
scripts = os.getenv("HOME") .. "/.config/hypr/scripts",
launcher = os.getenv("HOME") .. "/.config/rofi/scripts",
},
}

25
hypr/hyprland.lua Normal file
View File

@@ -0,0 +1,25 @@
-- Hyprland Lua config (migrated from hyprland.conf + configs/ + theme/).
--
-- Hyprland loads hyprland.lua in preference to hyprland.conf when both exist,
-- and only decides at startup -- so switching between them needs a restart.
-- The .conf files are kept intact next to these; to roll back, move
-- hyprland.lua aside and restart Hyprland.
--
-- Each require() is its own Lua scope, so an error in one file does not stop
-- the others -- but a require() of a *missing* file kills this file, so keep
-- the paths correct.
-- Configs
require("configs.env")
require("configs.profiles.init") -- monitors + workspaces, per machine
require("configs.binds")
require("configs.input")
require("configs.misc")
require("configs.plugins")
require("theme.theme")
-- Autostart
hl.on("hyprland.start", function()
hl.exec_cmd(os.getenv("HOME") .. "/.config/hypr/scripts/autostart/services")
hl.exec_cmd(os.getenv("HOME") .. "/.config/hypr/scripts/autostart/apps")
end)

View File

@@ -63,6 +63,6 @@ lazy = true
[wallpapers] [wallpapers]
path = "~/.config/hypr/theme/walls/" path = "~/.config/hypr/theme/walls/"
interval = 60 # change every hour interval = 60 # change every hour
command = "swww img --transition-bezier 0.5,1.19,.8,.4 --transition-type wipe --transition-duration 2 --transition-fps 75 \"[file]\" && notify-send 'Wallpaper Changed' -i \"[file]\" --app-name=Wallpaper" command = "awww img --transition-bezier 0.5,1.19,.8,.4 --transition-type wipe --transition-duration 2 --transition-fps 75 \"[file]\" && notify-send 'Wallpaper Changed' -i \"[file]\" --app-name=Wallpaper"
clear_command = "swww clear" clear_command = "awww clear"
extensions = ["jpg", "png", "gif", "jpeg"] extensions = ["jpg", "png", "gif", "jpeg"]

View File

@@ -27,8 +27,13 @@ hypridle &
# Clipboard # Clipboard
wl-paste --watch cliphist store & wl-paste --watch cliphist store &
# Polkit authentication # Polkit authentication -- hyprpolkitagent on the laptop, polkit-gnome on mainPC.
# Whichever is installed wins, so this one file works on both machines.
if [ -x /usr/lib/hyprpolkitagent/hyprpolkitagent ]; then
/usr/lib/hyprpolkitagent/hyprpolkitagent & /usr/lib/hyprpolkitagent/hyprpolkitagent &
elif [ -x /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 ]; then
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
fi
# Screen sharing and portals # Screen sharing and portals
"$HOME"/.config/hypr/scripts/portal & "$HOME"/.config/hypr/scripts/portal &

37
hypr/theme/animations.lua Normal file
View File

@@ -0,0 +1,37 @@
-- Was: theme/animations.conf
hl.config({ animations = { enabled = true } })
-- Curves. hyprlang's `bezier = name, x0, y0, x1, y1` becomes hl.curve with
-- two control points.
hl.curve("default", { type = "bezier", points = { {0.05, 0.9}, {0.1, 1.02} } })
hl.curve("wind", { type = "bezier", points = { {0.05, 0.9}, {0.1, 1.02} } })
hl.curve("overshot", { type = "bezier", points = { {0.13, 0.99}, {0.29, 1.02} } })
hl.curve("liner", { type = "bezier", points = { {1, 1}, {1, 1} } })
hl.curve("easeOutQuint", { type = "bezier", points = { {0.23, 1}, {0.32, 1.03} } })
-- Fast Animations
-- (old form: animation = <leaf>, <enabled>, <speed>, <curve>, <style>)
hl.animation({ leaf = "windows", enabled = true, speed = 3.5, bezier = "easeOutQuint", style = "popin" })
hl.animation({ leaf = "windowsIn", enabled = true, speed = 3.5, bezier = "easeOutQuint", style = "popin" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 3.5, bezier = "overshot", style = "popin" })
hl.animation({ leaf = "windowsMove", enabled = true, speed = 3.5, bezier = "overshot", style = "slide" })
hl.animation({ leaf = "layers", enabled = true, speed = 3, bezier = "default", style = "popin" })
hl.animation({ leaf = "fadeIn", enabled = true, speed = 4, bezier = "default" })
hl.animation({ leaf = "fadeOut", enabled = true, speed = 4, bezier = "default" })
hl.animation({ leaf = "fadeSwitch", enabled = true, speed = 4, bezier = "default" })
hl.animation({ leaf = "fadeShadow", enabled = true, speed = 4, bezier = "default" })
hl.animation({ leaf = "fadeDim", enabled = true, speed = 4, bezier = "default" })
hl.animation({ leaf = "fadeLayers", enabled = true, speed = 4, bezier = "default" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 3.25, bezier = "easeOutQuint", style = "slide" })
-- hl.animation({ leaf = "border", enabled = true, speed = 1, bezier = "liner" })
-- hl.animation({ leaf = "borderangle", enabled = true, speed = 30, bezier = "liner", style = "loop" })
-- Slow Animations (was commented out in animations.conf, kept for reference)
-- hl.animation({ leaf = "windows", enabled = true, speed = 7, bezier = "wind", style = "popin" })
-- hl.animation({ leaf = "windowsIn", enabled = true, speed = 6, bezier = "overshot", style = "popin" })
-- hl.animation({ leaf = "windowsOut", enabled = true, speed = 5, bezier = "overshot", style = "popin" })
-- hl.animation({ leaf = "windowsMove", enabled = true, speed = 6, bezier = "overshot", style = "slide" })
-- hl.animation({ leaf = "layers", enabled = true, speed = 4, bezier = "default", style = "popin" })
-- hl.animation({ leaf = "fadeIn", enabled = true, speed = 10, bezier = "default" })
-- hl.animation({ leaf = "workspaces", enabled = true, speed = 6, bezier = "overshot", style = "slide" })

48
hypr/theme/colors.lua Normal file
View File

@@ -0,0 +1,48 @@
-- Was: theme/colors.conf (Catppuccin Macchiato)
--
-- hyprlang needed a paired "$nameAlpha" bare-hex variable for every colour so
-- it could string-splice alpha on. In Lua we keep only the hex and build
-- colour strings with the helpers below.
local hex = {
rosewater = "f4dbd6",
flamingo = "f0c6c6",
pink = "f5bde6",
mauve = "c6a0f6",
red = "ed8796",
maroon = "ee99a0",
peach = "f5a97f",
yellow = "eed49f",
green = "a6da95",
teal = "8bd5ca",
sky = "91d7e3",
sapphire = "7dc4e4",
blue = "8aadf4",
lavender = "b7bdf8",
text = "cad3f5",
subtext1 = "b8c0e0",
subtext0 = "a5adcb",
overlay2 = "939ab7",
overlay1 = "8087a2",
overlay0 = "6e738d",
surface2 = "5b6078",
surface1 = "494d64",
surface0 = "363a4f",
base = "24273a",
mantle = "1e2030",
crust = "181926",
}
local M = { hex = hex }
-- Opaque colour, e.g. M.rgb("lavender") -> "rgb(b7bdf8)"
function M.rgb(name)
return "rgb(" .. hex[name] .. ")"
end
-- Colour with an alpha suffix, e.g. M.rgba("lavender", "69") -> "rgba(b7bdf869)"
function M.rgba(name, alpha)
return "rgba(" .. hex[name] .. alpha .. ")"
end
return M

81
hypr/theme/decoration.lua Normal file
View File

@@ -0,0 +1,81 @@
-- Was: theme/decoration.conf
local c = require("theme.colors")
-- The old 4-stop 45deg gradient, reused for windows and groups.
local activeGradient = {
colors = {
c.rgba("text", "ee"),
c.rgba("lavender", "69"),
c.rgba("lavender", "69"),
c.rgba("text", "ee"),
},
angle = 45,
}
local inactiveBorder = c.rgba("lavender", "69")
hl.config({
general = {
border_size = 2,
col = {
active_border = activeGradient,
inactive_border = inactiveBorder,
},
gaps_in = 3,
gaps_out = 5,
},
decoration = {
rounding = 7,
active_opacity = 0.92,
inactive_opacity = 0.90,
blur = {
enabled = true,
size = 5,
passes = 4,
ignore_opacity = true,
new_optimizations = true,
xray = false,
noise = 0.0,
popups = true,
},
shadow = {
enabled = true,
range = 30,
scale = 2,
render_power = 5,
color = c.rgb("crust"),
color_inactive = c.rgb("surface0"),
},
dim_inactive = false,
dim_strength = 0.05,
},
group = {
col = {
border_active = activeGradient,
border_inactive = inactiveBorder,
border_locked_active = activeGradient,
border_locked_inactive = inactiveBorder,
},
groupbar = {
col = {
active = c.rgba("lavender", "CC"),
inactive = c.rgba("subtext1", "99"),
locked_active = c.rgba("maroon", "CC"),
locked_inactive = c.rgba("subtext1", "99"),
},
font_family = "JetBrainsMono Nerd Font",
font_size = 14,
text_color = c.rgb("crust"),
height = 16,
},
},
})

192
hypr/theme/rules.lua Normal file
View File

@@ -0,0 +1,192 @@
-- Was: theme/rules.conf
--
-- The old file already used the 0.53+ `windowrule { name/match:class }` block
-- form, so this is a fairly direct transcription:
-- match:class = <regex> -> match = { class = <regex> }
-- float = on -> float = true
-- center = 1 -> center = true
-- size = (a) (b) -> size = { "a", "b" }
-- Reusable size presets (monitor-relative expressions)
local size_large = { "monitor_w*0.7", "monitor_h*0.7" }
local size_mid = { "monitor_w*0.5", "monitor_h*0.5" }
local size_mini = { "monitor_w*0.3", "monitor_h*0.4" }
local size_side = { "monitor_w*0.3", "monitor_h*0.9" }
--------------------
---- BASE RULES ----
--------------------
hl.window_rule({
name = "center-float-large",
match = { class = "^(center-float-large)$|^(.*qimgv.*)$|^(.*mpv.*)$" },
float = true,
size = size_large,
center = true,
})
hl.window_rule({
name = "center-float",
match = { class = "^(center-float)$" },
float = true,
size = size_mid,
center = true,
})
hl.window_rule({
name = "center-float-title",
match = { title = "^(.*Open Folder.*)$|^(.*Open File.*)$|^(.*Save File.*)$|^(.*Save Folder.*)$|^(.*Save Image.*)$|^(.*Save As.*)$|^(.*Open As.*)$" },
float = true,
size = size_mid,
center = true,
})
hl.window_rule({
name = "center-float-mini",
match = { class = "^(center-float-mini)$|^(.*galculator.*)$|^(.*ytdlp-gui.*)$|^(.*udiskie.*)$|^(.*Calculator.*)$" },
float = true,
size = size_mini,
center = true,
})
-------------------------
---- ANIMATION RULES ----
-------------------------
hl.window_rule({
name = "cava",
match = { title = "^.*cava.*$" },
animation = "slide",
})
hl.window_rule({
name = "wleave",
match = { class = "^.*wleave.*$" },
animation = "popin",
})
---------------------
---- SCRATCHPADS ----
---------------------
hl.window_rule({
name = "scratchpad-large",
match = { class = "^scratchpad-large$" },
float = true,
size = size_large,
center = true,
animation = "slide",
workspace = "special:scratchpad-large",
})
hl.window_rule({
name = "scratchpad",
match = { class = "^scratchpad$" },
float = true,
size = size_mid,
center = true,
animation = "slide",
workspace = "special:scratchpad",
})
hl.window_rule({
name = "scratchpad-mini",
match = { class = "^scratchpad-mini$" },
float = true,
size = size_mini,
center = true,
animation = "slide",
workspace = "special:scratchpad-mini",
})
hl.window_rule({
name = "sideScratchpad",
match = { class = "^(.*pavucontrol.*)$|(.*blueman-manager.*)$" },
float = true,
size = size_side,
center = true,
workspace = "special:scratchpad",
})
----------------------------
---- SPECIFIC APP RULES ----
----------------------------
hl.window_rule({
name = "videobridge",
match = { class = "^(.*xwaylandvideobridge.*)$" },
opacity = "0.0",
})
hl.window_rule({
name = "zathura",
match = { class = "^(.*zathura.*)$" },
float = true,
size = { "monitor_w*0.35", "monitor_h*0.9" },
center = true,
})
hl.window_rule({
name = "scrcpy",
match = { class = "^(.*wgpsscli.*)$" },
float = true,
center = true,
})
hl.window_rule({
name = "agpss",
match = { class = "^(-*agpss.*)$" },
tile = true,
})
---------------------
---- LAYER RULES ----
---------------------
hl.layer_rule({
name = "rofi",
match = { namespace = "rofi" },
animation = "popin 80% 150ms",
blur = true,
})
-- NOTE: the old `layerrule { name = waybar, match:namespace = waybar }` block
-- set no effects at all, so it was a no-op and is dropped here. Add e.g.
-- `blur = true` if that was the intent.
hl.layer_rule({
name = "swaync-notification",
match = { namespace = "swaync-notification-window" },
animation = "slide",
})
hl.layer_rule({
name = "swaync-control",
match = { namespace = "swaync-control-center" },
animation = "slide",
})
hl.layer_rule({
name = "swayosd",
match = { namespace = "swayosd" },
animation = "fade",
})
hl.layer_rule({
name = "selection",
match = { namespace = "selection" },
animation = "fade",
})
hl.layer_rule({
name = "hyprlock",
match = { namespace = "hyprlock" },
animation = "fade",
})
-- `animation = none` in rules.conf -> the documented no_anim effect
hl.layer_rule({
name = "hyprpicker",
match = { namespace = "hyprpicker" },
no_anim = true,
})

4
hypr/theme/theme.lua Normal file
View File

@@ -0,0 +1,4 @@
-- Was: theme/theme.conf
require("theme.animations")
require("theme.rules")
require("theme.decoration")