Shortcuts you invent, rules you write, gestures you own - all still just data
Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -37,6 +37,53 @@ local accentPair = accents[prefs.get("accentName", "blue")] or accents.blue
|
||||
local accentStart = accentScheme == "light" and accentPair.light or accentPair.dark
|
||||
local accentEnd = accentScheme == "light" and accentPair.lightSecondary or accentPair.darkSecondary
|
||||
|
||||
-- ── Color filters ───────────────────────────────────────────────────────────
|
||||
--
|
||||
-- Grayscale and three color-blindness corrections, as end-of-pipe screen
|
||||
-- shaders. Hyprland composites the desktop and then runs one fragment shader
|
||||
-- over the result, so a filter here covers every window, the shell, the cursor
|
||||
-- and video alike -- which is the only way a filter is honest.
|
||||
--
|
||||
-- The PREFERENCE is the enum, not the path. That split is deliberate: storing
|
||||
-- the path would put a filesystem location a person can edit into the value
|
||||
-- that becomes `decoration:screen_shader`, and it would make the stored value
|
||||
-- disagree with what hyprctl reports back (which is the path), failing the
|
||||
-- schema shape and write-sweep contracts. So PreferenceSchema's colorFilter
|
||||
-- entry carries no `hypr:` block, and the enum→path mapping is written twice
|
||||
-- on purpose: here, for reloads and for the moment before the shell starts,
|
||||
-- and in services/SystemSettings.qml's applyColorFilter for the live apply.
|
||||
-- The two lists have to be edited together.
|
||||
--
|
||||
-- "none" and anything unrecognised both produce the empty string, which is
|
||||
-- what Hyprland reads as "no shader" -- and is the value it needs to be given
|
||||
-- to turn one OFF, since there is no way to unset the option.
|
||||
local shaderDir = (function()
|
||||
local configHome = os.getenv("XDG_CONFIG_HOME")
|
||||
if configHome == nil or configHome == "" then
|
||||
local home = os.getenv("HOME")
|
||||
if home == nil or home == "" then
|
||||
return nil
|
||||
end
|
||||
configHome = home .. "/.config"
|
||||
end
|
||||
return configHome .. "/hypr/shaders"
|
||||
end)()
|
||||
|
||||
local colorFilters = {
|
||||
grayscale = "grayscale.frag",
|
||||
protanopia = "protanopia.frag",
|
||||
deuteranopia = "deuteranopia.frag",
|
||||
tritanopia = "tritanopia.frag",
|
||||
}
|
||||
|
||||
local colorFilterShader = ""
|
||||
do
|
||||
local file = colorFilters[prefs.get("colorFilter", "none")]
|
||||
if file ~= nil and shaderDir ~= nil then
|
||||
colorFilterShader = shaderDir .. "/" .. file
|
||||
end
|
||||
end
|
||||
|
||||
hl.config({
|
||||
general = {
|
||||
gaps_in = prefs.get("gapsIn", 5),
|
||||
@@ -145,6 +192,11 @@ hl.config({
|
||||
|
||||
-- Off: costs real frame time and reads as smeary on a 60Hz panel.
|
||||
motion_blur = { enabled = false },
|
||||
|
||||
-- The accessibility color filter, resolved above. Empty when off, and
|
||||
-- empty costs nothing: Hyprland skips the pass entirely rather than
|
||||
-- running an identity shader.
|
||||
screen_shader = colorFilterShader,
|
||||
},
|
||||
|
||||
animations = { enabled = prefs.get("animationsEnabled", true) },
|
||||
|
||||
Reference in New Issue
Block a user