-
Notifications
You must be signed in to change notification settings - Fork 0
/
conky.lua
61 lines (48 loc) · 1.09 KB
/
conky.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
conky = {
widget = wibox.widget.textbox(),
}
local function spawn_here()
local c = getclient("instance", "conky")
if not c then
awful.spawn("conky")
elseif c.screen == mouse.screen then
c:kill()
return
else
--c:geometry({x = 0})
awful.client.movetoscreen(c, mouse.screen)
end
end
local function spawn_there()
local c = getclient("instance", "conky")
if not c then
awful.spawn("conky")
else
--c:geometry({x = 0})
if mouse.screen == 1 then
awful.client.movetoscreen(c, 2)
else
awful.client.movetoscreen(c, 1)
end
end
end
function conky.callback(c)
c:struts( { right = 200 } )
c:buttons(gears.table.join(
awful.button({ }, 4, function(c) awful.tag.viewnext(mouse.screen) end),
awful.button({ }, 5, function(c) awful.tag.viewprev(mouse.screen) end),
awful.button({ Win }, 2, function (c) c:kill() end)
))
end
-- Setup widget
local function init()
-- Binds
conky.widget:buttons(gears.table.join(
awful.button({ }, 1, spawn_here),
awful.button({ }, 3, spawn_there)))
conky.widget.text = " "
return conky.widget
end
init()
return conky
-- vim:ts=4:sw=4