Skip to content

Commit a7ab21b

Browse files
committed
Add macOS audio support and improve station change messages
1 parent b6d4f78 commit a7ab21b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

shelldio.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,14 @@ start_mpv() {
105105
rm -f /tmp/mpv_socket
106106
fi
107107

108-
mpv --no-video --input-ipc-server=/tmp/mpv_socket --volume=0 "$stathmos_url" &>/dev/null &
108+
# Detect OS and set appropriate audio options
109+
if [[ "$OSTYPE" == "darwin"* ]]; then
110+
# macOS - use coreaudio driver
111+
mpv --no-video --input-ipc-server=/tmp/mpv_socket --volume=0 --ao=coreaudio "$stathmos_url" &>/dev/null &
112+
else
113+
# Linux/other Unix - default audio
114+
mpv --no-video --input-ipc-server=/tmp/mpv_socket --volume=0 "$stathmos_url" &>/dev/null &
115+
fi
109116
mpv_pid=$!
110117

111118
# Wait for the IPC socket to be ready with loading indicator
@@ -270,7 +277,7 @@ load_station() {
270277
rm -f /tmp/mpv_socket
271278
fi
272279

273-
# Show change message at the bottom of screen (like in joker mode)
280+
# Show change message at the bottom of screen
274281
echo "Αλλαγή σε: [$selected_play] $stathmos_name"
275282
if start_mpv; then
276283
# Clear the change message after successful connection
@@ -367,8 +374,7 @@ info() {
367374
local random_station=$(( (RANDOM % total_stations) + 1 ))
368375
selected_play=$random_station
369376

370-
# Show change message
371-
echo "Τυχαία επιλογή: σταθμός [$random_station]"
377+
# Load the new station (load_station will show the change message)
372378
load_station
373379
;;
374380
[Nn]) next_station ;; # Next station

0 commit comments

Comments
 (0)