From a0f8b5fa6acdd1c2477fb1881dd9067956bf0ae6 Mon Sep 17 00:00:00 2001 From: delta Date: Sun, 29 Jan 2023 09:59:52 +0100 Subject: init dots --- .config/awesome/components/keybinds/client.lua | 15 +++ .config/awesome/components/keybinds/global.lua | 149 +++++++++++++++++++++++++ .config/awesome/components/keybinds/init.lua | 4 + 3 files changed, 168 insertions(+) create mode 100644 .config/awesome/components/keybinds/client.lua create mode 100644 .config/awesome/components/keybinds/global.lua create mode 100644 .config/awesome/components/keybinds/init.lua (limited to '.config/awesome/components/keybinds') diff --git a/.config/awesome/components/keybinds/client.lua b/.config/awesome/components/keybinds/client.lua new file mode 100644 index 0000000..35680c4 --- /dev/null +++ b/.config/awesome/components/keybinds/client.lua @@ -0,0 +1,15 @@ +local awful = require "awful" + +client.connect_signal("request::default_mousebindings", function() + awful.mouse.append_client_mousebindings({ + awful.button({ }, 1, function (c) + c:activate { context = "mouse_click" } + end), + awful.button({ modkey }, 1, function (c) + c:activate { context = "mouse_click", action = "mouse_move" } + end), + awful.button({ modkey }, 3, function (c) + c:activate { context = "mouse_click", action = "mouse_resize" } + end) + }) +end) diff --git a/.config/awesome/components/keybinds/global.lua b/.config/awesome/components/keybinds/global.lua new file mode 100644 index 0000000..56e4ea0 --- /dev/null +++ b/.config/awesome/components/keybinds/global.lua @@ -0,0 +1,149 @@ +local awful = require "awful" +local gears = require "gears" +local naughty = require "naughty" +local hkp = require "awful.hotkeys_popup.widget" +local vars = require "themes.prismite.vars" + +local labels = { + Control = "Ctrl", + Mod1 = "Alt", + ISO_Level3_Shift = "Alt Gr", + Mod4 = "Super", + Insert = "Ins", + Delete = "Del", + Next = "PgDn", + Prior = "PgUp", + Left = "", + Up = "", + Right = "", + Down = "", + KP_End = "Num1", + KP_Down = "Num2", + KP_Next = "Num3", + KP_Left = "Num4", + KP_Begin = "Num5", + KP_Right = "Num6", + KP_Home = "Num7", + KP_Up = "Num8", + KP_Prior = "Num9", + KP_Insert = "Num0", + KP_Delete = "Num.", + KP_Divide = "Num/", + KP_Multiply = "Num*", + KP_Subtract = "Num-", + KP_Add = "Num+", + KP_Enter = "NumEnter", + -- Some "obvious" entries are necessary for the Escape sequence + -- and whitespace characters: + Escape = "Esc", + Tab = "Tab", + space = "Space", + Return = "Enter", + -- Dead keys aren't distinct from non-dead keys because no sane + -- layout should have both of the same kind: + dead_acute = "´", + dead_circumflex = "^", + dead_grave = "`", + -- Basic multimedia keys: + XF86MonBrightnessUp = "🔆+", + XF86MonBrightnessDown = "🔅-", + XF86AudioRaiseVolume = "ﱛ", + XF86AudioLowerVolume = "ﱜ", + XF86AudioMute = "ﱝ", + XF86AudioPlay = "⏯", + XF86AudioPrev = "⏮", + XF86AudioNext = "⏭", + XF86AudioStop = "⏹", +} + +local globalkeys = gears.table.join( + -- awesome + awful.key { + modifiers = { modkey, "Control" }, + key = "r", + on_press = awesome.restart, + group = "awesome", + description = "restart awesome" + }, + awful.key { + modifiers = { modkey, "Control" }, + key = "s", + on_press = function() + hkp.new { + shape = vars.shape, + modifiers_fg = "#8893a5", + labels = labels + }:show_help() + end, + group = "awesome", + description = "toggle help" + }, + + -- general + awful.key { + modifiers = {}, + key = "XF86AudioMute", + on_press = function() + naughty.notification { + message = "mute" + } + end, + group = "general", + description = "mute audio" + }, + + -- launcher + awful.key { + modifiers = { modkey }, + key = "Return", + on_press = function () + awful.spawn("kitty") + end, + group = "launcher", + description = "launch kitty" + }, + + -- client + awful.key { + modifiers = { modkey, "Control" }, + key = "q", + on_press = function() + local c = client.focus + if c then + c:kill() + end + end, + group = "client", + description = "kill client" + }, + awful.key { + modifiers = { modkey, "Control" }, + key = "f", + on_press = function() + local c = client.focus + if c then + c.fullscreen = not c.fullscreen + end + end, + group = "client", + description = "toggle fullscreen" + }, + + -- tag + awful.key { + modifiers = { modkey }, + key = "Up", + on_press = awful.tag.viewprev, + group = "tag", + description = "switch to previous tag" + }, + awful.key { + modifiers = { modkey }, + key = "Down", + on_press = awful.tag.viewnext, + group = "tag", + description = "switch to next tag" + } +) + +root.keys(globalkeys) diff --git a/.config/awesome/components/keybinds/init.lua b/.config/awesome/components/keybinds/init.lua new file mode 100644 index 0000000..25b8942 --- /dev/null +++ b/.config/awesome/components/keybinds/init.lua @@ -0,0 +1,4 @@ +modkey = "Mod4" + +require "components.keybinds.global" +require "components.keybinds.client" -- cgit v1.2.3