File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -302,8 +302,9 @@ joker() {
302302 trap ' { clear; echo "Έξοδος..."; tput cnorm; exit 1; }' SIGINT
303303 clear
304304 joker_info
305- sleep 0
306- read -r -n1 -t1 input_play # Για μικρότερη αναμονή της read
305+
306+ # Use a different approach for reading input
307+ read -r -n1 -s input_play
307308
308309 if [[ $input_play = " q" ]] || [[ $input_play = " Q" ]]; then
309310 clear
@@ -312,17 +313,21 @@ joker() {
312313 # Kill the current mpv process
313314 kill $mpv_pid 2> /dev/null
314315 exit 0
315- elif [[ $input_play = " r " ]] || [[ $input_play = " R " ]]; then
316+ elif [[ $input_play = " n " ]] || [[ $input_play = " N " ]]; then
316317 # Kill current mpv process
317318 kill $mpv_pid 2> /dev/null
318319 wait $mpv_pid 2> /dev/null
319320
320321 # Select new random station
321322 station_number=$(( (RANDOM % lines) + 1 ))
323+ clear
322324 echo " Επιλογή νέου τυχαίου σταθμού..."
323325 sleep 1
324326 break # Break out of inner loop to start new station
325327 fi
328+
329+ # Small delay to prevent excessive CPU usage
330+ sleep 0.1
326331 done
327332 done
328333}
You can’t perform that action at this time.
0 commit comments