summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.config/awesome/rc.lua28
1 files changed, 24 insertions, 4 deletions
diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua
index 645b1f7..1ba9689 100644
--- a/.config/awesome/rc.lua
+++ b/.config/awesome/rc.lua
@@ -12,6 +12,25 @@ local menubar = require("menubar")
awful.rules = require("awful.rules")
require("awful.autofocus")
+function ror(program, cls)
+ local rorfunc = function ()
+ local matcher = function (c)
+ return awful.rules.match(c, { class = cls })
+ end
+
+ awful.client.run_or_raise(program, matcher)
+ end
+
+ return rorfunc
+end
+
+function ror_combo(mod, key, program, class)
+ return awful.util.table.join(
+ awful.key(mod, key, ror(program, class)),
+ awful.key(awful.util.table.join(mod, { "Shift" }), key,
+ function () awful.util.spawn(program) end))
+end
+
----- Error handling
-- Check if awesome encountered an error during startup and fell back
-- to another config (This code will only ever execute for the
@@ -171,7 +190,6 @@ globalkeys = awful.util.table.join(
awful.client.focus.byidx(-1)
if client.focus then client.focus:raise() end
end),
- awful.key({ modkey, }, "w", function () mymainmenu:show() end),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "n",
@@ -227,9 +245,11 @@ globalkeys = awful.util.table.join(
mypromptbox[mouse.screen].widget,
awful.util.eval, nil,
awful.util.getdir("cache") .. "/history_eval")
- end))
- -- Menubar
- -- awful.key({ modkey }, "p", function() menubar.show() end))
+ end),
+
+ ror_combo({ modkey }, "e", 'emacsclient -ca emacs', 'Emacs'),
+ ror_combo({ modkey }, "c", 'urxvt', 'URxvt'),
+ ror_combo({ modkey }, "w", 'conkeror', 'Conkeror'))
clientkeys = awful.util.table.join(
awful.key({ modkey, }, "f",