Skip to content

Commit

Permalink
rule cleanup for qterminal dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintRyoh committed Jun 30, 2024
1 parent db273b5 commit 0a18cac
Showing 1 changed file with 28 additions and 58 deletions.
86 changes: 28 additions & 58 deletions rabbithole/components/rules/client-default.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ local gears = require("gears")

-- reading
-- https://awesomewm.org/apidoc/libraries/awful.rules.html
-- https://awesomewm.org/doc/api/libraries/awful.rules.html

return setmetatable({}, {
__constructor = function(rabbithole__components__keys__client, rabbithole__components__buttons__client)
local rules = {
local Rules = {}
Rules.__index = Rules

function Rules.new(
rabbithole__components__keys__client,
rabbithole__components__buttons__client
)
return {
-- All clients will match this rule.
{
rule = {},
properties = {
titlebars_enabled = true,
focus = awful.client.focus.filter,
raise = false,
keys = rabbithole__components__keys__client,
Expand All @@ -21,77 +28,40 @@ return setmetatable({}, {
},
-- Dialogs
{
rule_any = {
type = {"normal", "dialog"}
},
properties = {
titlebars_enabled = true
}
}, -- no titlebars for launchers
{
rule_any = {
class = {"dmenu", "rofi", "lxqt-runner"}
rule = {
type = "dialog"
},
properties = {
titlebars_enabled = false,
placement = awful.placement.centered,
titlebars_enabled = true,
skip_taskbar = true,
floating = true,
ontop = true,
sticky = true
ontop = true
}
},
-- No titlebars for terminal (alacritty)
},
-- Launchers
{
rule_any = {
class = {"Alacritty"}
class = {"dmenu", "rofi", "lxqt-runner", "qterminal"},
},
properties = {
titlebars_enabled = false
}
},
-- No titlesbars for kitty terminal
{
rule_any = {
class = {"kitty"}
except = {
type = "normal"
},
properties = {
titlebars_enabled = false
titlebars_enabled = false,
placement = awful.placement.centered,
sticky = true
}
},
-- Set window corner rounding to 5px
{
rule_any = {
type = {"normal", "dialog"}
},
callback = function(c)
gears.surface.apply_shape_bounding(c, gears.shape.rounded_rect, 5)
end
}, -- Round client window borders
{
rule_any = {
type = {"normal", "dialog"}
},
callback = function(c)
if c.round_corners then
return
end

c.shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 10)
end

c.round_corners = true
end
}, -- Clients with custom titlebars.
-- Clients with custom titlebars.
{
rule = {
requests_no_titlebar = true
},
properties = {
titlebars_enabled = false
}
}}
return rules
end
})
}
}
end

return Rules

0 comments on commit 0a18cac

Please sign in to comment.