-
Notifications
You must be signed in to change notification settings - Fork 0
Modules
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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
| 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 date and time should be displayed. |
max-length |
integer | ✔️ | The maximum length in character the module should display. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
"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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
- 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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
"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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
| 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 while the cursor ist over the module.
| option | typeof | optional | default | description |
|---|---|---|---|---|
interface |
string | ✔️ | Use the defined interface instead of auto detection. | |
format |
string | ✔️ | {volume}% |
The format, how information should be displayed. This format is used when other formats aren't specified. |
format-bluetooth |
string | ✔️ | This format is used when using bluetooth speakers. | |
format-muted |
string | ✔️ | This format is used when the sound is muted. | |
format-icons |
array | ✔️ | Based on the current port-name and volume, the corresponding icon gets selected. The order is low to high. See Icons
|
|
max-length |
integer | ✔️ | The maximum length in character the module should display. | |
scroll-step |
integer | ✔️ | 1 | The speed in which to change the volume when scrolling. |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. This replaces the default beaviour of volume control. |
|
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. This replaces the default beaviour of volume control. |
| string | replacement |
|---|---|
{volume} |
Volume in percentage |
{icon} |
Icon, as defined in format-icons. |
The folowing strings for format-icons are supported. If they are found in the current PulseAudio port name, the corresponding icons will be selected.
| string | note |
|---|---|
default |
Will be shown, when no other port is found. |
headphones |
|
speaker |
|
hdmi |
|
headset |
|
handsfree |
|
portable |
|
car |
|
hifi |
|
phone |
"pulseaudio": {
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format-muted": "",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", ""]
},
"scroll-step": 1,
"on-click": "pavucontrol"
}
#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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
"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. | |
on-click |
string | ✔️ | Command to execute when clicked on the module. | |
on-scroll-up |
string | ✔️ | Command to execute when scrolling up on the module. | |
on-scroll-down |
string | ✔️ | Command to execute when scrolling down on the module. |
"sway/window" {
"format": "{}",
"max-length": 50
}#window
The workspaces module displays the currently used workspaces in sway.
Addressed by sway/workspaces
| option | typeof | optional | default | description |
|---|---|---|---|---|
all-outputs |
bool | ✔️ | false |
If set to false, workspaces will only be shown on the output they are on.If set to true all workspaces will be shown on every outout. |
format |
string | ✔️ | {name} |
The format, how information should be displayed. |
format-icons |
array | ✔️ | Based on the workspace name and staate, the corresponding icon gets selected. See Icons
|
|
disable-scroll |
bool | ✔️ | false |
If set to false, you can scroll to cycle through workspaces.If set to true this behaviour is disabled. |
| string | replacement |
|---|---|
{name} |
Name of the workspace, as defined by sway |
{icon} |
Icon, as defined in format-icons. |
{index} |
Index of the workspace |
Additional to workspace name matching, the following format-icons can be set.
| port name | note |
|---|---|
default |
Will be shown, when no string matches is found. |
urgent |
Will be shown, when workspace is flaged as urgent |
focused |
Will be shown, when workspace is focused |
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}: {icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"urgent": "",
"focused": "",
"default": ""
}
}
#workspaces button#workspaces button.visible#workspaces button.focused#workspaces button.urgent
tray is still in beta. There may me bugs. Breaking changes may occur
Addressed by sway/window
| option | typeof | optional | default | description |
|---|---|---|---|---|
icon-size |
integer | ✔️ | Defines the size of the tray icons. | |
spacing |
integer | ✔️ | Defines the spaacing between the tray icons. |
"tray": {
"icon-size": 21,
"spacing": 10
}
#tray