From 73fcd216053e898572e4d7b68bcc556af0e9d962 Mon Sep 17 00:00:00 2001 From: SyntaxError Date: Thu, 11 Dec 2025 20:57:22 -0300 Subject: [PATCH] change function name player_ok -> cmd_ok --- toybox.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toybox.sh b/toybox.sh index b6acf2c..2757c04 100755 --- a/toybox.sh +++ b/toybox.sh @@ -6,7 +6,7 @@ BLUE='\033[0;34m' LBLUE='\033[94m' NC='\033[0m' -player_ok() { +cmd_ok() { "$@" >/dev/null 2>&1 & local pid=$! @@ -28,7 +28,7 @@ playaudio() { # aplay if command -v aplay >/dev/null 2>&1; then - if player_ok aplay "$file"; then + if cmd_ok aplay "$file"; then nohup aplay "$file" >/dev/null 2>&1 & return 0 fi @@ -36,7 +36,7 @@ playaudio() { # paplay if command -v paplay >/dev/null 2>&1; then - if player_ok paplay "$file"; then + if cmd_ok paplay "$file"; then nohup paplay "$file" >/dev/null 2>&1 & return 0 fi @@ -44,7 +44,7 @@ playaudio() { # play (SoX) if command -v play >/dev/null 2>&1; then - if player_ok play "$file"; then + if cmd_ok play "$file"; then nohup play "$file" >/dev/null 2>&1 & return 0 fi @@ -52,7 +52,7 @@ playaudio() { # ffplay if command -v ffplay >/dev/null 2>&1; then - if player_ok ffplay -nodisp -autoexit -loglevel quiet "$file"; then + if cmd_ok ffplay -nodisp -autoexit -loglevel quiet "$file"; then ffplay -nodisp -autoexit -loglevel quiet "$file" return 0 fi