]> git.rmz.io Git - dotfiles.git/commitdiff
added conky HUD
authorSamir Benmendil <samir.benmendil@gmail.com>
Sat, 15 Jun 2013 02:26:06 +0000 (04:26 +0200)
committerSamir Benmendil <samir.benmendil@gmail.com>
Sat, 15 Jun 2013 02:26:06 +0000 (04:26 +0200)
awesome/conky.lua [new file with mode: 0644]
awesome/rc.lua

diff --git a/awesome/conky.lua b/awesome/conky.lua
new file mode 100644 (file)
index 0000000..6a3fb16
--- /dev/null
@@ -0,0 +1,56 @@
+-- http://awesome.naquadah.org/wiki/Conky_HUD
+local utils = require("utils")
+
+function get_conky()
+    local clients = client.get()
+    local conky = nil
+    local i = 1
+    while clients[i]
+    do
+        if clients[i].class == "Conky"
+        then
+            conky = clients[i]
+        end
+        i = i + 1
+    end
+    return conky
+end
+function raise_conky()
+    local conky = get_conky()
+    if conky
+    then
+        conky.ontop = true
+    end
+end
+function lower_conky()
+    local conky = get_conky()
+    if conky
+    then
+        conky.ontop = false
+    end
+end
+function toggle_conky()
+    local conky = get_conky()
+    if conky
+    then
+        if conky.ontop
+        then
+            conky.ontop = false
+        else
+            conky.ontop = true
+        end
+    end
+end
+
+utils.rules.append({
+    { rule = { class = "Conky" },
+               properties = { floating = true,
+                              sticky = true,
+                              ontop = false,
+                              focusable = true,
+                              size_hints = {"program_position", "program_size"} 
+                             } },
+})
+
+-- add global key
+utils.globalkeys.append(awful.key({}, "F4", function () raise_conky() end, function () lower_conky() end))
index 5289b90a8793511306df3f5210f679615bf5a0cc..7dd4696ea5fd38d64d82253261a6bb3be9c178c9 100644 (file)
@@ -76,6 +76,9 @@ require("bindings")
 -- Rules
 require("rules")
 
+-- conky
+require("conky")
+
 -- {{{ Signals
 -- Signal function to execute when a new client appears.
 client.connect_signal("manage", function (c, startup)