aboutsummaryrefslogtreecommitdiff
path: root/.config/awesome/components/keybinds/global.lua
diff options
context:
space:
mode:
authordelta <darkussdelta@gmail.com>2023-01-29 09:59:52 +0100
committerdelta <darkussdelta@gmail.com>2023-01-29 10:02:22 +0100
commita0f8b5fa6acdd1c2477fb1881dd9067956bf0ae6 (patch)
tree04500ca0a4c97f85b1a2d875d8285effda7b57fe /.config/awesome/components/keybinds/global.lua
init dots
Diffstat (limited to '.config/awesome/components/keybinds/global.lua')
-rw-r--r--.config/awesome/components/keybinds/global.lua149
1 files changed, 149 insertions, 0 deletions
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)