wmstartup: More major refactors
This commit is contained in:
parent
b3464c63ed
commit
ff85787090
@ -46,54 +46,59 @@ 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"
|
||||
conky&
|
||||
# Wallpaper management
|
||||
printf " [INFO] Setting wallpaper\n"
|
||||
printf "[INFO] Setting wallpaper\n"
|
||||
if which xfdesktop > /dev/null 2>&1; then
|
||||
printf " [INFO] Starting xfdesktop\n"
|
||||
printf " [INFO] Starting xfdesktop\n"
|
||||
xfdesktop --disable-wm-check&
|
||||
elif which feh > /dev/null 2>&1; then
|
||||
printf " [INFO] Setting wallpaper with feh\n"
|
||||
printf " [WARN] This solution may cause problems on multi-monitor systems\n"
|
||||
printf " [INFO] Setting wallpaper with feh\n"
|
||||
printf " [WARN] This solution may cause problems on multi-monitor systems\n"
|
||||
feh --randomize --bg-fill ~/Pictures/Wallpapers/.active &
|
||||
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"
|
||||
else
|
||||
printf " [WARN] Could not find any wallpaper manager\n"
|
||||
printf " [WARN] Could not find any wallpaper manager\n"
|
||||
fi
|
||||
printf "[INFO] Finished initialization\n"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user