diff options
author | Aylur <[email protected]> | 2024-10-13 03:42:51 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-13 03:42:51 +0200 |
commit | ec5c6c9acc418946bfe7f28ffdd4803c712b3b53 (patch) | |
tree | 06494479c28445c447f1a0a615da13cb2efb2c19 /examples | |
parent | dd3bae59362f0b6c3d47cc81b5c53888362e75fc (diff) | |
parent | 79a96d44b85a6b6e287957f413f98d3812335d52 (diff) |
Merge pull request #38 from tokyob0t/main
Improve showcases doc site
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lua/simple-bar/widget/Bar.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/lua/simple-bar/widget/Bar.lua b/examples/lua/simple-bar/widget/Bar.lua index d44db2d..d340cba 100644 --- a/examples/lua/simple-bar/widget/Bar.lua +++ b/examples/lua/simple-bar/widget/Bar.lua @@ -134,6 +134,10 @@ local function Workspaces() return Widget.Box({ class_name = "Workspaces", bind(hypr, "workspaces"):as(function(wss) + table.sort(wss, function(a, b) + return a.id < b.id + end) + return map(wss, function(ws) return Widget.Button({ class_name = bind(hypr, "focused-workspace"):as(function(fw) @@ -142,7 +146,9 @@ local function Workspaces() on_clicked = function() ws:focus() end, - label = bind(ws, "id"):as(tostring), + label = bind(ws, "id"):as(function(v) + return type(v) == "number" and string.format("%.0f", v) or v + end), }) end) end), |