From f9d4e198882f250dec6faec4e4aba9032bccbfef Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Fri, 19 Sep 2025 18:14:36 +0200 Subject: [PATCH] TOOLS/lua/gamma-auto: update on timer when on Linux The Linux implementation of ambient-light is not observable. --- TOOLS/lua/gamma-auto.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/TOOLS/lua/gamma-auto.lua b/TOOLS/lua/gamma-auto.lua index 14c265c487..c71c8b01ac 100644 --- a/TOOLS/lua/gamma-auto.lua +++ b/TOOLS/lua/gamma-auto.lua @@ -19,4 +19,11 @@ local function lux_changed(_, lux) mp.set_property_number("gamma-factor", gamma) end -mp.observe_property("ambient-light", "number", lux_changed) +if mp.get_property("platform") == "linux" then + -- observing ambient-light isn't supported on Linux + mp.add_periodic_timer(1, function() + lux_changed(nil, mp.get_property_number("ambient-light")) + end) +else + mp.observe_property("ambient-light", "number", lux_changed) +end