-
Notifications
You must be signed in to change notification settings - Fork 0
Modules
//TODO: on_click
//TODO: on_scroll_up
//TODO: on_scroll_down
The battery module displays the current capacity and state (eg. charging) of your battery.
Addressed by battery
| option | typeof | optional | default | description |
|---|---|---|---|---|
bat |
string | ✔️ | The battery to monitor, as in /sys/class/power_supply/ instead of auto detect. |
|
interval |
integer | ✔️ | 60 | The interval in which the information gets polled. |
states |
array | ✔️ | A number of battery states which get activated on certain capacity levels. See States |
|
format |
string | ✔️ | {capacity}% |
The format, how the time should be displayed. |
format-icons |
array | ✔️ | Based on the current capacity, the corresponding icon gets selected. The order is low to high. |
|
max-length |
integer | ✔️ | The maximum length in character the module should display. |
| string | replacement |
|---|---|
{capacity} |
Capacity in percentage |
{icon} |
Icon, as defined in format-icons. |
The battery module allows to define custom formats based on up to two factors. The best fitting format will be selected.
| format | description |
|---|---|
format-<state> |
With states, a custom format can be set depending on the capacity of your battery. |
format-<status> |
With the status, a custom format can be set depending on the status in /sys/class/power_supply/<bat>/status (in lowercase). |
format-<status>-<state> |
You can also set a custom format depending on both vaules. |
- Every entry (state) consits of a
<name>(typeof:string) and a<value>(typeof:integer).- The state can be adressed as a CSS class in the
style.css. The name of the CSS class is the<name>of the state. Each class gets activated when the current capacity is equal or below the configured<value>. - Also each state can have its own
format. Those con be configured viaformat-<name>. Or if you want to differntiate a bit more even asformat-<status>-<state>. For more information see custom formats.
- The state can be adressed as a CSS class in the
"battery": {
"bat": "BAT2",
"interval": 60,
"states": {
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
"format-icons": ["", "", "", "", ""],
"max-length": 25
}
#battery-
#battery.<status>-
<status>is the value of/sys/class/power_supply/<bat>/statusin lowercase.
-
-
#battery.<state>-
<state>can be defined in theconfig. For more information seestates
-
-
#battery.<status>.<state>- Combination of both
<status>and<state>.
- Combination of both
The clock module displays the current date and time.
Addressed by clock
| option | typeof | optional | default | description |
|---|---|---|---|---|
interval |
integer | ✔️ | 60 | The interval in which the information gets polled. |
format |
string | ✔️ | {:%H:%M} |
The format, how the time should be displayed. |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
For valid format options have a look here.
"cpu": {
"interval": 60,
"format": "{:%H:%M}",
"max-length": 25
}
#clock
The cpu module displays the current cpu utilization.
Addressed by cpu
| option | typeof | optional | default | description |
|---|---|---|---|---|
interval |
integer | ✔️ | 10 | The interval in which the information gets polled. |
format |
string | ✔️ | {} |
The format, how information should be displayed. On {} data gets inserted. |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
"cpu": {
"interval": 10,
"format": "{}% ",
"max-length": 10
}
#cpu
The custom module displays the output of a script.
Addressed by custom/<name>
| option | typeof | optional | default | description |
|---|---|---|---|---|
exec |
string | The path to the script, which should be executed. | ||
exec-if |
string | ✔️ | TThe path to an script, which determines if the script in exec should be executed.exec will be executed if the exit code of exec-if equals 0. |
|
return-type |
string | ✔️ | See return-type
|
|
interval |
integer | ✔️ | The interval in which the information gets polled. If no interval is defined, it is assumed that the out script loops it self. |
|
format |
string | ✔️ | {} |
The format, how information should be displayed. On {} data gets inserted. |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
- When
return-typeis set tojson, Waybar expects theexec-script to output its data in JSON format. This should look like this:{"text": "$text", "tooltip": "$tooltip", "class": "$class"} - If nothing or an invalid option is specified Waybar expects i3blocks style output, where values are
newlineseparated. This should look like this:$text\n$tooltip\n$class
class is an CSS-class, to apply different styles in style.css
"custom/spotify": {
"format": " {}",
"max-length": 40,
"interval": 30, // Remove this if your script is endless and write in loop
"exec": "$HOME/.config/waybar/mediaplayer.sh 2> /dev/null", // Script in resources folder
"exec-if": "pgrep spotify"
}
#custom-<name>-
#custom-<name>.<class>-
<class>can be set by the script. For more information seereturn-type
-
The memory module displays the current memory utilization.
Addressed by memory
| option | typeof | optional | default | description |
|---|---|---|---|---|
interval |
integer | ✔️ | 30 | The interval in which the information gets polled. |
format |
string | ✔️ | {} |
The format, how information should be displayed. On {} data gets inserted. |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
"memory": {
"interval": 30,
"format": "{}% ",
"max-length": 10
}
#memory
The network module displays information about the current network connections.
Addressed by network
| option | typeof | optional | default | description |
|---|---|---|---|---|
interface |
string | ✔️ | Use the defined interface instead of auto detection. | |
format |
string | ✔️ | {ifname} |
The format, how information should be displayed. This format is used when other formats aren't specified. |
format-ethernet |
string | ✔️ | This format is used when a ethernet interface is displayed. | |
format-wifi |
string | ✔️ | This format is used when a wireless interface is displayed. | |
format-disconnected |
string | ✔️ | This format is used when the displayed interface is disconnected. | |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
| string | replacement |
|---|---|
{ifname} |
Name of the network interface. |
{essid} |
Name (SSID) of the wireless network. |
{signalStrength} |
Signal strenth of the wireless network. |
"network" {
"interface": "wlp2s0",
"format": "{ifname}",
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ifname} ",
"format-disconnected": "", //An empty format will hide the module.
"max-length": 50
}
#network#network.disconnected
The pulseaudio module displays the current volume reported by PulseAudio.
Additionally you can control the volume by scrolling up or down ehile the cursor ist over the module.
//TODO: Config
#pulseaudio#pulseaudio.bluetooth#pulseaudio.muted
The mode module displays the current binding mode of sway.
Addressed by sway/mode
| option | typeof | optional | default | description |
|---|---|---|---|---|
format |
string | ✔️ | {} |
The format, how information should be displayed. On {} data gets inserted. |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
"sway/window" {
"format": " {}",
"max-length": 50
}#mode
The window module displays the title of the currently focused window in sway.
Addressed by sway/window
| option | typeof | optional | default | description |
|---|---|---|---|---|
format |
string | ✔️ | {} |
The format, how information should be displayed. On {} data gets inserted. |
max-length |
integer | ✔️ | The maximum length in character the module should display. |
"sway/window" {
"format": "{}",
"max-length": 50
}#window
//TODO
tray is still in beta. There may me bugs. Breaking changed may occur
//TODO