Created
June 27, 2015 11:39
-
-
Save ekisu/04924e899648e84f2e18 to your computer and use it in GitHub Desktop.
vo_battery.lua implementation for Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment