wmstartup: Polish up, add waiting code
Conky was getting stuck behind xfdesktop. This fixes that
This commit is contained in:
parent
b97c40d41c
commit
260594af01
@ -45,31 +45,38 @@ xset s off
|
|||||||
xrdbupdate
|
xrdbupdate
|
||||||
|
|
||||||
## SERVICES AND DAEMONS
|
## SERVICES AND DAEMONS
|
||||||
|
# Kill everything
|
||||||
printf "[INFO] Killing existing daemons\n"
|
printf "[INFO] Killing existing daemons\n"
|
||||||
services="sxhkd polybar conky dunst compton"
|
services="xfdesktop polybar compton conky sxhkd dunst"
|
||||||
for service in $services; do
|
for service in $services; do
|
||||||
printf " [INFO] Killing $service\n"
|
printf " [INFO] Killing $service\n"
|
||||||
killall $service
|
killall $service
|
||||||
done
|
done
|
||||||
|
# Wait for them to die
|
||||||
for service in $services; do
|
for service in $services; do
|
||||||
while pgrep $service; do
|
while pgrep $service > /dev/null 2>&1; do
|
||||||
|
printf " [INFO] Waiting for $service to die\n"
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
# Wallpaper management
|
# Wallpaper management
|
||||||
# Note that this MUST happen before the compositor starts, otherwise xsetroot
|
# Note that this MUST happen before the compositor starts, otherwise xsetroot
|
||||||
# will not apply properly
|
# will not apply properly
|
||||||
|
wpm=feh
|
||||||
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&
|
wpm=xfdesktop
|
||||||
|
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"
|
||||||
|
wpm=xsetroot
|
||||||
xsetroot -solid "#282828"
|
xsetroot -solid "#282828"
|
||||||
else
|
else
|
||||||
|
wpm=none
|
||||||
printf " [WARN] Could not find any wallpaper manager\n"
|
printf " [WARN] Could not find any wallpaper manager\n"
|
||||||
fi
|
fi
|
||||||
# Don't start the compositor in a VM
|
# Don't start the compositor in a VM
|
||||||
@ -89,7 +96,27 @@ else
|
|||||||
fi
|
fi
|
||||||
# Start these all the time regardless of platform
|
# Start these all the time regardless of platform
|
||||||
printf "[INFO] Starting platform-independent tasks\n"
|
printf "[INFO] Starting platform-independent tasks\n"
|
||||||
conky&
|
printf " [INFO] Starting dunst\n"
|
||||||
dunst&
|
dunst&
|
||||||
|
printf " [INFO] Starting conky\n"
|
||||||
|
if [[ $wpm == "xfdesktop" ]]; then
|
||||||
|
printf " [INFO] Waiting for xfdesktop to initialize\n"
|
||||||
|
if which xdotool > /dev/null 2>&1; then
|
||||||
|
i=0
|
||||||
|
until xdotool search --class "xfdesktop"; do
|
||||||
|
i=$(expr $i + 1)
|
||||||
|
if [[ $i -ge 10 ]]; then
|
||||||
|
printf " [WARN] Grew too impatient!\n"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
unset i
|
||||||
|
else
|
||||||
|
printf " [WARN] Could not find xdotool!\n"
|
||||||
|
fi
|
||||||
|
printf " [INFO] Finished waiting\n"
|
||||||
|
fi
|
||||||
|
conky&
|
||||||
printf "[INFO] Finished initialization\n"
|
printf "[INFO] Finished initialization\n"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user