[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:
parent
d4257a4fce
commit
86e29b2763
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue