1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 11:24:24 +02:00
ironbar/docs/modules/Clipboard.md
Jake Stanger dea66415c2
feat: module-level name and class options
BREAKING CHANGE: To allow for the `name` property, any widgets that were previously targeted by name should be targeted by class instead. This affects **all modules and all popups**, as well as several widgets inside modules. **This will break a lot of rules in your stylesheet**. To attempt to mitigate the damage, a migration script can be found [here](https://raw.githubusercontent.com/JakeStanger/ironbar/master/scripts/migrate-styles.sh) that should get you most of the way.

Resolves #75.
2023-05-06 13:22:35 +01:00

4.2 KiB

Shows recent clipboard items, allowing you to switch between them to re-copy previous values. Clicking the icon button opens the popup containing all functionality.

Supports plain text and images.

Screenshot of clipboard popup open, with two textual values and an image copied. Several other unrelated widgets are visible on the bar.

Configuration

Type: clipboard

Name Type Default Description
icon string/image 󰨸 Icon to show on the widget button.
icon_size integer 32 Size to render icon at (image icons only).
max_items integer 10 Maximum number of items to show in the popup.
truncate start or middle or end or Map null The location of the ellipses and where to truncate text from. Leave null to avoid truncating. Use the long-hand Map version if specifying a length.
truncate.mode start or middle or end null The location of the ellipses and where to truncate text from. Leave null to avoid truncating.
truncate.length integer null The fixed width (in chars) of the widget. Leave blank to let GTK automatically handle.
truncate.max_length integer null The maximum number of characters before truncating. Leave blank to let GTK automatically handle.

See here for information on images.

JSON
{
  "end": {
    "type": "clipboard",
    "max_items": 3,
    "truncate": {
      "mode": "end",
      "length": 50
    }
  }
}
TOML
[[end]]
type = "clipboard"
max_items = 3

[[end.truncate]]
mode = "end"
length = 50
YAML
end:
  - type: 'clipboard'
    max_items: 3
    truncate:
      mode: 'end'
      length: 50
Corn
{
    end = [ { 
        type = "clipboard" 
        max_items = 3 
        truncate.mode = "end" 
        truncate.length = 50 
    } ] 
}

Styling

Selector Description
.clipboard Clipboard widget.
.clipboard .btn Clipboard widget button.
.popup-clipboard Clipboard popup box.
.popup-clipboard .item Clipboard row item inside the popup.
.popup-clipboard .item .btn Clipboard row item radio button.
.popup-clipboard .item .btn.text Clipboard row item radio button (text values only).
.popup-clipboard .item .btn.image Clipboard row item radio button (image values only).
.popup-clipboard .item .btn-remove Clipboard row item remove button.

For more information on styling, please see the styling guide.