dotfiles/de/home/.config/eww/modules/bar/scratchpad.yuck
2026-01-22 12:42:59 -08:00

25 lines
1,013 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"
:tooltip "${jq(sway_info,'.scratchpad_info[] | "\\(.title) (\\(.name)) \\n"','r')}"
:text " ${jq(sway_info,'.scratchpad_info | length')} ${reveal_scratchpad ? '' : ''}")
(scratchpad_children :array {jq(sway_info,'.scratchpad_info','r')})))
(defwidget scratchpad_children [array]
(box :orientation "h"
:class "reveal-children"
:space-evenly false
(for entry in array
(button :onclick 'swaymsg [con_id=${entry.window_id}] scratchpad show'
:class "scratchpad-item ${(entry.visible == 'true') ? 'active' : 'inactive'}"
:tooltip "${entry.title}
${entry.name}"
(image :path {entry.icon}
:image-width 20
:image-height 20)
))))