summaryrefslogtreecommitdiff
path: root/examples/lua/simple-bar/widget
diff options
context:
space:
mode:
authorrRedLim <[email protected]>2024-12-20 02:21:09 +0300
committerGitHub <[email protected]>2024-12-20 00:21:09 +0100
commitd16c856074531b9fb867b8922be370bcfc749614 (patch)
tree08ee70023bf18a6dc39f312269c0a4e63ff0b7e0 /examples/lua/simple-bar/widget
parent23083cdec69853bc8e480807a5f93b03df340183 (diff)
chore: simple-bar filter special workspaces (#168)
Diffstat (limited to 'examples/lua/simple-bar/widget')
-rw-r--r--examples/lua/simple-bar/widget/Bar.lua24
1 files changed, 13 insertions, 11 deletions
diff --git a/examples/lua/simple-bar/widget/Bar.lua b/examples/lua/simple-bar/widget/Bar.lua
index e7bd4ff..5e62253 100644
--- a/examples/lua/simple-bar/widget/Bar.lua
+++ b/examples/lua/simple-bar/widget/Bar.lua
@@ -127,17 +127,19 @@ local function Workspaces()
end)
return map(wss, function(ws)
- return Widget.Button({
- class_name = bind(hypr, "focused-workspace"):as(function(fw)
- return fw == ws and "focused" or ""
- end),
- on_clicked = function()
- ws:focus()
- end,
- label = bind(ws, "id"):as(function(v)
- return type(v) == "number" and string.format("%.0f", v) or v
- end),
- })
+ if !(ws.id >= -99 and ws.id <= -2) then -- filter out special workspaces
+ return Widget.Button({
+ class_name = bind(hypr, "focused-workspace"):as(function(fw)
+ return fw == ws and "focused" or ""
+ end),
+ on_clicked = function()
+ ws:focus()
+ end,
+ label = bind(ws, "id"):as(function(v)
+ return type(v) == "number" and string.format("%.0f", v) or v
+ end),
+ })
+ end
end)
end),
})