This commit is contained in:
Luca 2022-11-22 13:25:44 +01:00
parent 8268fba83d
commit 7ed2a6e110
9565 changed files with 1315332 additions and 90 deletions

View file

@ -0,0 +1,19 @@
#!/bin/sh
# Applets :
nm-applet &
#blueman-applet &
#volumeicon &
xfce4-power-manager &
# Wallpaper :
nitrogen --restore &
# Clipordmanager :
clipmenud &
# Compositor :
autostart="picom"
for program in $autostart; do
pidof -s "$program" || setsid -f "$program"
done >/dev/null 2>&1

View file

@ -0,0 +1,274 @@
-- ## Keybindings ##
-- ~~~~~~~~~~~~~~~~~
-- requirements
-- ~~~~~~~~~~~~
local awful = require("awful")
local hotkeys_popup = require("awful.hotkeys_popup")
-- vars
-- ~~~~~~~~~
-- modkey
local modkey = "Mod4"
-- modifer keys
local shift = "Shift"
local ctrl = "Control"
local alt = "Mod1"
-- Default Applications :
terminal = "alacritty"
editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor
-- Configurations
-- ~~~~~~~~~~~~~~
-- # Mouse bindings :
awful.mouse.append_global_mousebindings({
awful.button({ }, 3, function () mymainmenu:toggle() end)
})
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)
-- Sloppy focus :
client.connect_signal("mouse::enter", function(c)
c:activate { context = "mouse_enter", raise = false }
end)
-- # Key bindings :
-- General Awesome keys
awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "s", hotkeys_popup.show_help, {description="show help", group="awesome"}),
awful.key({ modkey, }, "w", function () mymainmenu:show() end, {description = "show main menu", group = "awesome"}),
awful.key({ modkey, ctrl }, "r", awesome.restart, {description = "reload awesome", group = "awesome"}),
awful.key({ modkey, shift }, "q", awesome.quit, {description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, {description = "open a terminal", group = "launcher"}),
-- awful.key({ modkey }, "p", function() menubar.show() end,
-- {description = "show the menubar", group = "launcher"}),
})
-- Tags related keybindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "Left", awful.tag.viewprev, {description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext, {description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore, {description = "go back", group = "tag"}),
})
-- Focus related keybindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "j", function () awful.client.focus.byidx(1) end, {description = "focus next by index", group = "client"}),
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end, {description = "focus previous by index", group = "client"}),
awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end, {description = "go back", group = "client"}),
awful.key({ modkey, ctrl }, "j", function () awful.screen.focus_relative( 1) end, {description = "focus the next screen", group = "screen"}),
awful.key({ modkey, ctrl }, "k", function () awful.screen.focus_relative(-1) end, {description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, ctrl }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
c:activate { raise = true, context = "key.unminimize" }
end
end, {description = "restore minimized", group = "client"}),
})
-- Layout related keybindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, shift }, "j", function () awful.client.swap.byidx( 1) end, {description = "swap with next client by index", group = "client"}),
awful.key({ modkey, shift }, "k", function () awful.client.swap.byidx( -1) end, {description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, {description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, {description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, shift }, "h", function () awful.tag.incnmaster( 1, nil, true) end, {description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, shift }, "l", function () awful.tag.incnmaster(-1, nil, true) end, {description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, ctrl }, "h", function () awful.tag.incncol( 1, nil, true) end, {description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, ctrl }, "l", 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"}),
awful.key({ modkey, shift }, "space", function () awful.layout.inc(-1) end, {description = "select previous", group = "layout"}),
})
-- Tags related keybindings
awful.keyboard.append_global_keybindings({
awful.key {
modifiers = { modkey },
keygroup = "numrow",
description = "only view tag",
group = "tag",
on_press = function (index)
local screen = awful.screen.focused()
local tag = screen.tags[index]
if tag then
tag:view_only()
end
end,
},
awful.key {
modifiers = { modkey, ctrl },
keygroup = "numrow",
description = "toggle tag",
group = "tag",
on_press = function (index)
local screen = awful.screen.focused()
local tag = screen.tags[index]
if tag then
awful.tag.viewtoggle(tag)
end
end,
},
awful.key {
modifiers = { modkey, shift },
keygroup = "numrow",
description = "move focused client to tag",
group = "tag",
on_press = function (index)
if client.focus then
local tag = client.focus.screen.tags[index]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
},
awful.key {
modifiers = { modkey, ctrl, shift },
keygroup = "numrow",
description = "toggle focused client on tag",
group = "tag",
on_press = function (index)
if client.focus then
local tag = client.focus.screen.tags[index]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
},
awful.key {
modifiers = { modkey },
keygroup = "numpad",
description = "select layout directly",
group = "layout",
on_press = function (index)
local t = awful.screen.focused().selected_tag
if t then
t.layout = t.layouts[index] or t.layout
end
end,
}
})
-- Media Control :
awful.keyboard.append_global_keybindings({
-- Volume Keys :
awful.key({}, "XF86AudioLowerVolume", function () awful.spawn("amixer -q -D pulse sset Master 5%-", false) end),
awful.key({}, "XF86AudioRaiseVolume", function () awful.spawn("amixer -q -D pulse sset Master 5%+", false) end),
awful.key({}, "XF86AudioMute", function () awful.spawn("amixer -D pulse set Master 1+ toggle", false) end),
-- Media Keys :
awful.key({}, "XF86AudioPlay", function() awful.spawn("playerctl play-pause", false) end),
awful.key({}, "XF86AudioNext", function() awful.spawn("playerctl next", false) end),
awful.key({}, "XF86AudioPrev", function() awful.spawn("playerctl previous", false) end),
-- Brightness Keys :
awful.key({}, "XF86MonBrightnessUp", function() awful.spawn("brightnessctl set 5%+", false) end),
awful.key({}, "XF86MonBrightnessDown", function() awful.spawn("brightnessctl set 5%-", false) end),
})
-- Standard program :
awful.keyboard.append_global_keybindings({
-- File Manager :
awful.key({ ctrl, shift }, "f", function () awful.spawn(string.format("pcmanfm")) end, {description = "pcmanfm", group = "file manager"}),
-- Screenshots Keys :
awful.key({ }, "Print", function () awful.spawn("screenshot")end, {description = "Maim", group = "screenshot"}),
awful.key({ modkey }, "Print", function () awful.spawn("screenshot-select")end, {description = "Maim", group = "screenshot"}),
-- Rofi :
awful.key({ modkey }, "p", function () awful.spawn("rofi -show drun -show-icons &>> /tmp/rofi.log") end, {description = "rofi launcher", group = "launcher"}),
-- ClipMenu :
awful.key({ modkey}, "Insert", function () awful.spawn("clipmenu") end,{description = "clipboard history by rofi/clipmenud", group = "awesome"}),
-- Firefox :
awful.key({ modkey }, "b", function () awful.spawn("firefox") end, {description = "Firefox", group = "Web Browser"}),
-- Center Window :
awful.key({ modkey }, "y", awful.placement.centered)
})
-- Systray :
--awful.keyboard.append_global_keybindings({
-- awful.key({ modkey }, "=", function () awful.screen.focused().systray.visible = not awful.screen.focused().systray.visible end, {description = "Toggle systray visibility", group = "custom"})
--})
awful.keyboard.append_global_keybindings({
awful.key({alt}, "Tab", function() awesome.emit_signal("sidebar::toggle") end), -- Sidebar
})
-- Client :
client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings({
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end, {description = "toggle fullscreen", group = "client"}),
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, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, {description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, {description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, {description = "toggle keep on top", group = "client"}),
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
awful.key({ modkey, }, "n", function (c) c.minimized = true end , {description = "minimize", group = "client"}),
awful.key({ modkey, }, "m", function (c)c.maximized = not c.maximized c:raise() end , {description = "(un)maximize", group = "client"}),
awful.key({ modkey, "Control" }, "m", function (c) c.maximized_vertical = not c.maximized_vertical c:raise() end , {description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c:raise() end , {description = "(un)maximize horizontally", group = "client"}),
})
end)

View file

@ -0,0 +1,42 @@
-- ## Layouts ##
-- ~~~~~~~~~~~~~~~~~
-- requirements
-- ~~~~~~~~~~~~
local gears = require("gears")
local awful = require("awful")
local bling = require("lib.bling")
--- Custom Layouts
local mstab = bling.layout.mstab
local centered = bling.layout.centered
local equal = bling.layout.equalarea
local deck = bling.layout.deck
local vertical = bling.layout.vertical
local horizontal = bling.layout.horizontal
-- Tag layout :
tag.connect_signal("request::default_layouts", function()
awful.layout.append_default_layouts({
awful.layout.suit.tile,
awful.layout.suit.floating,
--awful.layout.suit.tile.left,
mstab,
--awful.layout.suit.tile.bottom,
--awful.layout.suit.tile.top,
--awful.layout.suit.fair,
--awful.layout.suit.fair.horizontal,
--awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle,
--awful.layout.suit.max,
awful.layout.suit.max.fullscreen,
--awful.layout.suit.magnifier,
--awful.layout.suit.corner.nw,
centered,
equal,
deck,
--vertical,
--horizontal,
})
end)

View file

@ -0,0 +1,140 @@
-- Rules
-- ~~~~~
-- requirements
-- ~~~~~~~~~~~~
local awful = require "awful"
local ruled = require "ruled"
local gears = require "gears"
local beautiful = require "beautiful"
-- connect to signal
ruled.client.connect_signal("request::rules", function()
-- All clients will match this rule.
ruled.client.append_rule {
id = "global",
rule = { },
properties = {
focus = awful.client.focus.filter,
raise = true,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen+awful.placement.centered
}
}
-- Floating clients.
ruled.client.append_rule {
id = "floating",
rule_any = {
instance = { "copyq", "pinentry" },
class = {
"Arandr",
"Steam",
"XTerm",
"Virt-manager",
"VirtualBox Manager",
"Nm-connection-editor",
"Xfce4-power-manager-settings",
"Pavucontrol",
"Qalculate-gtk",
"Engrampa",
"Lxappearance",
"Gnome-disks",
"Nitrogen",
"Audacious",
"qt5ct",
"qt6ct",
"Kvantum Manager",
"Blueman-manager",
"Gpick",
"Kruler",
"MessageWin", -- kalarm.
"Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui",
"veromix",
"alsamixer",
"xtightvncviewer",
"Gufw Firewall",
"VPN4Test"
},
-- Note that the name property shown in xprop might be set slightly after creation of the client
-- and the name shown there might not match defined rules here.
name = {
"Event Tester", -- xev.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
},
properties = { floating = true }
}
-- Center Placement
ruled.client.append_rule {
id = "center_placement",
rule_any = {
type = {"dialog"},
class = {"Steam", "discord", "markdown_input", "nemo", "thunar", "pcmanfm" },
instance = {"markdown_input",},
role = {"GtkFileChooserDialog"}
},
properties = {placement = awful.placement.center}
}
-- Add titlebars to normal clients and dialogs
ruled.client.append_rule {
id = "titlebars",
rule_any = { type = { "normal", "dialog" } },
properties = { titlebars_enabled = true }
}
-- Set Firefox to always map on the tag named "2" on screen 1.
-- ruled.client.append_rule {
-- rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" }
-- }
end)
ruled.notification.connect_signal('request::rules', function()
-- All notifications will match this rule.
ruled.notification.append_rule {
rule = { },
properties = {
screen = awful.screen.preferred,
implicit_timeout = 5,
position = "top_right",
}
}
end)
-- Vbox Fix :
client.disconnect_signal("request::geometry", awful.ewmh.client_geometry_requests)
-- Master-Slave layout new client goes to the slave, master is kept
client.connect_signal("manage", function(c)
-- Similar behavior as other window managers DWM, XMonad.
-- If you need new slave as master press: ctrl + super + return
if not awesome.startup then awful.client.setslave(c) end
end)
-- Window opacity
client.connect_signal("focus", function(c)
c.border_color = beautiful.border_focus
c.opacity = 1
end)
client.connect_signal("unfocus", function(c)
c.border_color = beautiful.border_normal
c.opacity = 0.99
end)
-- Round Corners :
--client.connect_signal("manage", function (c)
-- c.shape = function(cr,w,h)
-- gears.shape.rounded_rect(cr,w,h,8)
-- end
--end)