dotfiles/de/home/.config/eww/modules/bar/scratchpad.yuck
2025-09-06 13:00:01 -07:00

25 lines
946 B
Text

(defvar reveal_scratchpad false)
(defwidget scratchpad []
(revealer-on-hover
:class "${reveal_scratchpad} scratchpad"
:revealvar reveal_scratchpad
:revealvar-name "reveal_scratchpad"
(label
:class "revealer-preview"
:text " ${reveal_scratchpad ? '' : ''}")
(scratchpad_children :array scratchpadArray)))
(deflisten scratchpadArray :initial "${[{"icon": "/usr/share/icons/breeze-dark/mimetypes/32/unknown.svg", "name": "placeholder", "title": "placeholder", "win_id": "0"}]}"
'scripts/bar/scratchpad')
(defwidget scratchpad_children [array]
(box :orientation "h"
:class "reveal-children"
: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 20
:image-height 20)
))))