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 ## 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"