.\" Generated by scdoc 1.11.2 .\" Complete documentation for this program is not available as a GNU info page .ie \n(.g .ds Aq \(aq .el .ds Aq ' .nh .ad l .\" Begin generated content: .TH "waybar-custom" "5" "2023-02-28" .P .SH NAME .P waybar - custom module .P .SH DESCRIPTION .P The \fBcustom\fR module displays either the output of a script or static text.\& To display static text, specify only the \fBformat\fR field.\& .P .SH CONFIGURATION .P Addressed by \fBcustom/\fR .P \fBexec\fR: .br typeof: string .br The path to the script, which should be executed.\& .P \fBexec-if\fR: .br typeof: string .br The path to a script, which determines if the script in \fBexec\fR should be executed.\& .RS 4 \fBexec\fR will be executed if the exit code of \fBexec-if\fR equals 0.\& .P .RE \fBexec-on-event\fR: .br typeof: bool .br default: true .br If an event command is set (e.\&g.\& \fBon-click\fR or \fBon-scroll-up\fR) then re-execute the script after .RS 4 executing the event command.\& .P .RE \fBreturn-type\fR: .br typeof: string .br See \fBreturn-type\fR .P \fBinterval\fR: .br typeof: integer .br The interval (in seconds) in which the information gets polled.\& .RS 4 Use \fBonce\fR if you want to execute the module only on startup.\& You can update it manually with a signal.\& If no \fBinterval\fR is defined, it is assumed that the out script loops it self.\& .P .RE \fBrestart-interval\fR: .br typeof: integer .br The restart interval (in seconds).\& .RS 4 Can'\&t be used with the \fBinterval\fR option, so only with continuous scripts.\& Once the script exit, it'\&ll be re-executed after the \fBrestart-interval\fR.\& .P .RE \fBsignal\fR: .br typeof: integer .br The signal number used to update the module.\& .RS 4 The number is valid between 1 and N, where \fBSIGRTMIN+N\fR = \fBSIGRTMAX\fR.\& .P .RE \fBformat\fR: .br typeof: string .br default: {} .br The format, how information should be displayed.\& On {} data gets inserted.\& .P \fBformat-icons\fR: .br typeof: array .br Based on the set percentage, the corresponding icon gets selected.\& The order is \fBlow\fR to \fBhigh\fR.\& .P \fBrotate\fR: .br typeof: integer .br Positive value to rotate the text label.\& .P \fBmax-length\fR: .br typeof: integer .br The maximum length in character the module should display.\& .P \fBmin-length\fR: .br typeof: integer .br The minimum length in characters the module should take up.\& .P \fBalign\fR: .br typeof: float .br The alignment of the text, where 0 is left-aligned and 1 is right-aligned.\& If the module is rotated, it will follow the flow of the text.\& .P \fBon-click\fR: .br typeof: string .br Command to execute when clicked on the module.\& .P \fBon-click-middle\fR: .br typeof: string .br Command to execute when middle-clicked on the module using mousewheel.\& .P \fBon-click-right\fR: .br typeof: string .br Command to execute when you right clicked on the module.\& .P \fBon-update\fR: .br typeof: string .br Command to execute when the module is updated.\& .P \fBon-scroll-up\fR: .br typeof: string .br Command to execute when scrolling up on the module.\& .P \fBon-scroll-down\fR: .br typeof: string .br Command to execute when scrolling down on the module.\& .P \fBsmooth-scrolling-threshold\fR: .br typeof: double .br Threshold to be used when scrolling.\& .P \fBtooltip\fR: .br typeof: bool .br default: true .br Option to disable tooltip on hover.\& .P \fBescape\fR: .br typeof: bool .br default: false .br Option to enable escaping of script output.\& .P .SH RETURN-TYPE .P When \fBreturn-type\fR is set to \fBjson\fR, Waybar expects the \fBexec\fR-script to output its data in JSON format.\& This should look like this: .P .nf .RS 4 {"text": "$text", "tooltip": "$tooltip", "class": "$class", "percentage": $percentage } .fi .RE .P The \fBclass\fR parameter also accepts an array of strings.\& .P If nothing or an invalid option is specified, Waybar expects i3blocks style output.\& Values are \fBnewline\fR separated.\& This should look like this: .P .nf .RS 4 $text\\n$tooltip\\n$class* .fi .RE .P \fBclass\fR is a CSS class, to apply different styles in \fBstyle.\&css\fR .P .SH FORMAT REPLACEMENTS .P \fB{}\fR: Output of the script.\& .P \fB{percentage}\fR Percentage which can be set via a json return-type.\& .P \fB{icon}\fR: An icon from '\&format-icons'\& according to percentage.\& .P .SH EXAMPLES .P .SS Spotify: .P .nf .RS 4 "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", "return-type": "json" } .fi .RE .P .SS mpd: .P .nf .RS 4 "custom/mpd": { "format": "♪ {}", //"max-length": 15, "interval": 10, "exec": "mpc current", "exec-if": "pgrep mpd", "on-click": "mpc toggle", "on-click-right": "sonata" } .fi .RE .P .SS cmus: .P .nf .RS 4 "custom/cmus": { "format": "♪ {}", //"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 } .fi .RE .P .SS Pacman .P .nf .RS 4 "custom/pacman": { "format": "{} ", "interval": "once", "exec": "pacman_packages", "on-click": "update-system", "signal": 8 } .fi .RE .P .SS Alternate Pacman .P .nf .RS 4 "custom/pacman": { "format": "{} ", "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 } .fi .RE .P You can use the signal and update the number of available packages with \fBpkill -RTMIN+8 waybar\fR.\& .P .SH STYLE .P .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB#custom-\fR .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB#custom-.\&\fR .RE .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .IP \(bu 4 .\} \fB\fR can be set by the script.\& For more information see \fBreturn-type\fR .RE