X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/012e264a831b62fa5cb103c186540c87d587ab37..f9c9148c7b60f217f65afdb7364745a56e679d9a:/.config/awesome/rc.lua diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 26967cd..c727fa9 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -57,6 +57,7 @@ floatapps = ["twinkle"] = true, ["Add-ons"] = true, ["Play stream"] = true, + ["gscan2pdf"] = true, } -- Applications that should never float, assuming everything else floats @@ -246,13 +247,17 @@ globalkeys = awful.util.table.join( awful.key({ modkey, }, "Left", awful.tag.viewprev ), awful.key({ modkey, }, "Right", awful.tag.viewnext ), awful.key({ modkey, }, "Escape", awful.tag.history.restore), + awful.key({ modkey, "Shift" }, "Right", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Shift" }, "Left", function () awful.screen.focus(-1) end), + awful.key({ modkey, "Shift" }, "h", awful.tag.viewprev ), + awful.key({ modkey, "Shift" }, "l", awful.tag.viewnext ), - awful.key({ modkey, }, "j", + awful.key({ modkey, }, "k", function () awful.client.focus.byidx( 1) if client.focus then client.focus:raise() end end), - awful.key({ modkey, }, "k", + awful.key({ modkey, }, "j", function () awful.client.focus.byidx(-1) if client.focus then client.focus:raise() end @@ -260,10 +265,10 @@ globalkeys = awful.util.table.join( awful.key({ modkey, }, "w", function () mymainmenu:show(true) end), -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus( 1) end), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus(-1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus( 1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus(-1) end), awful.key({ modkey, }, "u", awful.client.urgent.jumpto), awful.key({ modkey, }, "Tab", function () @@ -376,8 +381,8 @@ globalkeys = awful.util.table.join(globalkeys, awful.key({ cmdmodkey }, "Left", function () awful.util.spawn("xmms2 prev") end), awful.key({ cmdmodkey }, "Right", function () awful.util.spawn("xmms2 next") end), awful.key({ cmdmodkey }, "space", function () awful.util.spawn("xmms2 toggleplay") end), - awful.key({ cmdmodkey }, "backslash", function () awful.util.spawn("xmms2 current | head -1 | xmessage -nearmouse -timeout 5 -file -") end), - awful.key({ cmdmodkey, "Shift" }, "backslash", function () awful.util.spawn("xmms2 list | xmessage -nearmouse -timeout 5 -file -") end) + awful.key({ cmdmodkey }, "backslash", function () awful.util.spawn_with_shell("xmms2 current | head -1 | xmessage -nearmouse -timeout 5 -file -") end), + awful.key({ cmdmodkey, "Shift" }, "backslash", function () awful.util.spawn_with_shell("xmms2 list | xmessage -nearmouse -timeout 5 -file -") end) ) -- misc apps @@ -386,10 +391,12 @@ globalkeys = awful.util.table.join(globalkeys, awful.key({ cmdmodkey }, "m", function () awful.util.spawn(terminal .. " -e mutt -f =store") end), awful.key({ cmdmodkey }, "t", function () awful.util.spawn(terminal) end), awful.key({ cmdmodkey }, "c", function () awful.util.spawn(terminal .. " -e python") end), - awful.key({ cmdmodkey }, "r", function () awful.util.spawn("gmrun") end), +-- awful.key({ cmdmodkey }, "r", function () awful.util.spawn("gmrun") end), + awful.key({ cmdmodkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ cmdmodkey }, "j", function () awful.util.spawn("jpilot") end), - awful.key({ cmdmodkey }, "x", function () awful.util.spawn("/sbin/start-stop-daemon --start --background --exec /usr/bin/xscreensaver; xscreensaver-command -lock") end), - awful.key({ cmdmodkey, "Shift" }, "x", function () awful.util.spawn("xscreensaver-command -exit") end) + awful.key({ cmdmodkey }, "x", function () awful.util.spawn_with_shell("/sbin/start-stop-daemon --start --background --exec /usr/bin/xscreensaver; xscreensaver-command -lock") end), + awful.key({ cmdmodkey, "Shift" }, "x", function () awful.util.spawn("xscreensaver-command -exit") end), + awful.key(nil, "XF86ScreenSaver", function () awful.util.spawn("xset dpms force off") end) ) -- Set keys @@ -599,71 +606,3 @@ else end hook_battery() - -function displayMonth(month,year,weekStart) - local t,wkSt=os.time{year=year, month=month+1, day=0},weekStart or 1 - local d=os.date("*t",t) - local mthDays,stDay=d.day,(d.wday-d.day-wkSt+1)%7 - - local lines = {} - - for x=0,6 do - lines[x+1] = os.date("%a ",os.time{year=2006,month=1,day=x+wkSt}) - end - lines[8] = " " - - local writeLine = 1 - while writeLine < (stDay + 1) do - lines[writeLine] = lines[writeLine] .. " " - writeLine = writeLine + 1 - end - - for x=1,mthDays do - if writeLine == 8 then - writeLine = 1 - end - if writeLine == 1 or x == 1 then - lines[8] = lines[8] .. os.date(" %V",os.time{year=year,month=month,day=x}) - end - if (#(tostring(x)) == 1) then - x = " " .. x - end - lines[writeLine] = lines[writeLine] .. " " .. x - writeLine = writeLine + 1 - end - local header = os.date("%B %Y\n",os.time{year=year,month=month,day=1}) - header = string.rep(" ", math.floor((#(lines[1]) - #header) / 2 )) .. header - - return header .. table.concat(lines, '\n') -end - -local calendar = {} -function switchNaughtyMonth(switchMonths) - if (#calendar < 3) then return end - local swMonths = switchMonths or 1 - calendar[1] = calendar[1] + swMonths - calendar[3].box.widgets[2].text = displayMonth(calendar[1], calendar[2], 2) -end - -mytimebox.mouse_enter = function () - local month, year = os.date('%m'), os.date('%Y') - calendar = { month, year, - naughty.notify({ - text = displayMonth(month, year, 2), - timeout = 0, hover_timeout = 0.5, - width = 200, screen = mouse.screen - }) - } -end -mytimebox.mouse_leave = function () naughty.destroy(calendar[3]) end - -mytimebox.buttons = awful.util.table.join( - awful.button({ }, 1, function() switchNaughtyMonth(-1) end), - awful.button({ }, 3, function() switchNaughtyMonth(1) end), - awful.button({ }, 4, function() switchNaughtyMonth(-1) end), - awful.button({ }, 5, function() switchNaughtyMonth(1) end), - awful.button({ 'Shift' }, 1, function() switchNaughtyMonth(-12) end), - awful.button({ 'Shift' }, 3, function() switchNaughtyMonth(12) end), - awful.button({ 'Shift' }, 4, function() switchNaughtyMonth(-12) end), - awful.button({ 'Shift' }, 5, function() switchNaughtyMonth(12) end) -)