Disable DPMS

DPMS  is a standard from the VESA consortium for managing the power supply of video monitors for computers through the graphics card. Example usage includes shutting off the monitor after a period of idle time to save power.

Often, when you are seeing film in player or flash-video, your display is power off. This is very annoying. That article, help you solve it problem.

Here is used only rules Awesome and external utility xset.

When client send signal about it fullscreened, we are calling function that will breaking energy saving. After close the application or disable fullscreen mode, energy saving mode switched on again.

local fullscreened_clients = {}

local function remove_client(tabl, c)   local index = awful.util.table.hasitem(tabl, c)    if index then table.remove(tabl, index) if #tabl == 0 then awful.util.spawn("xset s on") awful.util.spawn("xset +dpms") end end end

client.connect_signal("property::fullscreen",   function(c)        if c.fullscreen then            table.insert(fullscreened_clients, c)            if #fullscreened_clients == 1 then                awful.util.spawn("xset s off")                awful.util.spawn("xset -dpms")            end        else            remove_client(fullscreened_clients, c)        end    end) client.connect_signal("unmanage",   function(c)        if c.fullscreen then            remove_client(fullscreened_clients, c)        end    end) If you are using Awesome 3.4, replace connect_signal to 'add_signal''. THe authors of the code are NeverLoved and Worron

A functional way which works
description : it handle automaticly screensaver when you set a window in fullscreen

Inside your rc.lua directly. local function dpms(c) if c then awful.util.spawn_with_shell("xset s off && xset -dpms &") else awful.util.spawn_with_shell("xset s on && xset +dpms &") end end

-- at line 260 of rc.lua clientkeys = awful.util.table.join(   awful.key({ modkey,           }, "f", function (c) c.fullscreen = not c.fullscreen dpms(c.fullscreen) end),   awful.key({ modkey, "Shift"   }, "c", function (c) if c.fullscreen then c.fullscreen = not c.fullscreen dpms(c.fullscreen) end c:kill end), ...

Plugins to handle DPMS with mouse in the systray
description : an icon in the systray clickable with the middle button of the mouse which handle screensaver (you need xset installed on your system)

put it inside you awesome directory as screensave.lua then,

inside your rc.lua add: require("screensave")

myscreensave = screensave then in the wibox which handle your taglist, tasklist, textclock, systray... add myscreensave, -- by [Awaxx] for the love and awesome community -- SET YOUR OWN ICONS!!!!!!!!!!!!!!!!!!!!! local setmetatable = setmetatable local os = os local io = io local image = image local awful = require("awful") local widget = widget local string = string

local icons_path = os.getenv("HOME") .. "/.config/awesome/themes/driftvm" local screensave = { enable   = icons_path .. "/icons/screensaver16.png", disable  = icons_path .. "/icons/screensaver_disable16.png" }

module("screensave")

local function screen_ctl local f = io.popen("xset q | tail -2") local data = f:read("*all") f:close local screen_info = string.match(data, "E.....d") -- meh, i know i suck at regex with lua :/ if not screen_info then awful.util.spawn_with_shell("xset s on && xset +dpms &", false) return screensave.enable else awful.util.spawn_with_shell("xset s off && xset -dpms &", false) return screensave.disable end end

function new local w = widget({ type = "imagebox" }) w.image = image(screensave.enable) w:buttons(awful.util.table.join( awful.button({ }, 2, function w.image = image(screen_ctl) end) -- mute -- amixer set Master unmute ))   return w end

setmetatable(_M, { __call = function(_, ...) return new(...) end })

By [Awaxx] you can contact me with irc:oftc/#awesome