2022-04-18 21:29:56 +00:00
|
|
|
-- ____ __
|
|
|
|
-- / __ \_________ _/ /_____
|
|
|
|
-- / / / / ___/ __ `/ //_/ _ \
|
|
|
|
-- / /_/ / / / /_/ / ,< / __/ Clay Gomera (Drake)
|
|
|
|
-- /_____/_/ \__,_/_/|_|\___/ My custom awesome window manager config
|
|
|
|
--
|
|
|
|
|
|
|
|
--[[ LIBRARIES ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
local awful = require("awful") --Everything related to window managment
|
|
|
|
local beautiful = require("beautiful")
|
2022-03-03 20:05:55 +00:00
|
|
|
local gears = require("gears") --Utilities such as color parsing and objects
|
2022-01-01 00:29:27 +00:00
|
|
|
local lain = require("lain")
|
2022-03-03 20:05:55 +00:00
|
|
|
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
2022-01-01 00:29:27 +00:00
|
|
|
local hotkeys_popup = require("awful.hotkeys_popup").widget
|
2022-06-07 02:15:35 +00:00
|
|
|
require("awful.hotkeys_popup.keys")
|
2022-03-03 20:05:55 +00:00
|
|
|
require("awful.autofocus")
|
|
|
|
local wibox = require("wibox")
|
|
|
|
local naughty = require("naughty")
|
|
|
|
naughty.config.defaults['icon_size'] = 100
|
2022-01-01 00:29:27 +00:00
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ ERROR HANDLING ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
if awesome.startup_errors then
|
|
|
|
naughty.notify({ preset = naughty.config.presets.critical,
|
|
|
|
title = "Oops, there were errors during startup!",
|
|
|
|
text = awesome.startup_errors }) end
|
|
|
|
do
|
|
|
|
local in_error = false
|
|
|
|
awesome.connect_signal("debug::error", function (err)
|
|
|
|
-- Make sure we don't go into an endless error loop
|
|
|
|
if in_error then return end
|
|
|
|
in_error = true
|
|
|
|
naughty.notify({ preset = naughty.config.presets.critical,
|
|
|
|
title = "Oops, an error happened!",
|
|
|
|
text = tostring(err) })
|
|
|
|
in_error = false
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
local function run_once(cmd_arr)
|
|
|
|
for _, cmd in ipairs(cmd_arr) do
|
|
|
|
awful.spawn.with_shell(string.format("pgrep -u $USER -fx '%s' > /dev/null || (%s)", cmd, cmd))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
run_once({ "unclutter -root" }) -- entries must be comma-separated
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ THEMES ]]--
|
2022-06-07 02:15:35 +00:00
|
|
|
local themes = { "gruvbox-dark" }
|
2022-01-01 00:29:27 +00:00
|
|
|
local chosen_theme = themes[1]
|
|
|
|
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
|
|
|
|
beautiful.init(theme_path)
|
|
|
|
beautiful.init(string.format(gears.filesystem.get_configuration_dir() .. "/themes/%s/theme.lua", chosen_theme))
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ LAYOUTS ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.layout.suit.tile.left.mirror = true
|
|
|
|
awful.layout.layouts = {
|
|
|
|
awful.layout.suit.tile,
|
|
|
|
awful.layout.suit.tile.left,
|
|
|
|
awful.layout.suit.tile.bottom,
|
|
|
|
awful.layout.suit.tile.top,
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.layout.suit.fair,
|
|
|
|
awful.layout.suit.fair.horizontal,
|
2022-01-01 00:29:27 +00:00
|
|
|
--awful.layout.suit.spiral,
|
|
|
|
--awful.layout.suit.spiral.dwindle,
|
|
|
|
awful.layout.suit.max,
|
|
|
|
--awful.layout.suit.max.fullscreen,
|
2022-06-07 02:15:35 +00:00
|
|
|
--awful.layout.suit.magnifier,
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.layout.suit.floating,
|
|
|
|
--awful.layout.suit.corner.nw,
|
|
|
|
--awful.layout.suit.corner.ne,
|
|
|
|
--awful.layout.suit.corner.sw,
|
|
|
|
--awful.layout.suit.corner.se,
|
|
|
|
--lain.layout.cascade,
|
|
|
|
--lain.layout.cascade.tile,
|
|
|
|
--lain.layout.centerwork,
|
|
|
|
--lain.layout.centerwork.horizontal,
|
|
|
|
--lain.layout.termfair,
|
|
|
|
--lain.layout.termfair.center,
|
|
|
|
}
|
|
|
|
lain.layout.termfair.nmaster = 3
|
|
|
|
lain.layout.termfair.ncol = 1
|
|
|
|
lain.layout.termfair.center.nmaster = 3
|
|
|
|
lain.layout.termfair.center.ncol = 1
|
|
|
|
lain.layout.cascade.tile.offset_x = 2
|
|
|
|
lain.layout.cascade.tile.offset_y = 32
|
|
|
|
lain.layout.cascade.tile.extra_padding = 5
|
|
|
|
lain.layout.cascade.tile.nmaster = 5
|
|
|
|
lain.layout.cascade.tile.ncol = 2
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ VARIABLES ]]--
|
2022-03-03 20:28:59 +00:00
|
|
|
awful.util.terminal = terminal -- do not remove/edit this
|
2022-03-03 20:05:55 +00:00
|
|
|
local terminal = "alacritty"
|
2022-06-07 02:15:35 +00:00
|
|
|
edit = "emacsclient -c -a emacs"
|
2022-03-03 20:05:55 +00:00
|
|
|
file = "alacritty -e ./.config/vifm/scripts/vifmrun"
|
|
|
|
web = "qutebrowser"
|
2022-04-18 21:29:56 +00:00
|
|
|
chat = "alacritty -e gomuks"
|
|
|
|
music = "alacritty -e cmus"
|
2022-03-03 20:05:55 +00:00
|
|
|
games = "retroarch"
|
|
|
|
screenlocker = "betterlockscreen -l"
|
|
|
|
local modkey = "Mod4"
|
|
|
|
local altkey = "Mod1"
|
|
|
|
local modkey1 = "Control"
|
2022-01-26 20:40:22 +00:00
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ TAG NAMES ]]--
|
2022-03-03 20:05:55 +00:00
|
|
|
awful.util.tagnames =
|
|
|
|
{
|
2022-02-07 07:19:05 +00:00
|
|
|
" EDIT ", -- F1
|
2022-01-26 20:40:22 +00:00
|
|
|
" FILE ", -- F2
|
|
|
|
" WEB ", -- F3
|
2022-04-18 21:29:56 +00:00
|
|
|
" CHAT ", -- F4
|
|
|
|
" MUSIC ", -- F5
|
2022-01-26 20:40:22 +00:00
|
|
|
" WORK ", -- XX
|
2022-02-07 07:19:05 +00:00
|
|
|
" MISC ", -- XX
|
2022-04-18 21:29:56 +00:00
|
|
|
" GAMES " -- F8
|
2022-01-26 20:40:22 +00:00
|
|
|
}
|
2022-01-01 00:29:27 +00:00
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ WIBOX & MISC STUFF ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.util.taglist_buttons = my_table.join(
|
|
|
|
awful.button({ }, 1, function(t) t:view_only() end),
|
|
|
|
awful.button({ modkey }, 1, function(t)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:move_to_tag(t)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3, awful.tag.viewtoggle),
|
|
|
|
awful.button({ modkey }, 3, function(t)
|
|
|
|
if client.focus then
|
|
|
|
client.focus:toggle_tag(t)
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
|
|
|
|
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
|
|
|
|
)
|
|
|
|
awful.util.tasklist_buttons = my_table.join(
|
|
|
|
awful.button({ }, 1, function (c)
|
|
|
|
if c == client.focus then
|
|
|
|
c.minimized = true
|
|
|
|
else
|
|
|
|
c:emit_signal("request::activate", "tasklist", {raise = true})
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 3, function ()
|
|
|
|
local instance = nil
|
|
|
|
|
|
|
|
return function ()
|
|
|
|
if instance and instance.wibox.visible then
|
|
|
|
instance:hide()
|
|
|
|
instance = nil
|
|
|
|
else
|
|
|
|
instance = awful.menu.clients({theme = {width = 250}})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end),
|
|
|
|
awful.button({ }, 4, function () awful.client.focus.byidx(1) end),
|
|
|
|
awful.button({ }, 5, function () awful.client.focus.byidx(-1) end)
|
|
|
|
)
|
|
|
|
screen.connect_signal("property::geometry", function(s)
|
|
|
|
if beautiful.wallpaper then
|
|
|
|
local wallpaper = beautiful.wallpaper
|
|
|
|
if type(wallpaper) == "function" then
|
|
|
|
wallpaper = wallpaper(s)
|
|
|
|
end
|
|
|
|
gears.wallpaper.maximized(wallpaper, s, true)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
|
|
|
|
|
2022-06-07 02:15:35 +00:00
|
|
|
-- Rounded Corners
|
|
|
|
client.connect_signal("manage", function (c)
|
|
|
|
c.shape = function(cr,w,h)
|
|
|
|
gears.shape.rounded_rect(cr,w,h,8)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ KEY BINDINGS ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Awesome things
|
|
|
|
globalkeys = my_table.join(
|
|
|
|
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description="Show this help menu", group="Quick Actions"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Reload WM", group = "Quick Actions"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
-- awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
|
|
|
-- {description = "Log Out", group = "Quick Actions"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Tag browsing arrow keys and escape
|
|
|
|
awful.key({ modkey, }, "Left", awful.tag.viewprev,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "view previous", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "Right", awful.tag.viewnext,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "view next", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "go back", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Tag browsing alt + tab
|
|
|
|
awful.key({ altkey, }, "Tab", awful.tag.viewnext,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "view next", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ altkey, "Shift" }, "Tab", awful.tag.viewprev,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "view previous", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Copy primary to clipboard (terminals to gtk)
|
|
|
|
awful.key({ modkey }, "c", function () awful.spawn.with_shell("xsel | xsel -i -b") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Copy terminal to gtk", group = "Hotkeys"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Copy clipboard to primary (gtk to terminals)
|
|
|
|
awful.key({ modkey }, "v", function () awful.spawn.with_shell("xsel -b | xsel") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Copy gtk to terminal", group = "Hotkeys"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Client focus
|
|
|
|
awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Focus next by index", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Focus previous by index", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Layout manipulation
|
|
|
|
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Swap with next client by index", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Swap with previous client by index", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Focus the next screen", group = "Screen"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Focus the previous screen", group = "Screen"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
|
2022-06-07 02:15:35 +00:00
|
|
|
{description = "Jump to urgent client", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "Tab",
|
|
|
|
function ()
|
|
|
|
awful.client.focus.history.previous()
|
|
|
|
if client.focus then
|
|
|
|
client.focus:raise()
|
|
|
|
end
|
|
|
|
end,
|
2022-06-07 02:15:35 +00:00
|
|
|
{description = "Go back", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Increase master width factor", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Decrease master width factor", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Increase the number of master clients", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Decrease the number of master clients", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Increase the number of columns", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Decrease the number of columns", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Select next", group = "Layout"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Select previous", group = "Layout"}),
|
2022-01-03 06:29:03 +00:00
|
|
|
-- Terminal
|
|
|
|
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Launch a terminal", group = "Hotkeys"}),
|
|
|
|
-- Dmenu
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "r", function () awful.util.spawn_with_shell("dmenu_run -l 10 -b -i -p Launch:") end,
|
|
|
|
{description = "Show run Launcher", group = "Hotkeys"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "d", function () awful.util.spawn_with_shell("dmenu_drun") end,
|
|
|
|
{description = "Show app Launcher", group = "Hotkeys"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "w", function () awful.util.spawn_with_shell("dmenu_wifi") end,
|
|
|
|
{description = "Configure wiFi", group = "Hotkeys"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "q", function () awful.util.spawn_with_shell("dmenu_power") end,
|
|
|
|
{description = "Show logout menu", group = "Hotkeys"}),
|
|
|
|
awful.key({ modkey, "Shift" }, "b", function () awful.util.spawn_with_shell("dmenu_wall") end,
|
|
|
|
{description = "Show wallpaper menu", group = "Hotkeys"}),
|
|
|
|
awful.key({}, "Print", function () awful.util.spawn_with_shell("dmenu_scrot") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Take screenshots", group = "Hotkeys"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Keyboard Layouts
|
|
|
|
awful.key({ modkey, "Shift" }, "e", function () awful.util.spawn("setxkbmap -layout es") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Switch to ES keyboard layout", group = "Quick Actions"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "u", function () awful.util.spawn("setxkbmap -layout us") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Switch to US keyboard layout", group = "Quick Actions"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Apps
|
2022-02-07 07:19:05 +00:00
|
|
|
-- edit
|
|
|
|
awful.key({ modkey }, "F1", function () awful.spawn(edit) end,
|
2022-02-28 03:08:25 +00:00
|
|
|
{description = "Launch text editor", group = "Apps"}),
|
2022-01-26 20:40:22 +00:00
|
|
|
-- file
|
|
|
|
awful.key({ modkey }, "F2", function () awful.spawn(file) end,
|
2022-02-28 03:08:25 +00:00
|
|
|
{description = "Launch file manager", group = "Apps"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- web
|
2022-01-26 20:40:22 +00:00
|
|
|
awful.key({ modkey }, "F3", function () awful.spawn(web) end,
|
2022-02-28 03:08:25 +00:00
|
|
|
{description = "Launch web browser", group = "Apps"}),
|
2022-04-18 21:29:56 +00:00
|
|
|
-- chat
|
|
|
|
awful.key({ modkey }, "F4", function () awful.spawn(chat) end,
|
|
|
|
{description = "Launch matrix client (chat)", group = "Apps"}),
|
2022-01-26 20:40:22 +00:00
|
|
|
-- music
|
2022-04-18 21:29:56 +00:00
|
|
|
awful.key({ modkey }, "F5", function () awful.spawn(music) end,
|
2022-02-28 03:08:25 +00:00
|
|
|
{description = "Launch music player", group = "Apps"}),
|
2022-01-26 20:40:22 +00:00
|
|
|
-- games
|
2022-04-18 21:29:56 +00:00
|
|
|
awful.key({ modkey }, "F8", function () awful.util.spawn(games) end,
|
2022-02-28 03:08:25 +00:00
|
|
|
{description = "Launch gaming app", group = "Apps"}),
|
2022-01-26 20:40:22 +00:00
|
|
|
-- Volume
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({}, "XF86AudioRaiseVolume", function() awful.spawn("pamixer -i 5") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Increase volume", group = "Quick Actions"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({}, "XF86AudioLowerVolume", function() awful.spawn("pamixer -d 5") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Decrease volume", group = "Quick Actions"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({}, "XF86AudioMute", function() awful.spawn("pamixer -t") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Mute volume", group = "Quick Actions"}),
|
2022-01-19 17:14:19 +00:00
|
|
|
-- Brightness
|
2022-03-02 04:51:50 +00:00
|
|
|
awful.key({}, "XF86MonBrightnessUp", function () awful.spawn("xbacklight -inc 10") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Increase brightness", group = "Quick Actions"}),
|
2022-03-02 04:51:50 +00:00
|
|
|
awful.key({}, "XF86MonBrightnessDown", function () awful.spawn("xbacklight -dec 10") end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Decrease brightness", group = "Quick Actions"}),
|
|
|
|
-- Screenlocker
|
2022-01-05 02:31:33 +00:00
|
|
|
awful.key({ modkey, modkey1 }, "l", function() awful.spawn(screenlocker) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Lock the screen", group = "Quick Actions"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Show/Hide Wibox
|
|
|
|
awful.key({ modkey }, "b", function ()
|
|
|
|
for s in screen do
|
|
|
|
s.mywibox.visible = not s.mywibox.visible
|
|
|
|
if s.mybottomwibox then
|
|
|
|
s.mybottomwibox.visible = not s.mybottomwibox.visible
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Toggle wibox", group = "Quick Actions"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- On the fly useless gaps change
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "j", function () lain.util.useless_gaps_resize(1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Increment gaps", group = "Tag"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "l", function () lain.util.useless_gaps_resize(-1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Decrement gaps", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Dynamic tagging
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "n", function () lain.util.add_tag() end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Add new tag", group = "Tag"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "r", function () lain.util.rename_tag() end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Rename tag", group = "Tag"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "Left", function () lain.util.move_tag(-1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Move tag to the left", group = "Tag"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "Right", function () lain.util.move_tag(1) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Move tag to the right", group = "Tag"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, modkey1, altkey }, "d", function () lain.util.delete_tag() end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Delete tag", group = "Tag"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Minimize, maximize, moving clients, fullscreen, etc
|
|
|
|
awful.key({ modkey, "Control" }, "n",
|
|
|
|
function ()
|
|
|
|
local c = awful.client.restore()
|
|
|
|
if c then
|
|
|
|
client.focus = c
|
|
|
|
c:raise()
|
|
|
|
end
|
|
|
|
end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Restore minimized", group = "Client"})
|
2022-01-01 00:29:27 +00:00
|
|
|
)
|
|
|
|
clientkeys = gears.table.join(
|
|
|
|
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Toggle fullscreen", group = "Client"}),
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Close window", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Toggle floating", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Move to master", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Move to screen", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Toggle keep on top", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "n",
|
|
|
|
function (c)
|
|
|
|
c.minimized = true
|
|
|
|
end ,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "Minimize", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, }, "m",
|
|
|
|
function (c)
|
|
|
|
c.maximized = not c.maximized
|
|
|
|
c:raise()
|
|
|
|
end ,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "(Un)maximize", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Control" }, "m",
|
|
|
|
function (c)
|
|
|
|
c.maximized_vertical = not c.maximized_vertical
|
|
|
|
c:raise()
|
|
|
|
end ,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "(Un)maximize vertically", group = "Client"}),
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.key({ modkey, "Shift" }, "m",
|
|
|
|
function (c)
|
|
|
|
c.maximized_horizontal = not c.maximized_horizontal
|
|
|
|
c:raise()
|
|
|
|
end ,
|
2022-01-26 20:40:22 +00:00
|
|
|
{description = "(Un)maximize horizontally", group = "Client"})
|
2022-01-01 00:29:27 +00:00
|
|
|
)
|
|
|
|
-- Bind all key numbers to tags.
|
|
|
|
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
|
|
|
-- This should map on the top row of your keyboard, usually 1 to 9.
|
|
|
|
for i = 1, 9 do
|
|
|
|
-- Hack to only show tags 1 and 9 in the shortcut window (mod+s)
|
|
|
|
local descr_view, descr_toggle, descr_move, descr_toggle_focus
|
|
|
|
if i == 1 or i == 9 then
|
2022-01-26 20:40:22 +00:00
|
|
|
descr_view = {description = "Wiew tag #", group = "Tag"}
|
|
|
|
descr_toggle = {description = "Toggle tag #", group = "Tag"}
|
|
|
|
descr_move = {description = "Move focused client to tag #", group = "Tag"}
|
|
|
|
descr_toggle_focus = {description = "Toggle focused client on tag #", group = "Tag"}
|
2022-01-01 00:29:27 +00:00
|
|
|
end
|
|
|
|
globalkeys = my_table.join(globalkeys,
|
|
|
|
-- View tag only.
|
|
|
|
awful.key({ modkey }, "#" .. i + 9,
|
|
|
|
function ()
|
|
|
|
local screen = awful.screen.focused()
|
|
|
|
local tag = screen.tags[i]
|
|
|
|
if tag then
|
|
|
|
tag:view_only()
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
descr_view),
|
|
|
|
-- Toggle tag display.
|
|
|
|
awful.key({ modkey, "Control" }, "#" .. i + 9,
|
|
|
|
function ()
|
|
|
|
local screen = awful.screen.focused()
|
|
|
|
local tag = screen.tags[i]
|
|
|
|
if tag then
|
|
|
|
awful.tag.viewtoggle(tag)
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
descr_toggle),
|
|
|
|
-- Move client to tag.
|
|
|
|
awful.key({ modkey, "Shift" }, "#" .. i + 9,
|
|
|
|
function ()
|
|
|
|
if client.focus then
|
|
|
|
local tag = client.focus.screen.tags[i]
|
|
|
|
if tag then
|
|
|
|
client.focus:move_to_tag(tag)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
descr_move),
|
|
|
|
-- Toggle tag on focused client.
|
|
|
|
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
|
|
|
|
function ()
|
|
|
|
if client.focus then
|
|
|
|
local tag = client.focus.screen.tags[i]
|
|
|
|
if tag then
|
|
|
|
client.focus:toggle_tag(tag)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
descr_toggle_focus)
|
|
|
|
)
|
|
|
|
end
|
2022-03-03 20:05:55 +00:00
|
|
|
-- Mouse bindings
|
2022-01-01 00:29:27 +00:00
|
|
|
clientbuttons = gears.table.join(
|
|
|
|
awful.button({ }, 1, function (c)
|
|
|
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
|
|
|
end),
|
|
|
|
awful.button({ modkey }, 1, function (c)
|
|
|
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
|
|
|
awful.mouse.client.move(c)
|
|
|
|
end),
|
|
|
|
awful.button({ modkey }, 3, function (c)
|
|
|
|
c:emit_signal("request::activate", "mouse_click", {raise = true})
|
|
|
|
awful.mouse.client.resize(c)
|
|
|
|
end)
|
|
|
|
)
|
|
|
|
root.keys(globalkeys)
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ RULES ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
awful.rules.rules = {
|
|
|
|
-- All clients will match this rule.
|
|
|
|
{ rule = { },
|
|
|
|
properties = { border_width = beautiful.border_width,
|
|
|
|
border_color = beautiful.border_normal,
|
|
|
|
focus = awful.client.focus.filter,
|
|
|
|
raise = true,
|
|
|
|
keys = clientkeys,
|
|
|
|
buttons = clientbuttons,
|
|
|
|
screen = awful.screen.preferred,
|
|
|
|
placement = awful.placement.no_overlap+awful.placement.no_offscreen,
|
|
|
|
callback = awful.client.setslave
|
|
|
|
}
|
2022-03-03 20:05:55 +00:00
|
|
|
},
|
2022-01-01 00:29:27 +00:00
|
|
|
-- Floating clients.
|
|
|
|
{ rule_any = {
|
|
|
|
instance = {
|
|
|
|
"DTA", -- Firefox addon DownThemAll.
|
|
|
|
"copyq", -- Includes session name in class.
|
|
|
|
"pinentry",
|
|
|
|
},
|
|
|
|
class = {
|
|
|
|
"Arandr",
|
|
|
|
"Blueman-manager",
|
|
|
|
"Gpick",
|
|
|
|
"Kruler",
|
|
|
|
"MessageWin", -- kalarm.
|
|
|
|
-- "Sxiv",
|
|
|
|
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
|
|
|
|
"Wpa_gui",
|
|
|
|
"veromix",
|
|
|
|
"xtightvncviewer"},
|
|
|
|
-- 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 }},
|
|
|
|
}
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ SIGNALS ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
client.connect_signal("manage", function (c)
|
|
|
|
if awesome.startup and
|
|
|
|
not c.size_hints.user_position
|
|
|
|
and not c.size_hints.program_position then
|
|
|
|
awful.placement.no_offscreen(c)
|
|
|
|
end
|
|
|
|
end)
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
-- [[ MOUSE FOCUS ]]--
|
2022-01-01 00:29:27 +00:00
|
|
|
client.connect_signal("mouse::enter", function(c)
|
|
|
|
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
|
|
|
end)
|
|
|
|
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
|
|
|
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
|
|
|
|
2022-04-18 21:29:56 +00:00
|
|
|
--[[ AUTOSTART ]]--
|
2022-01-26 20:40:22 +00:00
|
|
|
awful.util.spawn_with_shell("sh $HOME/.fehbg &")
|
|
|
|
awful.util.spawn_with_shell("lxpolkit &")
|
2022-03-02 04:51:50 +00:00
|
|
|
awful.util.spawn_with_shell("picom --config $HOME/.config/picom/picom.conf &")
|
2022-06-07 02:15:35 +00:00
|
|
|
awful.util.spawn_with_shell("dunst -c $HOME/.config/dunst/dunstrc &")
|