Reset old config

This commit is contained in:
2021-08-01 07:24:26 -07:00
commit 7cc3903efe
144 changed files with 16466 additions and 0 deletions

31
clients/binds/buttons.lua Executable file
View File

@ -0,0 +1,31 @@
-- Make sure clients and titlebars don't share bids. Both will trigger,
-- and that will cause problems. See titlebar.lua
return gears.table.join(
awful.button( {}, 1,
function(client)
client:emit_signal("request::activate", "mouse_click", {raise = true})
end
),
awful.button( {"Mod4"}, 1,
function(client)
client:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.move(client)
end
),
awful.button( {"Mod4", "Control"}, 1,
function(client)
client:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.resize(client)
end
),
awful.button( {"Mod4"}, 3,
function(client)
client:emit_signal("request::activate", "mouse_click", {raise = true})
awful.mouse.client.resize(client)
end
)
)

129
clients/binds/keys.lua Executable file
View File

@ -0,0 +1,129 @@
return gears.table.join(
awful.key( {"Mod4", "Control"}, "Left",
function (c)
c.screen.tagger:move_client(c, "left")
end,
{
description = "move client left",
group = "client"
}
),
awful.key( {"Mod4", "Control"}, "Right",
function (c)
c.screen.tagger:move_client(c, "right")
end,
{
description = "move client right",
group = "client"
}
),
awful.key( {"Mod4", "Control"}, "Down",
function (c)
c.screen.tagger:move_client(c, "down")
end,
{
description = "move client down",
group = "client"
}
),
awful.key( {"Mod4", "Control"}, "Up",
function (c)
c.screen.tagger:move_client(c, "up")
end,
{
description = "move client up",
group = "client"
}
),
awful.key( {"Mod4"}, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{
description = "toggle fullscreen",
group = "client"
}
),
awful.key( {"Mod4", "Shift"}, "c",
function (c)
c:kill()
end,
{
description = "close",
group = "client"
}
),
awful.key( {"Mod4", "Control"}, "space",
awful.client.floating.toggle,
{
description = "toggle floating",
group = "client"
}
),
awful.key( {"Mod4", "Control"}, "Return",
function (c)
c:swap(awful.client.getmaster())
end,
{
description = "move to master",
group = "client"
}
),
awful.key( {"Mod4"}, "t",
function (c)
c.ontop = not c.ontop
end,
{
description = "toggle keep on top",
group = "client"
}
),
awful.key( {"Mod4"}, "n",
function (c)
c.minimized = true
end,
{
description = "minimize",
group = "client"
}
),
awful.key( {"Mod4"}, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end,
{
description = "(un)maximize", group = "client"
}
),
awful.key( {"Mod4", "Control"}, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end,
{
description = "(un)maximize vertically",
group = "client"
}
),
awful.key( {"Mod4", "Shift"}, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end,
{
description = "(un)maximize horizontally",
group = "client"
}
)
)

20
clients/binds/titlebar.lua Executable file
View File

@ -0,0 +1,20 @@
-- Make sure clients and titlebars don't share bids. Both will trigger,
-- and that will cause problems. See buttons.lua
return function(client)
return gears.table.join(
awful.button( {}, 1,
function()
client:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.move(client)
end
),
awful.button( {}, 3,
function()
client:emit_signal("request::activate", "titlebar", {raise = true})
awful.mouse.client.resize(client)
end
)
)
end

24
clients/render.lua Executable file
View File

@ -0,0 +1,24 @@
local render = {}
render.renderClient = function(client)
if not beautiful.rounded_corners then
return
end
if (not beautiful.disable_rounded_corners) and (
client.first_tag.layout == awful.layout.suit.floating or
client.floating
) then
client.shape = function(cr, w, h)
gears.shape.rounded_rect(cr, w, h, beautiful.corner_radius, beautiful.corner_radius)
end
else
client.shape = function(cr, w, h)
gears.shape.rectangle(cr, w, h)
end
end
end
return render

78
clients/rules.lua Executable file
View File

@ -0,0 +1,78 @@
local client_buttons = require("clients.binds.buttons")
local client_keys = require("clients.binds.keys")
-- Use xprop to get client properties.
return {
-- 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,
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
screen = awful.screen.preferred,
buttons = client_buttons,
keys = client_keys,
}
},
-- Designate floating clients.
{
rule_any = {
class = {
"feh",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"zoom",
"flameshot"
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", "Popup"
}
},
properties = { floating = true }
},
-- Keep passwordsafe on top
{
rule_any = { class={"pwsafe","Pwsafe"} },
properties = {
floating = true,
ontop = true
}
},
-- Custom rules for a floating, transparent terminal
{
rule = { class="kitty-noblur" },
properties = {
floating = true,
ontop = true,
sticky = true,
border_color = beautiful.titlebar_fg_normal,
border_width = 0
}
},
-- Set Firefox to always map on the tag named "2" on screen 1.
--[[
{
rule = { class="Firefox" },
properties = {
screen = 1,
tag = "2"
}
},
--]]
}

55
clients/signals.lua Executable file
View File

@ -0,0 +1,55 @@
-- Signal function to execute when a new client appears.
-- Run in rc.lua
local titlebar = require("clients.titlebar")
local render = require("clients.render")
-- Add a titlebar
client.connect_signal("request::titlebars", titlebar.add)
-- Update titlebars when a screen is arranged
screen.connect_signal("arrange",
function(screen)
for _, client in pairs(screen.clients) do
titlebar.update(client)
render.renderClient(client)
end
end
)
client.connect_signal("manage",
function (client)
-- Update titlebar status
titlebar.update(client)
render.renderClient(client)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
-- Prevent clients from being unreachable after screen count changes.
if awesome.startup and not (
client.size_hints.user_position or client.size_hints.program_position
) then
awful.placement.no_offscreen(client)
end
end
)
--[[ Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter",
function(c)
c:emit_signal(
"request::activate",
"mouse_enter",
{
raise = true
}
)
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)

72
clients/titlebar.lua Executable file
View File

@ -0,0 +1,72 @@
-- Per-client titlebar setup
-- Required in rc.lua
local titlebar = {}
-- bar_buttons is a function. Whenever a title bar is created, its button binds
-- must be specific to the client it's attached to!
local bar_buttons = require("clients.binds.titlebar")
titlebar.add = function(client)
local bar = awful.titlebar(client, {
position = "left",
size = beautiful.dpi(25)
})
bar : setup {
-- Top segment
{
{
--awful.titlebar.widget.iconwidget(client),
awful.titlebar.widget.closebutton(client),
awful.titlebar.widget.minimizebutton(client),
awful.titlebar.widget.maximizedbutton(client),
spacing = beautiful.titlebar_spacing,
layout = wibox.layout.fixed.vertical
},
margins = beautiful.titlebar_margins,
widget = wibox.container.margin
},
-- Middle segment
{
--[[{} Title
align = "center",
widget = awful.titlebar.widget.titlewidget(client)
},]]
buttons = bar_buttons(client),
layout = wibox.layout.flex.vertical
},
-- Bottom segment
{
{
awful.titlebar.widget.floatingbutton(client),
awful.titlebar.widget.stickybutton(client),
awful.titlebar.widget.ontopbutton(client),
spacing = beautiful.titlebar_spacing,
layout = wibox.layout.fixed.vertical
},
margins = beautiful.titlebar_margins,
widget = wibox.container.margin
},
layout = wibox.layout.align.vertical
}
end
titlebar.update = function(client)
if (
(client.first_tag.layout == awful.layout.suit.floating or client.floating) and
--not (client.maximized) and
not (client.requests_no_titlebar)
) then
awful.titlebar.show(client, "left")
else
awful.titlebar.hide(client, "left")
end
end
return titlebar