From 208c6846dbac060fcb8a625835c387355f0f6115 Mon Sep 17 00:00:00 2001 From: Viyurz <128215328+Viyurz@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:49:20 +0200 Subject: [PATCH] foobar2000.sh: run foocmd only if foobar2000 is already opened --- .scripts/foobar2000.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.scripts/foobar2000.sh b/.scripts/foobar2000.sh index b6ab793..08e307c 100755 --- a/.scripts/foobar2000.sh +++ b/.scripts/foobar2000.sh @@ -7,7 +7,9 @@ foobar2000_cmd="$HOME/.foobar2000/foobar2000.exe" function foo_runcmd { - wine "$foobar2000_cmd" "${@}" &> /dev/null + if pgrep foobar2000.exe &> /dev/null; then + wine "$foobar2000_cmd" "${@}" &> /dev/null + fi }