From 06d632dd8a5a99a6600c3e4cf53e534f1d755f90 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Mon, 25 Oct 2021 16:29:50 +1100 Subject: [PATCH] evenly distributed the 10 max workspaces between all displays --- rc.lua | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/rc.lua b/rc.lua index 4ed8868..2ea7f70 100644 --- a/rc.lua +++ b/rc.lua @@ -202,26 +202,16 @@ awful.screen.connect_for_each_screen(function(s) -- Each screen has its own tag table. local tags = {} - if screen:count() > 1 then - if s.geometry.width > s.geometry.height then -- landscape - for i = 1, 2 do - tags[#tags+1] = tostring(workspaceCounter) - workspaceCounter = workspaceCounter + 1 - end - awful.tag(tags, s, awful.layout.suit.floating) - else -- portrait - for i = 1, 4 do - tags[#tags+1] = tostring(workspaceCounter) - workspaceCounter = workspaceCounter + 1 - end - awful.tag(tags, s, awful.layout.suit.fair.horizontal) - end - else - for i = 1, 10 do - tags[#tags+1] = tostring(workspaceCounter) - workspaceCounter = workspaceCounter + 1 - end + for i = 1, math.floor(10 / screen:count()) do + tags[#tags+1] = tostring(workspaceCounter) + workspaceCounter = workspaceCounter + 1 + end + if screen:count() > 1 and s.geometry.width > s.geometry.height then -- landscape, multiple displays + awful.tag(tags, s, awful.layout.suit.floating) + elseif s.geometry.width > s.geometry.height then -- landscape, single display awful.tag(tags, s, awful.layout.suit.fair) + else -- portrait + awful.tag(tags, s, awful.layout.suit.fair.horizontal) end -- Create a promptbox for each screen