Popup width #357
-
Is it currently possible to set the width of a popup or a max-width to prevent one from growing too large from items contained within it? I couldn't seem to find a way to implement this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The width of a popup is controlled by the widest item in the popup. Items have no way to set a maximum "content-length". The So, currently, the width of the popup can be controlled by truncating the content of the widest item only, e.g. TRUNCATED="$(echo "$CONTENT" | sed 's/\(.\{20\}\).*/\1.../')" truncates the |
Beta Was this translation helpful? Give feedback.
The width of a popup is controlled by the widest item in the popup. Items have no way to set a maximum "content-length". The
width
property only controls the width of the "reserved space" for that item and the content can outgrow this reserved space.So, currently, the width of the popup can be controlled by truncating the content of the widest item only, e.g.
TRUNCATED="$(echo "$CONTENT" | sed 's/\(.\{20\}\).*/\1.../')"
truncates the
$CONTENT
at 20 characters with three dots. Thats the way I did it for my spotify popup widget:https://github.com/FelixKratz/dotfiles/blob/13b61b202972fe0e97f0afc8b2eeca38cd9c09dd/.config/sketchybar/plugins/spotify.sh#L47