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 modkey = conf.modkey or "Mod4"
local mb = require("modalbind") local mb = require("modalbind")
local calendar = calendar
local bindings = {modalbind = mb} local bindings = {modalbind = mb}
@ -48,7 +49,13 @@ docmap = {
b = { func = spawnf("docopen ~/books pdf epub mobi txt lit html htm"), desc = "Bücher" } b = { func = spawnf("docopen ~/books pdf epub mobi txt lit html htm"), desc = "Bücher" }
} }
adapters = { u = "wwan", w = "wlan", b = "bluetooth" } 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) local function rfkill(cmd)
map = {} map = {}
for key, adapter in pairs(adapters) do for key, adapter in pairs(adapters) do
@ -95,7 +102,7 @@ function bindings.extend_key_table(globalkeys)
awful.key({ }, "XF86AudioPrev", mpd.ctrl.prev), awful.key({ }, "XF86AudioPrev", mpd.ctrl.prev),
--}}} --}}}
-- {{{ teardrops -- {{{ teardrops
awful.key({ }, "F12", function () awful.key({ }, "F12", function ()
scratch.drop(conf.cmd.terminal,"center","center", 0.99, 0.7) scratch.drop(conf.cmd.terminal,"center","center", 0.99, 0.7)
@ -120,7 +127,16 @@ function bindings.extend_key_table(globalkeys)
awful.key({ }, "XF86Sleep", spawnf("s2ram")), awful.key({ }, "XF86Sleep", spawnf("s2ram")),
awful.key({ }, "XF86Away", spawnf("xlock")), 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, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen ), awful.key({ modkey, }, "o", awful.client.movetoscreen ),
awful.key({ modkey, "Control" }, "o", function (c) c.ontop = not c.ontop end), 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, "Shift" }, "r", function (c) c:redraw() end),
awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized 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), 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]() keymap[key]()
end end
if stay_in_mode then if stay_in_mode then
grab(keymap, true) grab(keymap, name, true)
else else
nesting = nesting - 1 nesting = nesting - 1
if nesting < 1 then hide_box() end if nesting < 1 then hide_box() end

4
rc.lua
View file

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

View file

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