]> git.rmz.io Git - dotfiles.git/blob - awesome/conky.lua
Merge branch 'master' of tardis:/dotfiles
[dotfiles.git] / awesome / conky.lua
1 -- http://awesome.naquadah.org/wiki/Conky_HUD
2 local utils = require("utils")
3
4 local function get_conky()
5 local clients = client.get()
6 local conky = nil
7 local i = 1
8 while clients[i]
9 do
10 if clients[i].class == "Conky"
11 then
12 conky = clients[i]
13 end
14 i = i + 1
15 end
16 return conky
17 end
18
19 local function raise_conky()
20 local conky = get_conky()
21 if conky
22 then
23 conky.ontop = true
24 conky.hidden = false
25 end
26 end
27
28 local function lower_conky()
29 local conky = get_conky()
30 if conky
31 then
32 conky.ontop = false
33 conky.hidden = true
34 end
35 end
36
37 local function toggle_conky()
38 local conky = get_conky()
39 if conky
40 then
41 if conky.ontop
42 then
43 conky.ontop = false
44 else
45 conky.ontop = true
46 end
47 end
48 end
49
50 utils.rules.append({
51 { rule = { class = "Conky" },
52 properties = { floating = true,
53 sticky = true,
54 ontop = false,
55 hidden = true,
56 focusable = true,
57 size_hints = {"program_position", "program_size"}
58 } },
59 })
60
61 -- add global key
62 utils.globalkeys.append(awful.key({}, "F4", function () raise_conky() end, function () lower_conky() end))
63
64 utils.run_once("conky")