Upload New File
This commit is contained in:
parent
8d109dffeb
commit
818b8f4d32
112
arch-config/.config/polybar/launch.sh
Normal file
112
arch-config/.config/polybar/launch.sh
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
# More info : https://github.com/jaagr/polybar/wiki
|
||||||
|
|
||||||
|
# Install the following applications for polybar and icons in polybar if you are on ArcoLinuxD
|
||||||
|
# awesome-terminal-fonts
|
||||||
|
# Tip : There are other interesting fonts that provide icons like nerd-fonts-complete
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
desktop=$(echo $DESKTOP_SESSION)
|
||||||
|
count=$(xrandr --query | grep " connected" | cut -d" " -f1 | wc -l)
|
||||||
|
|
||||||
|
|
||||||
|
case $desktop in
|
||||||
|
|
||||||
|
i3)
|
||||||
|
if type "xrandr" > /dev/null; then
|
||||||
|
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
MONITOR=$m polybar --reload mainbar-i3 -c ~/.config/polybar/config &
|
||||||
|
done
|
||||||
|
else
|
||||||
|
polybar --reload mainbar-i3 -c ~/.config/polybar/config &
|
||||||
|
fi
|
||||||
|
# second polybar at bottom
|
||||||
|
# if type "xrandr" > /dev/null; then
|
||||||
|
# for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
# MONITOR=$m polybar --reload mainbar-i3-extra -c ~/.config/polybar/config &
|
||||||
|
# done
|
||||||
|
# else
|
||||||
|
# polybar --reload mainbar-i3-extra -c ~/.config/polybar/config &
|
||||||
|
# fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
openbox)
|
||||||
|
if type "xrandr" > /dev/null; then
|
||||||
|
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
MONITOR=$m polybar --reload mainbar-openbox -c ~/.config/polybar/config &
|
||||||
|
done
|
||||||
|
else
|
||||||
|
polybar --reload mainbar-openbox -c ~/.config/polybar/config &
|
||||||
|
fi
|
||||||
|
# second polybar at bottom
|
||||||
|
# if type "xrandr" > /dev/null; then
|
||||||
|
# for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
# MONITOR=$m polybar --reload mainbar-openbox-extra -c ~/.config/polybar/config &
|
||||||
|
# done
|
||||||
|
# else
|
||||||
|
# polybar --reload mainbar-openbox-extra -c ~/.config/polybar/config &
|
||||||
|
# fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
bspwm)
|
||||||
|
if type "xrandr" > /dev/null; then
|
||||||
|
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
MONITOR=$m polybar --reload mainbar-bspwm -c ~/.config/polybar/config &
|
||||||
|
done
|
||||||
|
else
|
||||||
|
polybar --reload mainbar-bspwm -c ~/.config/polybar/config &
|
||||||
|
fi
|
||||||
|
# second polybar at bottom
|
||||||
|
# if type "xrandr" > /dev/null; then
|
||||||
|
# for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
# MONITOR=$m polybar --reload mainbar-bspwm-extra -c ~/.config/polybar/config &
|
||||||
|
# done
|
||||||
|
# else
|
||||||
|
# polybar --reload mainbar-bspwm-extra -c ~/.config/polybar/config &
|
||||||
|
# fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
herbstluftwm)
|
||||||
|
if type "xrandr" > /dev/null; then
|
||||||
|
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
MONITOR=$m polybar --reload mainbar-herbstluftwm -c ~/.config/polybar/config &
|
||||||
|
done
|
||||||
|
else
|
||||||
|
polybar --reload mainbar-herbstluftwm -c ~/.config/polybar/config &
|
||||||
|
fi
|
||||||
|
# second polybar at bottom
|
||||||
|
# if type "xrandr" > /dev/null; then
|
||||||
|
# for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
# MONITOR=$m polybar --reload mainbar-herbstluftwm-extra -c ~/.config/polybar/config &
|
||||||
|
# done
|
||||||
|
# else
|
||||||
|
# polybar --reload mainbar-herbstluftwm-extra -c ~/.config/polybar/config &
|
||||||
|
# fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
xmonad)
|
||||||
|
if [ $count = 1 ]; then
|
||||||
|
m=$(xrandr --query | grep " connected" | cut -d" " -f1)
|
||||||
|
MONITOR=$m polybar --reload mainbar-xmonad -c ~/.config/polybar/config &
|
||||||
|
else
|
||||||
|
for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
MONITOR=$m polybar --reload mainbar-xmonad -c ~/.config/polybar/config &
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
# second polybar at bottom
|
||||||
|
# if [ $count = 1 ]; then
|
||||||
|
# m=$(xrandr --query | grep " connected" | cut -d" " -f1)
|
||||||
|
# MONITOR=$m polybar --reload mainbar-xmonad-extra -c ~/.config/polybar/config &
|
||||||
|
# else
|
||||||
|
# for m in $(xrandr --query | grep " connected" | cut -d" " -f1); do
|
||||||
|
# MONITOR=$m polybar --reload mainbar-xmonad-extra -c ~/.config/polybar/config &
|
||||||
|
# done
|
||||||
|
# fi
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
Reference in New Issue
Block a user