Adding keychords to Awesome config.

This commit is contained in:
Derek Taylor
2022-07-09 14:12:57 -05:00
parent 44389bfc8d
commit b581cd16a0
2 changed files with 974 additions and 51 deletions

View File

@@ -241,57 +241,59 @@ globalkeys = my_table.join(
awful.key({ modkey, "Shift" }, "Return", function () awful.util.spawn("dm-run") end,
{description = "Run launcher", group = "hotkeys"}),
-- Dmscripts (SUPER+ALT+Key)
awful.key({ modkey, altkey }, "h", function () awful.util.spawn( "dm-hub" ) end,
{description = "List all dmscripts" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "a", function () awful.util.spawn( "dm-sounds" ) end,
{description = "Choose ambient sound" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "b", function () awful.util.spawn( "dm-setbg" ) end,
{description = "Set background" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "c", function () awful.util.spawn( "dtos-colorscheme" ) end,
{description = "Choose color scheme" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "e", function () awful.util.spawn( "dm-confedit" ) end,
{description = "Edit config files" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "i", function () awful.util.spawn( "dm-maim" ) end,
{description = "Take a screenshot" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "k", function () awful.util.spawn( "dm-kill" ) end,
{description = "Kill processes" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "m", function () awful.util.spawn( "dm-man" ) end,
{description = "View manpages" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "n", function () awful.util.spawn( "dm-note" ) end,
{description = "Store and copy notes" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "o", function () awful.util.spawn( "dm-bookman" ) end,
{description = "Browser bookmarks" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "p", function () awful.util.spawn( "passmenu -p \"Pass: \"" ) end,
{description = "Passmenu" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "q", function () awful.util.spawn( "dm-logout" ) end,
{description = "Logout menu" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "r", function () awful.util.spawn( "dm-radio" ) end,
{description = "Listen to online radio" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "s", function () awful.util.spawn( "dm-websearch" ) end,
{description = "Search various engines" , group = "dmenu scripts" }),
awful.key({ modkey, altkey }, "t", function () awful.util.spawn( "dm-translate" ) end,
{description = "Translate text" , group = "dmenu scripts" }),
awful.key( {modkey}, "p", function()
local grabber
grabber =
awful.keygrabber.run(
function(_, key, event)
if event == "release" then return end
-- My dmenu scripts (SUPER+CTRL+Key)
awful.key({ modkey, ctrlkey }, "e", function () awful.util.spawn( emacs .. "--eval '(dashboard-refresh-buffer)'") end,
{description = "Emacsclient Dashboard" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "a", function () awful.util.spawn( emacs .. "--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'") end,
{description = "Emacsclient EMMS (music)" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "b", function () awful.util.spawn( emacs .. "--eval '(ibuffer)'") end,
{description = "Emacsclient Ibuffer" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "d", function () awful.util.spawn( emacs .. "--eval '(dired nil)'") end,
{description = "Emacsclient Dired" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "i", function () awful.util.spawn( emacs .. "--eval '(erc)'") end,
{description = "Emacsclient ERC (IRC)" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "n", function () awful.util.spawn( emacs .. "--eval '(elfeed)'") end,
{description = "Emacsclient Elfeed" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "s", function () awful.util.spawn( emacs .. "--eval '(eshell)'") end,
{description = "Emacsclient Eshell" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "v", function () awful.util.spawn( emacs .. "--eval '(+vterm/here nil)'") end,
{description = "Emacsclient Vterm" , group = "Emacs" }),
awful.key({ modkey, ctrlkey }, "w", function () awful.util.spawn( emacs .. "--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'") end,
{description = "Emacsclient EWW Browser" , group = "Emacs" }),
if key == "h" then awful.spawn.with_shell("dm-hub")
elseif key == "a" then awful.spawn.with_shell("dm-sounds")
elseif key == "b" then awful.spawn.with_shell("dm-setbg")
elseif key == "c" then awful.spawn.with_shell("dtos-colorscheme")
elseif key == "e" then awful.spawn.with_shell("dm-confedit")
elseif key == "i" then awful.spawn.with_shell("dm-maim")
elseif key == "k" then awful.spawn.with_shell("dm-kill")
elseif key == "m" then awful.spawn.with_shell("dm-man")
elseif key == "n" then awful.spawn.with_shell("dm-note")
elseif key == "o" then awful.spawn.with_shell("dm-bookman")
elseif key == "p" then awful.spawn.with_shell("passmenu -p \"Pass: \"")
elseif key == "q" then awful.spawn.with_shell("dm-logout")
elseif key == "r" then awful.spawn.with_shell("dm-radio")
elseif key == "s" then awful.spawn.with_shell("dm-websearch")
elseif key == "t" then awful.spawn.with_shell("dm-translate")
end
awful.keygrabber.stop(grabber)
end
)
end,
{description = "followed by KEY", group = "Dmscripts"}
),
awful.key( {modkey}, "e", function()
local grabber
grabber =
awful.keygrabber.run(
function(_, key, event)
if event == "release" then return end
if key == "e" then awful.spawn.with_shell(emacs .. "--eval '(dashboard-refresh-buffer)'")
elseif key == "a" then awful.spawn.with_shell(emacs .. "--eval '(emms)' --eval '(emms-play-directory-tree \"~/Music/\")'")
elseif key == "b" then awful.spawn.with_shell(emacs .. "--eval '(ibuffer)'")
elseif key == "d" then awful.spawn.with_shell(emacs .. "--eval '(dired nil)'")
elseif key == "i" then awful.spawn.with_shell(emacs .. "--eval '(erc)'")
elseif key == "n" then awful.spawn.with_shell(emacs .. "--eval '(elfeed)'")
elseif key == "s" then awful.spawn.with_shell(emacs .. "--eval '(eshell)'")
elseif key == "v" then awful.spawn.with_shell(emacs .. "--eval '(+vterm/here nil)'")
elseif key == "w" then awful.spawn.with_shell(emacs .. "--eval '(doom/window-maximize-buffer(eww \"distro.tube\"))'")
end
awful.keygrabber.stop(grabber)
end
)
end,
{description = "followed by KEY", group = "Emacs"}
),
-- Tag browsing with modkey
awful.key({ modkey, }, "Left", awful.tag.viewprev,
@@ -409,7 +411,7 @@ globalkeys = my_table.join(
{description = "restore minimized", group = "client"}),
-- Dropdown application
awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end,
awful.key({ modkey, }, "F12", function () awful.screen.focused().quake:toggle() end,
{description = "dropdown application", group = "super"}),
-- Widgets popups