]> git.rmz.io Git - dotfiles.git/blob - awesome/conky.lua
nvim: replace telescope with snacks.picker
[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] do
9 if clients[i].class == "Conky" then
10 conky = clients[i]
11 end
12 i = i + 1
13 end
14 return conky
15 end
16
17 local function raise_conky()
18 local conky = get_conky()
19 if conky then
20 conky.ontop = true
21 conky.hidden = false
22 end
23 end
24
25 local function lower_conky()
26 local conky = get_conky()
27 if conky then
28 conky.ontop = false
29 conky.hidden = true
30 end
31 end
32
33 local function toggle_conky()
34 local conky = get_conky()
35 if conky then
36 if conky.ontop then
37 conky.ontop = false
38 else
39 conky.ontop = true
40 end
41 end
42 end
43
44 utils.rules.append({
45 { rule = { class = "Conky" },
46 properties = { floating = true,
47 sticky = true,
48 ontop = false,
49 hidden = true,
50 focusable = true,
51 size_hints = {"program_position", "program_size"} } },
52 })
53
54 -- add global key
55 utils.globalkeys.append(awful.key({}, "F4", function () raise_conky() end, function () lower_conky() end))
56
57 utils.run_once("conky")