Label
Displays custom text, with markup support.
If you only intend to run a single script, prefer the script module. For more advanced use-cases, use custom.
Example
{ end = [ { type = "label" label = "random num: {{500:echo \$RANDOM}}" } ]}{ "end": [ { "type": "label", "label": "random num: {{500:echo $RANDOM}}" } ]}end: - type: label label: "random num: {{500:echo $RANDOM}}"[[end]]type = "label"label = "random num: {{500:echo $RANDOM}}"Configuration
Type:
label
justify
Section titled “justify”The justification (alignment) of the widget text shown on the bar.
Type: 'left' | 'right' | 'center' | 'fill'
Default: 'left'
labelRequired
Section titled “labelRequired”The text to show on the label. This is a Dynamic String.
Required
Type: string
Default: None
orientation
Section titled “orientation”The orientation to display the widget contents. Setting to vertical will rotate text 90 degrees.
Type: 'horizontal' | 'vertical'
Default: 'horizontal'
truncateEnum
Section titled “truncateEnum”See truncate options.
Default: None
Do not truncate content.
Setting this option may cause excessively long content to overflow other widgets, shifting them off-screen.
Example
Section titled “Example”{ truncate = "off" }{ "truncate": "off"}truncate: offtruncate = "off"2'none' | 'start' | 'middle' | 'end'
Section titled “2'none' | 'start' | 'middle' | 'end'”Auto mode lets GTK decide when to ellipsize.
To use this mode, set the truncate option to a string declaring the location to truncate text from and place the ellipsis.
Example
Section titled “Example”{ truncate = "start" }{ "truncate": "start"}truncate: starttruncate = "start"3object
Section titled “3object”Length mode defines a fixed point at which to ellipsize.
Generally you will want to set only one of length or max_length,
but you can set both if required.
Example
Section titled “Example”{ truncate.mode = "start" truncate.length = 50 truncate.max_length = 70}{ "truncate": { "mode": "start", "length": 50, "max_length": 70 }}truncate: mode: start length: 50 max_length: 70[truncate]mode = "start"length = 50max_length = 70Object keys
object.length
Section titled “object.length”The fixed width (in characters) of the widget.
The widget will be expanded to this width if it would have otherwise been smaller.
Leave unset to let GTK automatically handle.
Type: integer
Default: None
object.max_length
Section titled “object.max_length”The maximum number of characters to show before truncating.
Leave unset to let GTK automatically handle.
Type: integer
Default: None
object.modeRequired
Section titled “object.modeRequired”The location to truncate text from and place the ellipsis.
Type: 'none' | 'start' | 'middle' | 'end'
Default: None
Styling
| Selector | Description |
|---|---|
.label | Label widget |
For more information on styling, please see the styling guide.