Skip to content

Add a template for Lua (used by Hyprland since 0.55) - #239

Merged
eylles merged 1 commit into
eylles:masterfrom
n0op3:master
May 11, 2026
Merged

Add a template for Lua (used by Hyprland since 0.55)#239
eylles merged 1 commit into
eylles:masterfrom
n0op3:master

Conversation

@n0op3

@n0op3 n0op3 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Since the 0.55 release, hyprlang (Hyprland's DSL) is deprecated for configuring the compositor, in favor of Lua.
I think since pywal16 supports Hyprland pre-0.55, it should continue to support the newer releases as well without the need for user-defined templates.

Here's a complete example of how it can be used in a Lua-based Hyprland config:

package.path = package.path .. ";" .. os.getenv("HOME") .. "/.cache/wal/colors.lua"

local ok, pywal = pcall(require, "colors")

if not ok then
    hl.exec_cmd("notify-send Hyprland 'Loading pywal colors failed'")
    pywal = { color6 = "#ffffff", color4 = "#7C0204" } -- fallback colors
end

hl.config({
    general =
        col = {
            active_border = { colors = { pywal.color6, pywal.color4 } },
            inactive_border = "rgba(00000000)"
        },
    },
})

Or, if the user doesn't care about errors:

package.path = package.path .. ";" .. os.getenv("HOME") .. "/.cache/wal/colors.lua"
local pywal = require("colors")

hl.config({ col = { active_border = { colors = { pywal.color6, pywal.color4 } } } })

Thanks for the awesome project! If any changes are necessary, I'll be happy to make them (I'm not a Python programmer though)
Cheers!

@eylles

eylles commented May 11, 2026

Copy link
Copy Markdown
Owner

looks good to me

@eylles
eylles merged commit af71171 into eylles:master May 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants