Custom widgets

> Published on Sun, 3 Dec 2023, 17:32> Updated on Sun, 17 Dec 2023, 16:50

Going further

If the default widgets exposed by simple-bar are not enough for you, you can create your own widgets and add them to the bar.

Custom widget creation

In order to create your first custom widget, go to the "User Widget" settings tab and click one the "+ Add a custom widget" button.

A form will appear, you will need to provide at least the following information:

  • An icon
  • A background color (you can choose in a predefined list or provide a custom color in a CSS valid format)
  • A name
  • A Refresh frequency (in milliseconds)
  • A Command/script path for example echo "Hello world!" (it could also be a script to execute like bash ~/my-script.sh)

Custom widget personalization

Next, you can provide some interaction commands/scripts:

  • On click command/script path: will be executed when you click on the widget
  • On right click command/script path: will be executed when you right click on the widget
  • On middle click command/script path: will be executed when you middle click on the widget

With the Show on display option, you can choose on which displays the widget will be displayed. Add a list of indexes (for example: "1,2"). Leave blank to display the widget on every spaces. Default is "".

The Active option allows you to enable/disable the widget.

Finally, you can choose to hide the widget icon by toggling the No icon option.

Once you are done, click on the Confirm changes and refresh simple-bar button and your widget will be added to the bar.

You can add as many widgets as you want, they will be displayed from left to right in the order you choose in the settings module.

Right & middle click actions in Spotify, Wifi & all user widgets added thanks to @rosenpin

Something is wrong in this documentation? Please open an issue on GitHub in simple-bar repo.