awesome: use only Mod4

This commit is contained in:
Łukasz Pankowski 2023-09-25 16:26:25 +02:00
parent c1f0146d3e
commit 8b998df350

View File

@ -67,8 +67,7 @@ end
local terminal = "alacritty"
-- Default modkey.
local modkey = "Mod1"
local modkey4 = "Mod4"
local modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
@ -219,7 +218,7 @@ end
-- {{{ Key bindings
globalkeys = gears.table.join(
awful.key({ modkey4, }, "s", hotkeys_popup.show_help,
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{ description = "show help", group = "awesome" }),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{ description = "view previous", group = "tag" }),
@ -228,13 +227,13 @@ globalkeys = gears.table.join(
awful.key({ modkey, }, "Tab", awful.tag.history.restore,
{ description = "go back", group = "tag" }),
awful.key({ modkey4, }, "j",
awful.key({ modkey, }, "j",
function()
awful.client.focus.byidx(1)
end,
{ description = "focus next by index", group = "client" }
),
awful.key({ modkey4, }, "k",
awful.key({ modkey, }, "k",
function()
awful.client.focus.byidx(-1)
end,
@ -242,17 +241,17 @@ globalkeys = gears.table.join(
),
-- Layout manipulation
awful.key({ modkey4, "Shift" }, "j", function() awful.client.swap.byidx(1) end,
awful.key({ modkey, "Shift" }, "j", function() awful.client.swap.byidx(1) end,
{ description = "swap with next client by index", group = "client" }),
awful.key({ modkey4, "Shift" }, "k", function() awful.client.swap.byidx(-1) end,
awful.key({ modkey, "Shift" }, "k", function() awful.client.swap.byidx(-1) end,
{ description = "swap with previous client by index", group = "client" }),
awful.key({ modkey4, }, ".", function() awful.screen.focus_relative(1) end,
awful.key({ modkey, }, ".", function() awful.screen.focus_relative(1) end,
{ description = "focus the next screen", group = "screen" }),
awful.key({ modkey4, }, ",", function() awful.screen.focus_relative(-1) end,
awful.key({ modkey, }, ",", function() awful.screen.focus_relative(-1) end,
{ description = "focus the previous screen", group = "screen" }),
awful.key({ modkey4, }, "u", awful.client.urgent.jumpto,
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{ description = "jump to urgent client", group = "client" }),
awful.key({ modkey4, }, "a",
awful.key({ modkey, }, "a",
function()
awful.client.focus.history.previous()
if client.focus then
@ -264,27 +263,27 @@ globalkeys = gears.table.join(
-- Standard program
awful.key({ modkey, "Shift" }, "Return", function() awful.spawn(terminal) end,
{ description = "open a terminal", group = "launcher" }),
awful.key({ modkey, modkey4, "Shift" }, "l", function() awful.spawn("slock") end,
awful.key({ modkey, "Control", "Shift" }, "l", function() awful.spawn("slock") end,
{ description = "open a terminal", group = "launcher" }),
awful.key({ modkey, modkey4, "Shift" }, "s", function() awful.spawn("systemctl suspend") end,
awful.key({ modkey, "Control", "Shift" }, "s", function() awful.spawn("systemctl suspend") end,
{ description = "open a terminal", group = "launcher" }),
awful.key({ modkey, "Shift" }, "F6", switch_theme,
{ description = "switch theme", group = "launcher" }),
awful.key({ modkey4, }, "q", awesome.restart,
awful.key({ modkey, }, "q", awesome.restart,
{ description = "reload awesome", group = "awesome" }),
awful.key({ modkey, modkey4, "Shift" }, "q", awesome.quit,
awful.key({ modkey, "Control", "Shift" }, "q", awesome.quit,
{ description = "quit awesome", group = "awesome" }),
awful.key({ modkey4, }, "l", function() awful.tag.incmwfact(0.05) end,
awful.key({ modkey, }, "l", function() awful.tag.incmwfact(0.05) end,
{ description = "increase master width factor", group = "layout" }),
awful.key({ modkey4, }, "h", function() awful.tag.incmwfact(-0.05) end,
awful.key({ modkey, }, "h", function() awful.tag.incmwfact(-0.05) end,
{ description = "decrease master width factor", group = "layout" }),
awful.key({ modkey4, "Shift" }, "h", function() awful.tag.incnmaster(1, nil, true) end,
awful.key({ modkey, "Shift" }, "h", function() awful.tag.incnmaster(1, nil, true) end,
{ description = "increase the number of master clients", group = "layout" }),
awful.key({ modkey4, "Shift" }, "l", function() awful.tag.incnmaster(-1, nil, true) end,
awful.key({ modkey, "Shift" }, "l", function() awful.tag.incnmaster(-1, nil, true) end,
{ description = "decrease the number of master clients", group = "layout" }),
awful.key({ modkey4, }, "i", function() awful.tag.incncol(1, nil, true) end,
awful.key({ modkey, }, "i", function() awful.tag.incncol(1, nil, true) end,
{ description = "increase the number of columns", group = "layout" }),
awful.key({ modkey4, }, "d", function() awful.tag.incncol(-1, nil, true) end,
awful.key({ modkey, }, "d", function() awful.tag.incncol(-1, nil, true) end,
{ description = "decrease the number of columns", group = "layout" }),
awful.key({ modkey, }, "space", function() awful.layout.inc(1) end,
{ description = "select next", group = "layout" }),
@ -292,7 +291,7 @@ globalkeys = gears.table.join(
{ description = "select previous", group = "layout" }),
awful.key({ modkey, "Control", "Shift", }, "space", layout_menu,
{ description = "select layout from menu", group = "layout" }),
awful.key({ modkey4, "Control" }, "n",
awful.key({ modkey, "Control" }, "n",
function()
local c = awful.client.restore()
-- Focus restored client
@ -305,10 +304,10 @@ globalkeys = gears.table.join(
{ description = "restore minimized", group = "client" }),
-- Prompt
awful.key({ modkey4, }, "r", function() awful.screen.focused().mypromptbox:run() end,
awful.key({ modkey, }, "r", function() awful.screen.focused().mypromptbox:run() end,
{ description = "run prompt", group = "launcher" }),
awful.key({ modkey4, }, "x",
awful.key({ modkey, }, "x",
function()
awful.prompt.run {
prompt = "Run Lua code: ",
@ -319,47 +318,47 @@ globalkeys = gears.table.join(
end,
{ description = "lua execute prompt", group = "awesome" }),
-- Menubar
awful.key({ modkey4, }, "p", function() menubar.show() end,
awful.key({ modkey, }, "p", function() menubar.show() end,
{ description = "show the menubar", group = "launcher" })
)
clientkeys = gears.table.join(
awful.key({ modkey4, }, "f",
awful.key({ modkey, }, "f",
function(c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{ description = "toggle fullscreen", group = "client" }),
awful.key({ modkey4, "Shift" }, "c", function(c) c:kill() end,
awful.key({ modkey, "Shift" }, "c", function(c) c:kill() end,
{ description = "close", group = "client" }),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
{ description = "toggle floating", group = "client" }),
awful.key({ modkey, }, "Return", function(c) c:swap(awful.client.getmaster()) end,
{ description = "move to master", group = "client" }),
awful.key({ modkey4, "Shift" }, ".", function(c) c:move_to_screen() end,
awful.key({ modkey, "Shift" }, ".", function(c) c:move_to_screen() end,
{ description = "move to screen", group = "client" }),
awful.key({ modkey4, }, "t", function(c) c.ontop = not c.ontop end,
awful.key({ modkey, }, "t", function(c) c.ontop = not c.ontop end,
{ description = "toggle keep on top", group = "client" }),
awful.key({ modkey4, }, "n",
awful.key({ modkey, }, "n",
function(c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end,
{ description = "minimize", group = "client" }),
awful.key({ modkey4, }, "m",
awful.key({ modkey, }, "m",
function(c)
c.maximized = not c.maximized
c:raise()
end,
{ description = "(un)maximize", group = "client" }),
awful.key({ modkey4, }, "v",
awful.key({ modkey, }, "v",
function(c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end,
{ description = "(un)maximize vertically", group = "client" }),
awful.key({ modkey4, }, "b",
awful.key({ modkey, }, "b",
function(c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()