dotfiles/services/systemd/.local/share/services/x-started-confirm.sh
Marty Oehme aca7b60855
services: Disable systemd service linking
I have not used (most) of these services in a long time. This makes the
unlinking more official. Also paves the way for setting up simple
runit-managed user services.
2025-02-25 23:25:24 +01:00

20 lines
446 B
Bash
Executable file

#!/usr/bin/env bash
# from: https://superuser.com/questions/759759/writing-a-service-that-depends-on-xorg/1351489#1351489
COUNTER=0
while true; do
# Check whether or not socket exists
if [ -S /tmp/.X11-unix/X0 ]; then
exit 0
fi
((++COUNTER))
if [ "$COUNTER" -gt 20 ]; then
printf "X did not start in time\n"
exit 1
fi
printf "X not yet started, counter at %s\n" "$COUNTER"
sleep 1
done