Added DPMS info

This commit is contained in:
lanxu 2017-07-08 20:12:50 +03:00
parent d97611ed7a
commit d645f74785
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,24 @@
-- {{{ Grab environment
local setmetatable = setmetatable
-- }}}
local temp = {};
-- {{{ Date widget type
local function worker(format, warg)
local f = io.popen("xset q | grep 'DPMS is' | awk '/ / {print $3}'")
temp[0] = "";
for line in f:lines() do
temp[0] = temp[0] .. line
end
io.close(f)
return temp
end
-- }}}
return setmetatable(temp, { __call = function(_, ...) return worker(...) end })

View File

@ -259,6 +259,8 @@ awful.screen.connect_for_each_screen(function(s)
spacer,
volume,
spacer,
mydpmsstatus,
spacer,
mycpu,
spacer,
mymem,

View File

@ -1,4 +1,5 @@
local gputemp = require("gputemp")
local dpmsstatus = require("dpmsstatus")
local lain = require("lain")
local vicious = require("vicious") -- Custom
local beautiful = require("beautiful") -- CPU temp
@ -79,9 +80,20 @@ mycputemp = lain.widget.temp({
myweather = lain.widget.weather({
city_id = 634963,
lang = "fi",
followtag = true,
settings = function()
widget.markup = create_markup("Tampere", weather_now.main.temp, "", valuecolor)
end
});
-- DPMS
mydpmsstatus = wibox.widget.textbox()
vicious.register(mydpmsstatus, dpmsstatus, function(widget, args)
color = valuecolor
if args[0] == "Enabled" then
return create_markup("DPMS", "ON", "", color)
else
color = "red"
return create_markup("DPMS", "OFF", "", color)
end
end)