| 
									
										
										
										
											2021-08-20 20:22:37 +01:00
										 |  |  | #!/usr/bin/env bash | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-21 17:57:24 +01:00
										 |  |  | export BAR_VISIBILITY=$CONFIG/polybar/.visible | 
					
						
							|  |  |  | [[ -f $BAR_VISIBILITY ]] && rm $BAR_VISIBILITY | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # create a file to keep track of the bar's visibility | 
					
						
							|  |  |  | #   file exists -> bar visible | 
					
						
							|  |  |  | #   file doesnt exist -> bar hidden | 
					
						
							|  |  |  | #touch $BAR_VISIBILITY            | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # terminate already running bar instances | 
					
						
							|  |  |  | killall -q polybar | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # wait until the processes have been shut down | 
					
						
							|  |  |  | while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # launch bar | 
					
						
							| 
									
										
										
										
											2021-08-20 20:22:37 +01:00
										 |  |  | polybar example &               # launch bar | 
					
						
							| 
									
										
										
										
											2021-08-21 17:57:24 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #touch $BAR_VISIBILITY |