diff options
author | Tim Keller <tjk@tjkeller.xyz> | 2024-10-18 21:49:17 -0500 |
---|---|---|
committer | Tim Keller <tjk@tjkeller.xyz> | 2024-10-18 21:49:17 -0500 |
commit | 923eb46350b1102749eb05cd2120c96cc6a715d0 (patch) | |
tree | 811da20b4195d4b5c65c8ac0090982a4a23f6a7d /func/noborders.lua | |
download | awesome-923eb46350b1102749eb05cd2120c96cc6a715d0.tar.xz awesome-923eb46350b1102749eb05cd2120c96cc6a715d0.zip |
initial commit
Diffstat (limited to 'func/noborders.lua')
-rw-r--r-- | func/noborders.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/func/noborders.lua b/func/noborders.lua new file mode 100644 index 0000000..fe67024 --- /dev/null +++ b/func/noborders.lua @@ -0,0 +1,20 @@ +local beautiful = require("beautiful") + +-- TODO this function will call arrange multiple times. once per each change of c.border_width +local function update_borders(s) + local max = s.selected_tag.layout.name == "max" + local only_one = #s.tiled_clients == 1 -- use tiled_clients so that other floating windows don't affect the count + + -- but iterate over clients instead of tiled_clients as tiled_clients doesn't include maximized windows + for _, c in pairs(s.clients) do + if c.prevent_kill then + c.border_width = beautiful.border_width * 3 + elseif (max or only_one or c.maximized) and not c.floating then + c.border_width = 0 + else + c.border_width = beautiful.border_width + end + end +end + +screen.connect_signal("arrange", update_borders) -- NOTE this signal may eventually be deprecated. see issue #2581 and the v5 milestone on github |