2022-08-24 18:17:29 +02:00
|
|
|
#!/usr/bin/env lua
|
|
|
|
|
|
|
|
aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
|
|
|
active_workspace = aw:read("*a")
|
|
|
|
aw:close()
|
|
|
|
|
|
|
|
box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" "
|
|
|
|
|
2022-08-24 23:44:40 +02:00
|
|
|
for i = 1,10 do
|
|
|
|
if i == tonumber(active_workspace) then
|
|
|
|
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..i.." \" \"\")"
|
2022-08-24 18:17:29 +02:00
|
|
|
box = box .. btn
|
2022-08-24 23:44:40 +02:00
|
|
|
else
|
|
|
|
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..i.."\" \"\")"
|
2022-08-24 18:17:29 +02:00
|
|
|
box = box .. btn
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
box = box .. ")"
|
|
|
|
|
|
|
|
print(box)
|