From 39eb3c2d8abc5429ca3564bc29423981485ec326 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Mon, 14 Apr 2025 19:50:09 +0200 Subject: [PATCH] - Add '-d' option to disable sound. --- ReadMe.txt | 3 ++- ReleaseNotes.txt | 3 ++- bin/run.sh | 39 +++++++++++++++++++++++++-------------- compose.yaml | 2 +- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ReadMe.txt b/ReadMe.txt index e81b75b..1851e52 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -7,7 +7,8 @@ This is project aims to build a X11 + Pulse + NVidia docker image able to run an Features: - Curtently based on rx3-docker/x11-pulse:1.2.3-mga9 image, - NVidia libs installed, - - Require nvidia-container-toolkit installed on the host. + - Require nvidia-container-toolkit installed on the host, + - Add '-d' option to disable sound. Usage: ./bin/run.sh [-h] [-i] [Args...] diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index db308b8..a833535 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -3,4 +3,5 @@ Rx3-Docker/X11-Pulse-NVidia V 1.0.0 - A. GIBERT - 2025/04/14 ------------------------------------------------------------------------------------------------------------------------------------ - Initial release, -- Based on rx3/x11-pulse-mga9:1.2.3 image. +- Based on rx3/x11-pulse-mga9:1.2.3 image, +- Add '-d' option to disable sound. diff --git a/bin/run.sh b/bin/run.sh index bf3c9a0..f1c76e7 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -8,21 +8,32 @@ APPL_HOME_DIR="$(dirname "$(dirname "$0")")" #------------------------------------------------------------------------------- -if [[ "$1" == "-h" ]] -then - echo "usage: run.sh [-h] [-i] [Args...]" - echo "with -i enabling internet access." - - exit 0 -fi +export APPL_NETWORK="no-internet" +export PULSE_DISABLE_FLAG="" -if [[ "$1" == "-i" ]] -then - shift; - export APPL_NETWORK="internet" -else - export APPL_NETWORK="no-internet" -fi +while [[ "$1" == "-h" || "$1" == "-d" || "$1" == "-i" ]] +do + if [[ "$1" == "-h" ]] + then + echo "usage: run.sh [-h] [-d] [-i] [Args...]" + echo "with -d disabling sound," + echo "with -i enabling internet access." + + exit 0 + fi + + if [[ "$1" == "-d" ]] + then + shift; + export PULSE_DISABLE_FLAG="-disabled" + fi + + if [[ "$1" == "-i" ]] + then + shift; + export APPL_NETWORK="internet" + fi +done export APPL_DIR="$1" shift diff --git a/compose.yaml b/compose.yaml index 03b337f..add60bc 100644 --- a/compose.yaml +++ b/compose.yaml @@ -36,7 +36,7 @@ services: target: /tmp/.X11-unix/X0 - type: bind source: /run/user/${USER_ID}/pulse - target: /run/user/${USER_ID}/pulse + target: /run/user/${USER_ID}/pulse${PULSE_DISABLE_FLAG} - type: bind source: "${APPL_DIR}" target: "${APPL_DIR}"