Skip to content

Instantly share code, notes, and snippets.

@LemonBoy
Created April 25, 2016 11:00
Show Gist options
  • Save LemonBoy/c8f966b74433feb23d3e5d3edee5248d to your computer and use it in GitHub Desktop.
Save LemonBoy/c8f966b74433feb23d3e5d3edee5248d to your computer and use it in GitHub Desktop.
local utils = require("mp.utils")
function enableDpms(v)
if v then
arg = '+dpms'
else
arg = '-dpms'
end
utils.subprocess({ args = { 'xset', arg } })
end
-- Disable the screen blanking when playing a film
mp.observe_property("pause", "bool", function(k, v) enableDpms(v) end)
mp.register_event("shutdown", function(ev) enableDpms(true) end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment