A bash script for catching when the server is offline
This commit is contained in:
		
							
								
								
									
										18
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								README.md
									
									
									
									
									
								
							| @@ -23,6 +23,12 @@ To add the current task to Waybar, add this snippet to your config: | ||||
| } | ||||
| ``` | ||||
|  | ||||
| Then, add `custom/org` to `modules-left`/`modules-center`/`module-right` if your bar’s | ||||
| configuration.  You can find a minimal working configuration in the [`examples`](./examples) | ||||
| directory. | ||||
|  | ||||
| ### Additional Configuration | ||||
|  | ||||
| You can also display an icon specific to the clocked tasks category with the `format-icons` key: | ||||
|  | ||||
| ```json | ||||
| @@ -62,9 +68,15 @@ If you run emacs in this mode you can also eval commands on click, middle click | ||||
|  | ||||
| ``` | ||||
|  | ||||
| Then, add `custom/org` to `modules-left`/`modules-center`/`module-right` if your bar’s | ||||
| configuration.  You can find a minimal working configuration in the [`examples`](./examples) | ||||
| directory. | ||||
| If you want the taskbar to show nothing or some other content if the emacs server is not running then you need to write a short bash script to catch when the emacsclient command returns a non-zero exit code. An example of this is: | ||||
|  | ||||
| ```bash | ||||
| #!/bin/bash | ||||
|  | ||||
| json=$(emacsclient --eval '(org-clock-waybar-ouptut-task)' 2> /dev/null) | ||||
| status=$? | ||||
| [ $status -eq 0 ] && echo $(echo $json | jq fromjson --unbuffered --compact-output) || echo "" | ||||
| ``` | ||||
|  | ||||
| ## Customization | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user