vo_battery.lua implementation for Linux
June 27, 2015 · View on GitHub
-- If the laptop is on battery, the VO set in the config will be choosen, -- else the one defined with „hqvo“ is used. local hqvo = "opengl-hq:interpolation" local utils = require 'mp.utils' if mp.get_property_bool("option-info/vo/set-from-commandline") == true then return end t = {} t.args = {"/bin/cat", "/sys/class/power_supply/AC/online"} res = utils.subprocess(t) if res.stdout ~= "0\n" then mp.msg.info("On AC, setting high-quality options.") mp.set_property("options/vo", hqvo) end