mpv: Update gui interface

This commit is contained in:
Marty Oehme 2023-05-23 15:31:17 +02:00
parent 8a0fd53647
commit 01ca98aa4b
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
29 changed files with 6886 additions and 3569 deletions

View file

@ -1,5 +1,8 @@
-- If the laptop is on battery, the profile 'lq' will be loaded; otherwise 'hq' is used
--
local mp = require 'mp'
local SHOULD_ADJUST = false
local lqprofile = "lowquality"
local hqprofile = "highquality"
@ -12,15 +15,19 @@ local function powerstate()
end
local function adjust()
if not SHOULD_ADJUST then return end
local state = powerstate()
-- this actually overrides automatically applied profiles
-- like 'protocol.http'
if state == 0 then
mp.msg.info("Running on battery, setting low-quality options.")
mp.set_property("profile", lqprofile)
mp.msg.info("[quality] running battery, setting low-quality options.")
mp.osd_message("[quality] LQ")
else
mp.msg.info("Not running on battery, setting high-quality options.")
mp.set_property("profile", hqprofile)
mp.msg.info("[quality] running ac, setting high-quality options.")
mp.osd_message("[quality] HQ")
end
end
mp.add_hook("on_load", 1, adjust)