Skip to content

Commit 2ec1e22

Browse files
committed
Improve loading indication and clear messages during station changes
1 parent 87c686a commit 2ec1e22

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

shelldio.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ start_mpv() {
108108
mpv --no-video --input-ipc-server=/tmp/mpv_socket --volume=0 "$stathmos_url" &>/dev/null &
109109
mpv_pid=$!
110110

111-
# Wait for the IPC socket to be ready with loading indicator
111+
# Wait for the IPC socket to be ready with loading indicator
112112
for i in {1..40}; do
113113
if [ -S /tmp/mpv_socket ]; then
114+
# Clear the connection message line
115+
printf "\r%*s\r" 50 ""
114116
fade_in
115117
return 0
116118
fi
@@ -263,9 +265,13 @@ load_station() {
263265
rm -f /tmp/mpv_socket
264266
fi
265267

266-
# Show change message at the bottom of screen
268+
# Show change message at the bottom of screen (like in joker mode)
267269
echo "Αλλαγή σε: [$selected_play] $stathmos_name"
268-
start_mpv
270+
if start_mpv; then
271+
# Clear the change message after successful connection
272+
tput cuu1
273+
printf "\r%*s\r" 60 ""
274+
fi
269275
}
270276

271277
next_station() {

0 commit comments

Comments
 (0)