feat: migrate Hyprland config from hyprlang to Lua with transparent IPC proxy#216
feat: migrate Hyprland config from hyprlang to Lua with transparent IPC proxy#216notvcto wants to merge 1 commit into
Conversation
|
Amended the PR commit to include a fix for |
|
Note: Some Control Center features are still broken after this migration, screen rotation and fractional scaling confirmed so far. Investigating and will push fixes before this is ready to merge. Do not merge yet. |
|
Fixes pushed. Screen rotation, fractional scaling, blur toggle, and workspace manager ephemeral layout are all updated to use the Lua-mode equivalents. Should be ready to merge. |
|
More issues found via a full audit pass. 22 total across scripts, TUI tools, and setup scripts. Working through them now. |
|
you're insane! wtf bro, i've been working on the port myself, its taking a while cuz i'm redoing all the configs not just porting them. but i'll look at how you happen to have done things and borrow a few things where i need them but damnn this is so much to merge, leave it up as a draft and i'll come back to this when i need something. thanks! |
|
@dusklinux All the Hypr configs are pretty much ported over to Lua, I'm just working on making everything else work around the new Lua logic |
Converts all source files from .conf (hyprlang) to .lua for Hyprland's native Lua config mode. - hyprland.lua: new Lua entry point; hyprland.conf kept as stub - source/*.lua: all modules rewritten in Lua syntax - source/animations/*.lua: all animation presets converted - edit_here/: user-editable Lua overrides replace .conf equivalents - hypr_lua_proxy.py: asyncio command-socket proxy that translates old-style dispatch strings (workspace N, movetoworkspace, etc.) into valid Lua expressions; event socket handled by socat - waybar_autostart.sh: starts proxy + socat relay before launching waybar; race-safe socket detection retries until Hyprland socket is ready - dusky_waybars.sh: uses systemd-run --setenv to inject proxy signature - keybindings.sh: graceful notice for __lua dispatcher (non-replayable) - rofi_mako.sh: replace hyprctl dispatch exec with uwsm-app - dusky_session.sh: Lua dispatch syntax for exit and workspace - spotify_toggle.sh: Lua dispatch syntax for special workspace - dusky_config.yaml: CC reload feedback, Lua config badge, waybar fix - matugen/config.toml: add hyprctl reload post_hook to hyprland_lua template so border/decoration colors update on wallpaper change - matugen/templates/razer_sync.sh: sync theme color to Razer keyboard via Polychromatic; skips silently if not installed or no device found
|
Update: Full audit complete. All Control Center features, UI tools, and app switchers have been fully bridged and tested against the new .lua architecture. Here's what changed:
Everything is stable in my testing environment. Marking as ready for review. |
|
looking back at this it would've been way funnier if I just tagged the commit |
Summary
Full migration of the Hyprland configuration from hyprlang (
.conf) to native Lua (.lua). Every source file has been converted, all original.conffiles removed, all user scripts audited and updated for Lua dispatch syntax, and a transparent IPC proxy layer ensures Waybar and other external tools continue to work without modification.What changed
Core Hyprland config (
.config/hypr/)hyprland.lua— new entry point; Hyprland loads it directly, no.conffile requiredsource/*.lua— all config modules rewritten in Lua:appearance,autostart,environment_variables,input,keybinds,monitors,permissions,plugins,window_rules,workspace_rulessource/*.conf— all original.conffiles removed; superseded by their.luaequivalentssource/*.conf.deprecated— originals preserved as.deprecatedsiblings for reference and easy reversionsource/animations/*.lua— all 20+ named animation presets converted to Lua; originals kept as.conf.deprecatededit_here/source/*.lua— all user-editable overrides converted to Lua equivalents;.conf.deprecatedoriginals kept alongside for referenceLua IPC Proxy (
user_scripts/hypr/hypr_lua_proxy.py)Hyprland's Lua config mode changes how
hyprctl dispatchworks — old-style strings likeworkspace 3ormovetoworkspace 5are no longer valid; the body is now evaluated as a Lua expression. This breaks Waybar workspace clicks and any external tool that callshyprctl dispatchwith the old syntax.The proxy solves this transparently:
asyncioUnix socket server that intercepts dispatch calls, translates them into valid Lua expressions (hl.dsp.focus({workspace=3})), and forwards them to the real Hyprland socketsocatpassthrough relay (zero Python overhead, pure kernel-level pipe) so Waybar's workspace indicators update in real timehyprctl dispatchthrough the proxy require zero changesWaybar integration (
user_scripts/waybar/)waybar_autostart.sh— major rewrite; spawns the Python proxy and socat event relay as persistentsystemd-rununits (hypr-lua-proxyandhypr-socat-proxy) so they survive parent cgroup cleanup after the script exits; callssystemctl reset-failedbefore each launch to clear stale unit state; creates the proxy socket directory explicitly before socat binds into it, fixing a race condition where socat failed on boot because the directory didn't exist yet; injectsHYPRLAND_INSTANCE_SIGNATURE=lua_proxyviasystemd-run --setenv=so Waybar talks to the proxy sockets instead of Hyprland directlydusky_waybars.sh— updated to usesystemd-run --setenv=for the same injection, ensuring Waybar config switching also preserves workspace click functionalityUser scripts
multi_monitor_workspace.sh— addedlua_dispatch()which emits proper Lua expressions forworkspace,movetoworkspace, andmovetoworkspacesilent; banked navigation logic preserveddusky_session.sh— Lua dispatch syntax for session exit and workspace dispatchspotify_toggle.sh— Lua dispatch syntax for special workspace togglerofi_mako.sh— replacedhyprctl dispatch execwithuwsm-app(correct UWSM-aware launch)keybindings.sh— shows a user-facing notice for the__luadispatcher (Lua mode keybinds are not externally replayable viahyprctl dispatch)hypr_anim.sh— animation preset switcher updated to source.luapresetsControl Center (
user_scripts/dusky_system/control_center/dusky_config.yaml)waybar_autostart.shto maintain the proxy on every config changeMatugen (
.config/matugen/)config.toml— added[templates.hyprland_lua]entry withpost_hook = 'hyprctl reload || :'; in Lua modedofile()only runs at load time, so without this hook border and decoration colors would not update when the wallpaper changestemplates/hyprland-colors.lua— new Matugen template that generates the Lua color file sourced byhyprland.luatemplates/razer_sync.sh— new template that syncs the active theme's primary color to a Razer keyboard viapolychromatic-cli; skips silently ifpolychromatic-cliis not installed or no matching device is found (RAZER_DEVICEenv var configurable)Waybar config
.config/waybar/01_horizontal_block/config.jsonc— new horizontal block layoutTest plan
hyprland.luaas entry point (no.confrequired)hyprctl reloadclean)dusky_waybars.sh) preserves workspace clickshypr_anim.sh) works with.luapresetsdusky_session.sh) works__luadispatcher