![]() |
![]()
| ![]() |
![]()
NAMEwaybar - custom module DESCRIPTIONThe custom module displays either the output of a script or static text. To display static text, specify only the format field. CONFIGURATIONAddressed by custom/<name> exec:
exec-if:
hide-empty-text:
exec-on-event:
return-type:
interval:
restart-interval:
signal:
format:
format-icons:
rotate:
max-length:
min-length:
align:
justify:
on-click:
on-click-middle:
on-click-right:
on-update:
on-scroll-up:
on-scroll-down:
smooth-scrolling-threshold:
tooltip:
tooltip-format:
escape:
menu:
menu-file:
GtkMenu with id menu
menu-actions:
expand:
RETURN-TYPEWhen return-type is set to json, Waybar expects the exec-script to output its data in JSON format. This should look like this: {"text": "$text", "tooltip": "$tooltip", "class": "$class", "percentage": $percentage } The class parameter also accepts an array of strings. If nothing or an invalid option is specified, Waybar expects i3blocks style output. Values are newline separated. This should look like this: $text\n$tooltip\n$class* class is a CSS class, to apply different styles in style.css FORMAT REPLACEMENTS{text}: Output of the script. {percentage} Percentage which can be set via a json return type. {icon}: An icon from 'format-icons' according to percentage. EXAMPLESSpotify:"custom/spotify": { "format": " {text}", "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", "return-type": "json" } mpd:"custom/mpd": { "format": "♪ {text}", //"max-length": 15, "interval": 10, "exec": "mpc current", "exec-if": "pgrep mpd", "on-click": "mpc toggle", "on-click-right": "sonata" } cmus:"custom/cmus": { "format": "♪ {text}", //"max-length": 15, "interval": 10, "exec": "cmus-remote -C "format_print '%a - %t'"", // artist - title "exec-if": "pgrep cmus", "on-click": "cmus-remote -u", //toggle pause "escape": true //handle markup entities } Pacman"custom/pacman": { "format": "{text} ", "interval": "once", "exec": "pacman_packages", "on-click": "update-system", "signal": 8 } Alternate Pacman"custom/pacman": { "format": "{text} ", "interval": 3600, // every hour "exec": "checkupdates | wc -l", // # of updates "exec-if": "exit 0", // always run; consider advanced run conditions "on-click": "termite -e 'sudo pacman -Syu'; pkill -SIGRTMIN+8 waybar", // update system "signal": 8 } You can use the signal and update the number of available packages with pkill -RTMIN+8 waybar. STYLE
|