(deflisten workspace :initial '[]' "scripts/workspaces")

(defwidget workspace-mod []
  	(module
  	  	(eventbox
			:onscroll "echo {} | sed -e 's/up/-1/' -e 's/down/+1/' | xargs -I % hyprctl eval \"hl.dispatch(hl.dsp.focus({ workspace = '%' }))\""

			(box
				:class "module workspaces"
				:orientation "v"
				(for ws in workspace
					(button
						:onclick "hyprctl  eval \"hl.dispatch(hl.dsp.focus({ workspace = '${ws.number}' }))\""
						(label 
							:show-truncated false
							:class "icon-text  ${ws.color}"
							:text `${ws.focused ? "󰜗" : "󰝥"}`
						)
					)
				)
			)
	  	)
	)
)
