dots/.config/awesome/components/keybinds/global.lua
2023-01-29 10:02:22 +01:00

150 lines
3.9 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)