mpv: Update gui interface
This commit is contained in:
parent
8a0fd53647
commit
01ca98aa4b
29 changed files with 6886 additions and 3569 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue