Added DPMS info
This commit is contained in:
parent
d97611ed7a
commit
d645f74785
24
.config/awesome/dpmsstatus.lua
Normal file
24
.config/awesome/dpmsstatus.lua
Normal 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 })
|
|
@ -259,6 +259,8 @@ awful.screen.connect_for_each_screen(function(s)
|
||||||
spacer,
|
spacer,
|
||||||
volume,
|
volume,
|
||||||
spacer,
|
spacer,
|
||||||
|
mydpmsstatus,
|
||||||
|
spacer,
|
||||||
mycpu,
|
mycpu,
|
||||||
spacer,
|
spacer,
|
||||||
mymem,
|
mymem,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
local gputemp = require("gputemp")
|
local gputemp = require("gputemp")
|
||||||
|
local dpmsstatus = require("dpmsstatus")
|
||||||
local lain = require("lain")
|
local lain = require("lain")
|
||||||
local vicious = require("vicious") -- Custom
|
local vicious = require("vicious") -- Custom
|
||||||
local beautiful = require("beautiful") -- CPU temp
|
local beautiful = require("beautiful") -- CPU temp
|
||||||
|
@ -79,9 +80,20 @@ mycputemp = lain.widget.temp({
|
||||||
myweather = lain.widget.weather({
|
myweather = lain.widget.weather({
|
||||||
city_id = 634963,
|
city_id = 634963,
|
||||||
lang = "fi",
|
lang = "fi",
|
||||||
|
followtag = true,
|
||||||
settings = function()
|
settings = function()
|
||||||
widget.markup = create_markup("Tampere", weather_now.main.temp, "℃", valuecolor)
|
widget.markup = create_markup("Tampere", weather_now.main.temp, "℃", valuecolor)
|
||||||
end
|
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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user