2016-04-04 12:54:30 +00:00
|
|
|
-- key bindings
|
|
|
|
local awful = require("awful")
|
|
|
|
local conf = conf
|
|
|
|
|
|
|
|
local modkey = conf.modkey or "Mod4"
|
|
|
|
local binder = binder or require("separable.binder")
|
|
|
|
local mb = binder.modal
|
|
|
|
|
|
|
|
local mpd = require("separable.mpd")
|
2017-09-14 12:43:12 +00:00
|
|
|
local handy = require("handy")
|
2017-01-10 16:45:32 +00:00
|
|
|
--local calendar = require("separable.calendar")
|
2016-04-04 12:54:30 +00:00
|
|
|
|
|
|
|
local myglobalkeys = {}
|
|
|
|
|
|
|
|
local function mpdserver(host)
|
|
|
|
return function()
|
|
|
|
mpd.set_server(host, "6600")
|
|
|
|
awful.util.spawn("mpd-host set " .. host .. " 6600")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
local mpdhosts = {
|
2017-09-13 13:52:49 +00:00
|
|
|
{"n", mpdserver("nas"), "NAS" },
|
|
|
|
{"b", mpdserver("berryhorst"), "Berry" },
|
|
|
|
{"l", mpdserver("127.0.0.1"), "Local" }
|
2016-04-04 12:54:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
local mpdmap = {
|
2017-09-13 13:52:49 +00:00
|
|
|
{"m", mpd.ctrl.toggle, "Toggle" },
|
|
|
|
{"n", mpd.ctrl.next, "Next" },
|
|
|
|
{"N", mpd.ctrl.prev, "Prev" },
|
|
|
|
{"s", binder.spawn("mpd"), "start MPD" },
|
|
|
|
{"S", binder.spawn("mpd --kill"), "kill MPD" },
|
|
|
|
{"g", binder.spawn(conf.cmd.mpd_client), "Gmpc" },
|
2018-05-04 13:19:55 +00:00
|
|
|
{"separator", "Search" },
|
2017-09-13 13:52:49 +00:00
|
|
|
{"a", mpd.prompt.artist, "artist" },
|
|
|
|
{"b", mpd.prompt.album, "album" },
|
|
|
|
{"t", mpd.prompt.title, "title" },
|
2018-05-04 13:19:55 +00:00
|
|
|
{"j", mpd.prompt.jump, "jump" },
|
2017-09-13 13:52:49 +00:00
|
|
|
{"r", mpd.prompt.toggle_replace_on_search, "toggle replacing" },
|
|
|
|
{"h", mb.grabf(mpdhosts, "Select MPD host"), "Change host" }
|
2016-04-04 12:54:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
local progmap = {
|
2017-09-13 13:52:49 +00:00
|
|
|
{"f", binder.spawn(conf.cmd.browser), "Browser" },
|
2018-01-15 14:07:17 +00:00
|
|
|
{"i", binder.spawn(conf.cmd.irc_client), "IRC" },
|
|
|
|
{"t", binder.spawn("telegram"), "Telegram" },
|
|
|
|
{"w", binder.spawn("wire"), "Wire" },
|
2017-09-13 13:52:49 +00:00
|
|
|
{"m", binder.spawn(conf.cmd.mail_client), "Mail" },
|
|
|
|
{"s", binder.spawn("steam"), "Steam" }
|
2016-04-04 12:54:30 +00:00
|
|
|
}
|
|
|
|
|
2017-11-20 09:03:14 +00:00
|
|
|
local home = os.getenv("HOME")
|
2016-04-04 12:54:30 +00:00
|
|
|
local docmap = {
|
2017-11-20 09:03:14 +00:00
|
|
|
{"p", binder.spawn("docopen " .. home .. "/ pdf"), "Alle PDF-Dokumente" },
|
|
|
|
{"b", binder.spawn("docopen " .. home .. "/doc/books pdf epub mobi txt lit html htm"), "Bücher" },
|
2017-09-13 13:52:49 +00:00
|
|
|
{"t", binder.spawn("dmtexdoc"), "Texdoc" },
|
|
|
|
{"j", binder.spawn("dmjavadoc"), "Javadoc" }
|
2016-07-25 13:07:53 +00:00
|
|
|
}
|
|
|
|
|
2018-02-28 09:02:38 +00:00
|
|
|
local notifymap = {
|
|
|
|
{"m", binder.spawn("newmails -p"), "Show unread mails" },
|
|
|
|
}
|
|
|
|
|
2017-01-10 16:45:32 +00:00
|
|
|
--local calendarmap = {
|
2017-09-13 13:52:49 +00:00
|
|
|
-- o = { function() calendar:next() end, "Next" },
|
|
|
|
-- i = { function() calendar:prev() end, "Prev" },
|
2017-01-10 16:45:32 +00:00
|
|
|
-- onClose = function() calendar:hide() end
|
|
|
|
--}
|
2016-04-04 12:54:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
local myglobalkeys = awful.util.table.join(
|
2018-06-15 23:06:23 +00:00
|
|
|
awful.key({ }, "Pause", binder.spawn('rofi -show window')),
|
2016-07-25 13:07:53 +00:00
|
|
|
awful.key({ }, "Print", binder.spawn('dmscrot')),
|
2016-04-04 12:54:30 +00:00
|
|
|
|
|
|
|
--{{{ Modal mappings
|
|
|
|
|
|
|
|
awful.key({ modkey }, "m", mb.grabf(mpdmap, "MPD", true)),
|
2018-05-04 13:19:55 +00:00
|
|
|
--awful.key({ modkey, "Shift" }, "m", mb.grabf(mpdpromts, "MPD - Search for")),
|
2016-04-04 12:54:30 +00:00
|
|
|
awful.key({ modkey }, "c", mb.grabf(progmap, "Commands")),
|
|
|
|
awful.key({ modkey }, "d", mb.grabf(docmap, "Documents")),
|
2018-02-28 09:02:38 +00:00
|
|
|
awful.key({ modkey }, "n", mb.grabf(notifymap, "Notifications")),
|
2016-04-04 12:54:30 +00:00
|
|
|
--}}}
|
|
|
|
|
2017-09-14 12:43:12 +00:00
|
|
|
-- {{{ handy console
|
2016-04-04 12:54:30 +00:00
|
|
|
awful.key({ }, "F12", function ()
|
2018-03-19 09:20:52 +00:00
|
|
|
handy("urxvt -e tmux", awful.placement.centered, 0.9, 0.7)
|
2016-04-04 12:54:30 +00:00
|
|
|
end ),
|
|
|
|
-- }}}
|
|
|
|
|
|
|
|
--{{{ dmenu prompts
|
|
|
|
|
|
|
|
awful.key({ modkey }, "s", binder.spawn("dmsearch")),
|
|
|
|
awful.key({ modkey }, "x", binder.spawn("dmxrandr")),
|
2016-04-07 09:19:21 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "x", binder.spawn("xd --dmenu")),
|
2017-11-20 09:03:14 +00:00
|
|
|
awful.key({ modkey }, "z", binder.spawn("dmumount")),
|
2016-04-04 12:54:30 +00:00
|
|
|
|
|
|
|
--}}}
|
|
|
|
|
|
|
|
--{{{ misc. XF86 Keys
|
|
|
|
|
2016-11-17 13:19:31 +00:00
|
|
|
awful.key({ }, "Scroll_Lock", binder.spawn("xlock")),
|
|
|
|
awful.key({ modkey }, "BackSpace", binder.spawn("xlock")),
|
|
|
|
awful.key({ modkey, "Shift" }, "BackSpace", binder.spawn("feierabend")),
|
|
|
|
|
2016-04-04 12:54:30 +00:00
|
|
|
awful.key({ }, "XF86Explorer", binder.spawn("touchpad")),
|
|
|
|
awful.key({ "Shift" }, "XF86Explorer", binder.spawn("wacomtouch")),
|
|
|
|
|
|
|
|
awful.key({ }, "XF86AudioPlay", mpd.ctrl.toggle),
|
|
|
|
awful.key({ }, "XF86AudioNext", mpd.ctrl.next),
|
2018-02-28 09:02:38 +00:00
|
|
|
awful.key({ }, "XF86AudioPrev", mpd.ctrl.prev),
|
2016-04-04 12:54:30 +00:00
|
|
|
|
2018-02-28 09:02:38 +00:00
|
|
|
awful.key({ modkey }, "y", binder.spawn("copyq toggle"))
|
2016-04-04 12:54:30 +00:00
|
|
|
|
|
|
|
--}}}
|
|
|
|
)
|
|
|
|
|
|
|
|
return myglobalkeys
|
|
|
|
|
|
|
|
-- vim: set fenc=utf-8 tw=80 foldmethod=marker :
|