Custom widgets
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 exampleecho "Hello world!"
(it could also be a script to execute likebash ~/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 widgetOn right click command/script path
: will be executed when you right click on the widgetOn 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