From ba9c4565ffa44d69e8f8f5dfbd492b48a071c1f7 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 1 Mar 2009 12:47:45 +0100 Subject: [PATCH 1/1] new keybinding syntax --- .config/awesome/rc.lua | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index ddd3a27..64740b2 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -358,6 +358,31 @@ for i = 1, keynumber do end)) end +cmdmodkey = "Mod3" + +-- xmms2 & sound +table.insert(globalkeys, key({ cmdmodkey }, "Prior", function () awful.util.spawn("amixer set Master 2+") end)) +table.insert(globalkeys, key({ cmdmodkey }, "Next", function () awful.util.spawn("amixer set Master 2-") end)) +table.insert(globalkeys, key({ cmdmodkey }, "Up", function () awful.util.spawn("amixer set PCM 2+") end)) +table.insert(globalkeys, key({ cmdmodkey }, "Down", function () awful.util.spawn("amixer set PCM 2-") end)) +table.insert(globalkeys, key({ cmdmodkey }, "Home", function () awful.util.spawn("amixer set Mic toggle") end)) +table.insert(globalkeys, key({ cmdmodkey }, "End", function () awful.util.spawn("amixer set Master toggle") end)) +table.insert(globalkeys, key({ cmdmodkey }, "Left", function () awful.util.spawn("xmms2 prev") end)) +table.insert(globalkeys, key({ cmdmodkey }, "Right", function () awful.util.spawn("xmms2 next") end)) +table.insert(globalkeys, key({ cmdmodkey }, "space", function () awful.util.spawn("xmms2 toggleplay") end)) +table.insert(globalkeys, key({ cmdmodkey }, "backslash", function () awful.util.spawn("xmms2 current | head -1 | xmessage -nearmouse -timeout 5 -file -") end)) +table.insert(globalkeys, key({ cmdmodkey, "Shift" }, "backslash", function () awful.util.spawn("xmms2 list | xmessage -nearmouse -timeout 5 -file -") end)) + +-- misc apps +table.insert(globalkeys, key({ cmdmodkey }, "n", function () awful.util.spawn("sensible-browser") end)) +table.insert(globalkeys, key({ cmdmodkey }, "m", function () awful.util.spawn(terminal .. " -e mutt -f =store") end)) +table.insert(globalkeys, key({ cmdmodkey }, "t", function () awful.util.spawn(terminal) end)) +table.insert(globalkeys, key({ cmdmodkey }, "c", function () awful.util.spawn(terminal .. " -e python") end)) +table.insert(globalkeys, key({ cmdmodkey }, "r", function () awful.util.spawn("gmrun") end)) +table.insert(globalkeys, key({ cmdmodkey }, "j", function () awful.util.spawn("jpilot") end)) +table.insert(globalkeys, key({ cmdmodkey }, "x", function () awful.util.spawn("/sbin/start-stop-daemon --start --background --exec /usr/bin/xscreensaver; xscreensaver-command -lock") end)) +table.insert(globalkeys, key({ cmdmodkey, "Shift" }, "x", function () awful.util.spawn("xscreensaver-command -exit") end)) + -- Set keys root.keys(globalkeys) -- }}} @@ -574,31 +599,6 @@ awful.hooks.timer.register(120, hook_battery) -- awful.hooks.timer.register(5, get_bat) -- }}} -cmdmodkey = "Mod3" - --- xmms2 & sound -keybinding({ cmdmodkey }, "Prior", function () awful.util.spawn("amixer set Master 2+") end):add() -keybinding({ cmdmodkey }, "Next", function () awful.util.spawn("amixer set Master 2-") end):add() -keybinding({ cmdmodkey }, "Up", function () awful.util.spawn("amixer set PCM 2+") end):add() -keybinding({ cmdmodkey }, "Down", function () awful.util.spawn("amixer set PCM 2-") end):add() -keybinding({ cmdmodkey }, "Home", function () awful.util.spawn("amixer set Mic toggle") end):add() -keybinding({ cmdmodkey }, "End", function () awful.util.spawn("amixer set Master toggle") end):add() -keybinding({ cmdmodkey }, "Left", function () awful.util.spawn("xmms2 prev") end):add() -keybinding({ cmdmodkey }, "Right", function () awful.util.spawn("xmms2 next") end):add() -keybinding({ cmdmodkey }, "space", function () awful.util.spawn("xmms2 toggleplay") end):add() -keybinding({ cmdmodkey }, "backslash", function () awful.util.spawn("xmms2 current | head -1 | xmessage -nearmouse -timeout 5 -file -") end):add() -keybinding({ cmdmodkey, "Shift" }, "backslash", function () awful.util.spawn("xmms2 list | xmessage -nearmouse -timeout 5 -file -") end):add() - --- misc apps -keybinding({ cmdmodkey }, "n", function () awful.util.spawn("sensible-browser") end):add() -keybinding({ cmdmodkey }, "m", function () awful.util.spawn(terminal .. " -e mutt -f =store") end):add() -keybinding({ cmdmodkey }, "t", function () awful.util.spawn(terminal) end):add() -keybinding({ cmdmodkey }, "c", function () awful.util.spawn(terminal .. " -e python") end):add() -keybinding({ cmdmodkey }, "r", function () awful.util.spawn("gmrun") end):add() -keybinding({ cmdmodkey }, "j", function () awful.util.spawn("jpilot") end):add() -keybinding({ cmdmodkey }, "x", function () awful.util.spawn("/sbin/start-stop-daemon --start --background --exec /usr/bin/xscreensaver; xscreensaver-command -lock") end):add() -keybinding({ cmdmodkey, "Shift" }, "x", function () awful.util.spawn("xscreensaver-command -exit") end):add() - -- Highlight statusbars on the screen that has focus, -- set this to false if you only have one screen or -- you don't like it :P -- 2.39.5