(defwidget bar []
  (centerbox :orientation "h"
    (leftgroup)
    (centergroup)
    (rightgroup)))

;widget templates
(include "modules/bar/revealer-on-hover.yuck")
(include "modules/bar/metric.yuck")

;centerbar groups

(defwidget leftgroup []
  (box :class "leftgroup" :orientation "h" :space-evenly false :halign "start"
    (powermenu)
    (profile)
    (workspaces :array workspacesArray)
    (windowtitle)
    (scratchpad)))

;(deflisten scratchpadArray :initial "${[1]}"
;  'scripts/bar/scratchpad')
;(defwidget scratchpad [array]
;  (box :orientation "v"
;       :space-evenly false
;       :class "workspaces"
;    (box :space-evenly false
;      (for entry in array
;        (button :onclick 'swaymsg [con_id=${entry.win_id}] focus'
;                :tooltip "${entry.name}
;${entry.title}"
;          (image :path {entry.icon}
;               :image-width 25
;               :image-height 25)
;        )))))
;      (image :path "/usr/share/icons/hicolor/scalable/apps/org.kde.dolphin.svg"
;             :image-width 25
;             :image-height 25)
;      (image :path "/usr/share/icons/hicolor/32x32/apps/librewolf.png"
;             :image-width 25
;             :image-height 25
;       )))

(defwidget centergroup []
  (box :class "centergroup" :orientation "h" :space-evenly false :halign "start"
    (music)))

(defwidget rightgroup []
  (box :class "rightgroup" :orientation "h" :space-evenly false :halign "end"
    (idleinhibit)
    (volume)
    (network)
    (vpn)
    (bluetooth)
    (battery)
    (sysdisk)
    (sysmem)
    (clock)
    (tray)))

;leftgroup
(include "modules/bar/powermenu.yuck")
(include "modules/bar/profile.yuck")
(include "modules/bar/workspaces.yuck")
(include "modules/bar/window_name.yuck")
(include "modules/bar/scratchpad.yuck")

;centergroup
(include "variables/bar/music.yuck")
(include "modules/bar/music.yuck")

;rightgroup
(include "modules/bar/idle_inhibit.yuck")
(include "modules/bar/volume.yuck")
(include "variables/bar/network.yuck")
(include "modules/bar/network.yuck")
(include "modules/bar/vpn.yuck")
(include "variables/bar/bluetooth.yuck")
(include "modules/bar/bluetooth.yuck")
(include "modules/bar/battery.yuck")
(include "modules/bar/sysdisk.yuck")
(include "modules/bar/sysmem.yuck")
(include "modules/bar/clock.yuck")
(include "modules/bar/tray.yuck")
