Update various stuff

This commit is contained in:
Alexander Gehrke 2021-07-12 11:44:13 +02:00
parent 8d61745f9c
commit ae4c7f06c5
5 changed files with 39 additions and 41 deletions

2
handy

@ -1 +1 @@
Subproject commit 36de22a1f3a46b0a4f81083a056f1854ad0ab7af Subproject commit 6f6d7bfdb37c6dbcd9f97a5c2f4347b8c3b1a65d

View file

@ -23,17 +23,21 @@ conf.mpd = {
} }
-- default programs (for keybindings) -- default programs (for keybindings)
conf.cmd = {} conf.cmd = {
conf.cmd.terminal = "terminal" -- Mod-Enter terminal = "terminal" -- Mod-Enter
conf.cmd.terminal_exec = "terminal -e" -- used by some mappings -- used by some mappings, parameter to terminal for executing a specific program
conf.cmd.browser = "webbrowser" -- Mod-c f terminal_exec = "-e"
conf.cmd.im_client = "im-client" -- Mod-c i -- used by some mappings, parameter to terminal for setting the wm class
conf.cmd.irc_client = "irc-client" -- Mod-c I terminal_wmclass = "--class"
conf.cmd.mail_client = "mail-client" -- Mod-c m browser = "webbrowser" -- Mod-c f
conf.cmd.mpd_client = "gmpc" -- Mod-m g irc_client = "irc-client" -- Mod-c I
conf.cmd.editor = {} mail_client = "mail-client" -- Mod-c m
conf.cmd.editor.terminal = conf.cmd.terminal_exec .. " vim" mpd_client = "gmpc" -- Mod-m g
conf.cmd.editor.gui = "gvim" editor = {
terminal = conf.cmd.terminal_exec .. " vim"
gui = "gvim"
}
}
-- Mod-r binding for running programs -- Mod-r binding for running programs
conf.cmd.run = function() awful.util.spawn("dmenu_run -l 10 -y 350") end conf.cmd.run = function() awful.util.spawn("dmenu_run -l 10 -y 350") end

View file

@ -8,7 +8,7 @@ local modkey = conf.modkey or "Mod4"
local binder = binder or require("separable.binder") local binder = binder or require("separable.binder")
local mb = binder.modal local mb = binder.modal
local mpd = require("separable.mpd") local mpd = require("mpd")
local handy = require("handy") local handy = require("handy")
local myglobalkeys = {} local myglobalkeys = {}
@ -27,9 +27,11 @@ local function mpdserver(host)
end end
end end
local terminal_handy = conf.cmd.terminal .. " " .. conf.cmd.terminal_wmclass .. " handy "
local terminal_handy_exec = terminal_handy .. conf.cmd.terminal_exec .. " "
local mpdhosts = { local mpdhosts = {
{"n", mpdserver("nas"), "NAS" }, {"n", mpdserver("nashorn"), "NAS" },
{"b", mpdserver("berryhorst"), "Berry" },
{"l", mpdserver("127.0.0.1"), "Local" } {"l", mpdserver("127.0.0.1"), "Local" }
} }
@ -143,15 +145,10 @@ local myglobalkeys = awful.util.table.join(
--}}} --}}}
-- {{{ handy console -- {{{ handy console
awful.key({ }, "F12", nil, function () awful.key({ }, "F12", nil, handy.fun(terminal_handy, awful.placement.centered, 0.9, 0.7, nil, "handy")),
handy("alacritty --class handy -e tmux", awful.placement.centered, 0.9, 0.7, nil, "handy") awful.key({ modkey }, "y", handy.fun(terminal_handy_exec .. "ikhal", awful.placement.centered, 0.9, 0.7, 'single', "handy")),
end ), awful.key({ modkey }, "a", handy.fun("pavucontrol", awful.placement.centered, 0.6, 0.8, 'single')),
awful.key({ modkey }, "x", function () awful.key({ modkey }, "/", handy.fun("qalculate-gtk", awful.placement.centered, 0.4, 0.5, 'single')),
handy("alacritty --class handy -e ikhal", awful.placement.centered, 0.9, 0.7, 'single', "handy")
end ),
awful.key({ modkey }, "a", function ()
handy("pavucontrol", awful.placement.centered, 0.6, 0.8, 'single')
end ),
-- }}} -- }}}
--{{{ dmenu prompts --{{{ dmenu prompts
@ -178,8 +175,6 @@ local myglobalkeys = awful.util.table.join(
awful.key({ }, "XF86AudioNext", mpd.ctrl.next), awful.key({ }, "XF86AudioNext", mpd.ctrl.next),
awful.key({ }, "XF86AudioPrev", mpd.ctrl.prev), awful.key({ }, "XF86AudioPrev", mpd.ctrl.prev),
awful.key({ modkey }, "y", binder.spawn("copyq toggle")),
awful.key({ modkey }, "/", binder.spawn("rofi -show calc -modi calc -no-show-match -no-sort")),
awful.key({ modkey }, "e", binder.spawn('rofi -show emoji')), awful.key({ modkey }, "e", binder.spawn('rofi -show emoji')),
awful.key( {}, "Num_Lock", lockhl("Num")), awful.key( {}, "Num_Lock", lockhl("Num")),
awful.key( {}, "Caps_Lock", lockhl("Caps")) awful.key( {}, "Caps_Lock", lockhl("Caps"))

View file

@ -1,6 +1,6 @@
-- key bindings -- key bindings
local awful = require("awful") local awful = require("awful")
local beautiful = beautiful local beautiful = require("beautiful")
local modkey = conf.modkey or "Mod4" local modkey = conf.modkey or "Mod4"
local mb = require("modalbind") local mb = require("modalbind")
@ -102,19 +102,17 @@ function binder.clear()
globalkeyfuncs = {} globalkeyfuncs = {}
end end
function binder.apply() function binder.apply()
local allkeys = awful.util.table.clone(globalkeys) naughty.notify { text="Reloading key bindings" }
inspect=require("lib/inspect") local allkeys = awful.util.table.clone(globalkeys)
print(inspect(globalkeyfuncs)) for k,v in pairs(globalkeyfuncs) do
for k,v in pairs(globalkeyfuncs) do print("k:" .. k)
print("k:" .. k) local loadedkeys = v()
local loadedkeys = v() print(inspect(loadedkeys))
print(inspect(loadedkeys)) allkeys = awful.util.table.join(allkeys, loadedkeys)
allkeys = awful.util.table.join(allkeys, loadedkeys) end
end print(inspect(allkeys))
print(inspect(allkeys)) root.keys(allkeys)
root.keys(allkeys)
end end
local function client_opacity_set(c, default, max, step) local function client_opacity_set(c, default, max, step)
@ -147,8 +145,8 @@ awful.key({ }, "XF86Calculater", awful.client.movetoscreen
awful.key({ modkey }, "i", function(c) awful.key({ modkey }, "i", function(c)
require("naughty").notify({ text = require("naughty").notify({ text =
string.format( string.format(
"name: %s\nclass: %s\ninstance: %s\ntype: %s", "name: %s\nclass: %s\ninstance: %s\ntype: %s\npid: %d",
c["name"], c["class"], c["instance"], c["type"]) c["name"], c["class"], c["instance"], c["type"], c["pid"])
}) })
end) end)
) )
@ -190,6 +188,7 @@ local default_bindings = awful.util.table.join(
awful.key({ modkey, "Control" }, "r", awesome.restart), awful.key({ modkey, "Control" }, "r", awesome.restart),
awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, "Shift" }, "q", awesome.quit),
awful.key({ modkey, }, "Return", spawnf(conf.cmd.terminal)), awful.key({ modkey, }, "Return", spawnf(conf.cmd.terminal)),
awful.key({ modkey, "Shift" }, "Return", spawnf("kitty-session")),
--{{{ Layout manipulation and client position --{{{ Layout manipulation and client position
awful.key({ modkey }, "j", function () awful.key({ modkey }, "j", function ()