X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/c2fb4b601269388d7846814b1299e3272f799d7b..8406a181daaacb36b92835dde4773061836d1354:/.config/awesome/rc.lua diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index ddd3a27..c7cd405 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -300,6 +300,9 @@ clientkeys = key({ modkey }, "t", awful.client.togglemarked), key({ modkey,}, "m", function (c) + if not awful.client.floating then + awful.client.floating.toggle() + end c.maximized_horizontal = not c.maximized_horizontal c.maximized_vertical = not c.maximized_vertical end), @@ -358,6 +361,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) -- }}} @@ -460,7 +488,8 @@ awful.hooks.manage.register(function (c, startup) -- Maximise some if maxapps[inst] or maxapps[cls] then - awful.client.maximize(c) + c.maximized_horizontal = not c.maximized_horizontal + c.maximized_vertical = not c.maximized_vertical end end) @@ -530,7 +559,7 @@ function get_acpibatt() -- Battery 0: Full, 100% -- so find the first bit first and then go look for the time local st, en, status, percent = string.find(s, '%a+%s%d:%s(%a+),%s(%d+%%)'); - local st, en, time = string.find(s, ',%s(%d+:%d+:%d+)%s%a+', en); + local st, en, time = string.find(s, ',%s(%d+:%d+):%d+%s%a+', en); if not status or not percent then -- time can be empty if we're full return "couldn't parse line " .. s @@ -541,14 +570,15 @@ function get_acpibatt() end if status == 'Charging' then - status = 'c'; - elseif status == 'Discarching' then - status = 'd'; - else + status = '+'; + elseif status == 'Discharging' then status = '-'; + else + status = 'x'; end - return percent; -- .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left'; + return status .. ' ' .. time; + -- return percent .. ' (' .. status .. ')'; -- .. ' ' .. time .. ' left'; end -- }}} @@ -574,31 +604,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