2023-07-06 18:26:47 +00:00
|
|
|
(defwidget workspaces_button []
|
|
|
|
|
(eventbox
|
2023-10-13 16:35:31 +00:00
|
|
|
:onscroll "hyprctl dispatch workspace e${matches({},"up") ? '+' : '-' }1"
|
2023-07-06 18:26:47 +00:00
|
|
|
:onclick "hyprctl dispatch workspace ${workspace_total + 1}"
|
|
|
|
|
(box :class "workspace_button"
|
|
|
|
|
"${workspace_active}/${workspace_total}")))
|
|
|
|
|
|
2023-10-13 16:35:31 +00:00
|
|
|
(defpoll workspace_total :interval "1s" "hyprctl workspaces | grep ID | cut -c 2-2<<< $(awk 'END{print $4}')")
|
|
|
|
|
(defpoll workspace_active :interval "1s" "hyprctl activeworkspace |grep ID | cut -c 1-1<<< $(awk 'FNR == 1 {print $3}')")
|
2023-07-06 18:26:47 +00:00
|
|
|
|