local mp = require("mp") local utils = require("mp.utils") local function run(...) utils.subprocess_detached({ args = { "sh", "-c", table.concat({ ... }, " ") .. " >/dev/null 2>&1" }, max_size = 0, cancellable = false, }) end mp.register_event("file-loaded", function() local function cb(n, vo) -- mp.msg.warn(n, vo) if vo == true then run("makoctl", "mode", "-a", "off") run("svdn", "wlsunset") mp.unobserve_property(cb) end end mp.observe_property("vo-configured", "bool", cb) end) mp.register_event("shutdown", function() run("makoctl", "mode", "-r", "off") run("svup", "wlsunset") end)