14 lines
		
	
	
		
			452 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
		
		
			
		
	
	
			14 lines
		
	
	
		
			452 B
		
	
	
	
		
			Bash
		
	
	
	
	
	
|  | #!/usr/bin/env bash
 | ||
|  | # Terminate already running bar instances | ||
|  | # If all your bars have ipc enabled, you can use  | ||
|  | polybar-msg cmd quit | ||
|  | # Otherwise you can use the nuclear option: | ||
|  | # killall -q polybar | ||
|  | 
 | ||
|  | # Launch bar on each monitor, tray on primary | ||
|  | polybar --list-monitors | while IFS=$'\n' read line; do | ||
|  |   monitor=$(echo $line | cut -d':' -f1) | ||
|  |   primary=$(echo $line | cut -d' ' -f3) | ||
|  |   MONITOR=$monitor polybar --reload "top${primary:+"-primary"}" & | ||
|  | done |