configuration de base avec awesomeWM minimal et modularise, polybar et rofi

This commit is contained in:
2026-03-12 01:25:21 +01:00
parent 4cc83f6c87
commit 6749335def
9 changed files with 445 additions and 0 deletions

65
awesome/modules/keys.lua Normal file
View File

@@ -0,0 +1,65 @@
local awful = require("awful")
local gears = require("gears")
-- Raccourcis globaux
local global_keys = gears.table.join(
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end,
{ description = "ouvrir terminal", group = "launcher" }),
awful.key({ modkey, "Control" }, "r", awesome.restart,
{ description = "recharger awesome", group = "awesome" }),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{ description = "quitter", group = "awesome" }),
awful.key({ modkey }, "j", function() awful.client.focus.byidx(1) end),
awful.key({ modkey }, "k", function() awful.client.focus.byidx(-1) end),
awful.key({ modkey }, "Left", awful.tag.viewprev),
awful.key({ modkey }, "Right", awful.tag.viewnext),
awful.key({ modkey }, "p", function() awful.spawn("rofi -show drun")
end, {description = "lancer rofi", group = "launcher"})
)
-- Navigation tags Super+1..9
for i = 1, 9 do
global_keys = gears.table.join(global_keys,
awful.key({ modkey }, "#" .. i + 9, function()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then tag:view_only() end
end,
{ description = "aller au tag " .. i, group = "tag" })
)
end
root.keys(global_keys)
-- Raccourcis sur les fenêtres
local client_keys = gears.table.join(
awful.key({ modkey }, "q", function(c) c:kill() end,
{ description = "fermer", group = "client" }),
awful.key({ modkey }, "f", function(c)
c.fullscreen = not c.fullscreen
c:raise()
end),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle)
)
-- Boutons souris sur les fenêtres
local client_buttons = gears.table.join(
awful.button({}, 1, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true })
end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize)
)
-- On exporte pour rules.lua
return {
client_keys = client_keys,
client_buttons = client_buttons,
}