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,36 +46,41 @@ xrdbupdate
## SERVICES AND DAEMONS
# Kill everything
printf "[INFO] Killing existing daemons\n"
printf "[INFO] Stopping existing services\n"
services="xfdesktop polybar compton conky sxhkd dunst"
for service in $services; do
printf " [INFO] Killing $service\n"
printf " [INFO] Sending signal to all $service\n"
killall $service
done
# Wait for them to die
for service in $services; 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
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
if [[ $(hostname) != "vm"* ]]; then
printf " [INFO] Starting compton\n"
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
printf "[INFO] Starting OpenBSD tasks\n"
sxhkd -c $XDG_CONFIG_HOME/sxhkd/sxhkdrc-obsd &
printf " [INFO] In a VM, not starting compositor\n"
fi
# Start these all the time regardless of platform
printf "[INFO] Starting platform-independent tasks\n"
printf " [INFO] Starting polybar\n"
$HOME/.config/polybar/start.sh &
printf " [INFO] Starting dunst\n"
dunst&
printf " [INFO] Starting conky\n"