Advertisement
zerinol

Untitled

Dec 9th, 2019
1,367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.59 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Terminate already running bar instances
  4. killall -q polybar
  5.  
  6. # Wait until the processes have been shut down
  7. while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
  8.  
  9. # Launch bar1 and bar2
  10. bar1=main
  11. bar2=extra
  12. echo "---" | tee -a /tmp/$bar1.log /tmp/$bar2.log
  13.  
  14. MONITOR="eDP1" polybar --reload $bar1 -c ~/.config/polybar/config >>/tmp/$bar1.log 2>&1 &
  15.  
  16. externo=$(xrandr --query | grep "HDMI1")
  17. if [[ ! $externo = *disconnected* ]]; then
  18.   MONITOR="HDMI1" polybar --reload $bar2 -c ~/.config/polybar/config >>/tmp/$bar2.log 2>&1 &
  19. fi
  20.  
  21. echo "Bars launched..."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement