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:
37
hypr/theme/animations.lua
Normal file
37
hypr/theme/animations.lua
Normal 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
48
hypr/theme/colors.lua
Normal 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
81
hypr/theme/decoration.lua
Normal 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
192
hypr/theme/rules.lua
Normal 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
4
hypr/theme/theme.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Was: theme/theme.conf
|
||||
require("theme.animations")
|
||||
require("theme.rules")
|
||||
require("theme.decoration")
|
||||
Reference in New Issue
Block a user