29 lines
1.2 KiB
Text
29 lines
1.2 KiB
Text
(defvar reveal_scratchpad false)
|
|
(defwidget scratchpad []
|
|
|
|
(box :class "${reveal_scratchpad} scratchpad revealer-on-hover"
|
|
:orientation "h"
|
|
:space-evenly false
|
|
(eventbox :onhover "${EWW_CMD} update reveal_scratchpad=true"
|
|
:onhoverlost "${EWW_CMD} update reveal_scratchpad=false"
|
|
(box :space-evenly false
|
|
(label :class "revealer-preview"
|
|
:tooltip "${jq(sway_info,'.scratchpad_info[] | "\\(.title) (\\(.name)) \\n"','r')}"
|
|
:text " ${jq(sway_info,'.scratchpad_info | length')} ${reveal_scratchpad ? '' : ''}")
|
|
(revealer :reveal reveal_scratchpad
|
|
:transition "slideright"
|
|
:duration "500ms"
|
|
(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)))))
|