Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
app-pyaudioplayer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
santiago duque
app-pyaudioplayer
Commits
f6142b58
Commit
f6142b58
authored
Jul 23, 2025
by
santiago duque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed wait for x
parent
096b62dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
wait-for-x.sh
PI_SCRIPTS/wait-for-x.sh
+19
-3
No files found.
PI_SCRIPTS/wait-for-x.sh
View file @
f6142b58
#!/bin/bash
#!/bin/bash
# wait-for-x.sh
# home/squareclouds
# Warte bis ein USB-Gerät auftaucht
until
[
-S
/tmp/.X11-unix/X0
]
;
do
TIMEOUT
=
30
SECONDS_WAITED
=
0
echo
"Waiting for X..."
while
!
pgrep
-x
Xorg
>
/dev/null
;
do
sleep
1
sleep
1
done
done
echo
"Waiting for USB (max
$TIMEOUT
sec)..."
while
[
$SECONDS_WAITED
-lt
$TIMEOUT
]
;
do
if
lsblk |
grep
-q
'sd[b-z]'
;
then
echo
"USB device detected."
break
fi
sleep
1
SECONDS_WAITED
=
$((
SECONDS_WAITED
+
1
))
done
exit
0
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment