Add calendar to main config

This commit is contained in:
crater2150 2014-05-16 18:17:10 +02:00
parent 4ad1842bff
commit 2253e0f835
4 changed files with 25 additions and 6 deletions

View file

@ -6,6 +6,7 @@ local scratch = require("scratch")
local modkey = conf.modkey or "Mod4"
local mb = require("modalbind")
local calendar = calendar
local bindings = {modalbind = mb}
@ -48,6 +49,12 @@ docmap = {
b = { func = spawnf("docopen ~/books pdf epub mobi txt lit html htm"), desc = "Bücher" }
}
calendarmap = {
i = { func = function() calendar:next() end, desc = "Next" },
o = { func = function() calendar:prev() end, desc = "Prev" }
}
adapters = { u = "wwan", w = "wlan", b = "bluetooth" }
local function rfkill(cmd)
map = {}
@ -120,7 +127,16 @@ function bindings.extend_key_table(globalkeys)
awful.key({ }, "XF86Sleep", spawnf("s2ram")),
awful.key({ }, "XF86Away", spawnf("xlock")),
awful.key({ }, "XF86TouchpadToggle", spawnf("touchpad"))
awful.key({ }, "XF86TouchpadToggle", spawnf("touchpad")),
--}}}
-- calendar {{{
awful.key({ modkey }, "y", function() calendar:toggle() end),
awful.key({ modkey, "Shift" }, "y", function()
calendar.wibox.visible = true
mb.grab(calendarmap, "Calendar", true)
end)
)
--}}}
@ -146,7 +162,7 @@ clientkeys = awful.util.table.join(
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
awful.key({ modkey, "Control" }, "o", function (c) c.ontop = not c.ontop end),
awful.key({ modkey, }, "a", function (c) c.sticky = not c.sticky end),
awful.key({ modkey, "Shift" }, "a", function (c) c.sticky = not c.sticky end),
awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end),
awful.key({ modkey, }, "Up", function(c) client_opacity_set(c, 1, 1, 0.1) end),

View file

@ -187,7 +187,7 @@ function grab(keymap, name, stay_in_mode)
keymap[key]()
end
if stay_in_mode then
grab(keymap, true)
grab(keymap, name, true)
else
nesting = nesting - 1
if nesting < 1 then hide_box() end

4
rc.lua
View file

@ -59,6 +59,8 @@ for s = 1, screen.count() do
end
-- }}}
calendar = require("calendar")
-- {{{ Key bindings
globalkeys = {}
globalkeys = layouts.extend_key_table(globalkeys);
@ -78,5 +80,7 @@ rules.setup()
require("signals")
--cal:calculate_size()
--
-- vim: fdm=marker
--

View file

@ -91,7 +91,6 @@ function tags.extend_key_table(globalkeys)
keynumber = math.min(22, math.max(#(list[s]), keynumber));
end
local inspect = require("inspect")
local tagkeys = globalkeys or {}
-- Bind all key numbers to tags, using keycodes