[mpv] Fix battery script on desktop PC

Fixed requiring a battery or receiving an error. Script will simply set
high quality mode on desktop.
This commit is contained in:
Marty Oehme 2020-05-13 18:22:01 +02:00
parent d4257a4fce
commit 86e29b2763
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A

View file

@ -4,7 +4,10 @@ local lqprofile = "lowquality"
local hqprofile = "highquality" local hqprofile = "highquality"
local function powerstate() local function powerstate()
local f = assert(io.open("/sys/class/power_supply/AC/online")) local f =io.open("/sys/class/power_supply/AC/online")
if f == nil then
return
end
local t = f:read("*n") local t = f:read("*n")
f:close() f:close()
return t return t