summaryrefslogtreecommitdiff
path: root/awesome/noborders.lua
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2024-09-28 22:47:28 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2024-09-28 22:47:28 -0500
commit9d7c46cb29293c5f553f1204c25d9afa7506f8c2 (patch)
tree34f95a3eae0c0adacd3d766c4478195f0c8d32d3 /awesome/noborders.lua
parentad8a5145c3db84ae34d2f475eff35427640ba64b (diff)
parentd1f9ee5eced0c273de6c598f88ddb0f7b4e54230 (diff)
downloaddotconfig-9d7c46cb29293c5f553f1204c25d9afa7506f8c2.tar.xz
dotconfig-9d7c46cb29293c5f553f1204c25d9afa7506f8c2.zip
Merge branch 'master' of localgit:dotconfig
Diffstat (limited to 'awesome/noborders.lua')
-rw-r--r--awesome/noborders.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/awesome/noborders.lua b/awesome/noborders.lua
new file mode 100644
index 0000000..fe67024
--- /dev/null
+++ b/awesome/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