1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-02 03:01:04 +02:00

feat: common module options (show_if, on_click, tooltip)

The first three of many options that are common to all modules.

Resolves #36. Resolves partially #34.
This commit is contained in:
Jake Stanger 2022-11-28 21:55:08 +00:00
parent a3f90adaf1
commit c9e66d4664
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
15 changed files with 600 additions and 125 deletions

View file

@ -1,6 +1,12 @@
By default, you get a single bar at the bottom of all your screens.
To change that, you'll unsurprisingly need a config file.
This page details putting together the skeleton for your config to get you to a stage where you can start configuring modules.
It may look long and overwhelming, but that is just because the bar supports a lot of scenarios!
If you want to see some ready-to-go config files check the [examples folder](https://github.com/JakeStanger/ironbar/tree/master/examples)
and the example pages in the sidebar.
## 1. Create config file
The config file lives inside the `ironbar` directory in your XDG_CONFIG_DIR, which is usually `~/.config/ironbar`.
@ -253,8 +259,11 @@ monitors:
Once you have the basic config structure set up, it's time to actually configure your bar(s).
The following table describes each of the top-level bar config options.
For details on available modules and each of their config options, check the sidebar.
Check [here](config) for an example config file for a fully configured bar in each format.
### 3.1 Top-level options
The following table lists each of the top-level bar config options:
| Name | Type | Default | Description |
|-------------------|----------------------------------------|----------|-----------------------------------------------------------------------------------------|
@ -265,4 +274,15 @@ For details on available modules and each of their config options, check the sid
| `center` | `Module[]` | `[]` | Array of center modules. |
| `end` | `Module[]` | `[]` | Array of right or bottom modules. |
Check [here](config) for an example config file for a fully configured bar in each format.
### 3.2 Module-level options
The following table lists each of the module-level options that are present on **all** modules.
For details on available modules and each of their config options, check the sidebar.
For information on the `Script` type, see [here](script).
| Name | Type | Default | Description |
|------------|--------------------|---------|--------------------------------------------------------------------------------------------------------------------|
| `show_if` | `Script [polling]` | `null` | Polls the script to check its exit code. If exit code is zero, the module is shown. For other codes, it is hidden. |
| `on_click` | `Script [polling]` | `null` | Runs the script when the module is clicked. |
| `tooltip` | `string` | `null` | Shows this text on hover. |