wmstartup: More major refactors

This commit is contained in:
Salt 2018-07-31 15:59:17 -05:00
parent b3464c63ed
commit ff85787090

View File

@ -46,54 +46,59 @@ xrdbupdate
## SERVICES AND DAEMONS ## SERVICES AND DAEMONS
# Kill everything # Kill everything
printf "[INFO] Killing existing daemons\n" printf "[INFO] Stopping existing services\n"
services="xfdesktop polybar compton conky sxhkd dunst" services="xfdesktop polybar compton conky sxhkd dunst"
for service in $services; do for service in $services; do
printf " [INFO] Killing $service\n" printf " [INFO] Sending signal to all $service\n"
killall $service killall $service
done done
# Wait for them to die # Wait for them to die
for service in $services; do for service in $services; do
while pgrep $service > /dev/null 2>&1; do while pgrep $service > /dev/null 2>&1; do
printf " [INFO] Waiting for $service to die\n" printf " [INFO] Waiting on $service\n"
sleep 0.5 sleep 0.5
done done
done done
# Start them back up
printf "[INFO] Starting services\n"
# Start with key functionality
if pgrep bspwm > /dev/null 2>&1; then
printf " [INFO] Found bspwm, starting sxhkd\n"
if [[ $(uname) == "OpenBSD" ]]; then
printf " [INFO] Starting OpenBSD variant\n"
sxhkd -c $XDG_CONFIG_HOME/sxhkd/sxhkdrc-obsd &
else
sxhkd &
fi
fi
# Don't start the compositor in a VM # Don't start the compositor in a VM
if [[ $(hostname) != "vm"* ]]; then if [[ $(hostname) != "vm"* ]]; then
printf " [INFO] Starting compton\n" printf " [INFO] Starting compton\n"
compton & compton &
fi
# Different startup for OpenBSD and Linux
if [[ $(uname) == "Linux" ]]; then
printf "[INFO] Starting Linux tasks\n"
compton &
$HOME/.config/polybar/start.sh &
sxhkd &
else else
printf "[INFO] Starting OpenBSD tasks\n" printf " [INFO] In a VM, not starting compositor\n"
sxhkd -c $XDG_CONFIG_HOME/sxhkd/sxhkdrc-obsd &
fi fi
# Start these all the time regardless of platform printf " [INFO] Starting polybar\n"
printf "[INFO] Starting platform-independent tasks\n" $HOME/.config/polybar/start.sh &
printf " [INFO] Starting dunst\n" printf " [INFO] Starting dunst\n"
dunst& dunst&
printf " [INFO] Starting conky\n" printf " [INFO] Starting conky\n"
conky& conky&
# Wallpaper management # Wallpaper management
printf " [INFO] Setting wallpaper\n" printf "[INFO] Setting wallpaper\n"
if which xfdesktop > /dev/null 2>&1; then if which xfdesktop > /dev/null 2>&1; then
printf " [INFO] Starting xfdesktop\n" printf " [INFO] Starting xfdesktop\n"
xfdesktop --disable-wm-check& xfdesktop --disable-wm-check&
elif which feh > /dev/null 2>&1; then elif which feh > /dev/null 2>&1; then
printf " [INFO] Setting wallpaper with feh\n" printf " [INFO] Setting wallpaper with feh\n"
printf " [WARN] This solution may cause problems on multi-monitor systems\n" printf " [WARN] This solution may cause problems on multi-monitor systems\n"
feh --randomize --bg-fill ~/Pictures/Wallpapers/.active & feh --randomize --bg-fill ~/Pictures/Wallpapers/.active &
elif which xsetroot > /dev/null 2>&1; then elif which xsetroot > /dev/null 2>&1; then
printf " [INFO] Setting root window color\n" printf " [INFO] Setting root window color\n"
xsetroot -solid "#282828" xsetroot -solid "#282828"
else else
printf " [WARN] Could not find any wallpaper manager\n" printf " [WARN] Could not find any wallpaper manager\n"
fi fi
printf "[INFO] Finished initialization\n" printf "[INFO] Finished initialization\n"