-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguitarix.sh
executable file
·77 lines (66 loc) · 1.87 KB
/
guitarix.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# Start guitarix in a docker container
set -euo pipefail
models_dir="$HOME/Dropbox"
guitarix_config="$HOME/.config/guitarix"
shared_files="$HOME/.local/share/guitarix"
# Add usage function
usage() {
echo "Usage: $0"
echo " Start guitarix in a docker container"
echo ""
echo "Options:"
echo " -m <models_dir> Absolute path to models directory (IR, NAM, RTNeural) on host"
exit 1
}
while getopts m:h opt; do
case $opt in
m)
models_dir="$OPTARG"
;;
h)
usage
exit 0
;;
\?)
usage
exit 1
;;
esac
done
xhost +
# expand variable and check it begins with a slash
models_dir=$(echo $models_dir)
if [[ ! $models_dir =~ ^/ ]]; then
echo "Models directory must be an absolute path"
exit 1
fi
# Format model dir, remove slash and all
models_dir=$(echo $models_dir | sed 's:/*$::')
if [ ! -d "$models_dir" ]; then
echo "Models directory does not exist: $models_dir"
exit 1
fi
echo "Using models directory: $models_dir"
# Create guitarix config directory if it doesn't exist
if [ ! -d "$guitarix_config" ]; then
echo "Creating guitarix config directory: $guitarix_config"
mkdir -p "$guitarix_config"
fi
# TODO does line below impact tuner error?
# -v /run/user/$(id -u)/at-spi/bus_0:/run/user/$(id -u)/at-spi/bus_0 \
docker run -it \
--privileged \
--ulimit memlock=-1:-1 \
--user=$(id -u):$(id -g) \
-e DISPLAY=$DISPLAY \
-e PIPEWIRE_RUNTIME_DIR=/tmp \
-e HOME=$HOME \
-w $HOME \
-v $guitarix_config:$HOME/.config/guitarix \
-v $models_dir:$HOME/models \
-v $shared_files:$shared_files \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /run/user/$(id -u)/at-spi/bus_0:/run/user/$(id -u)/at-spi/bus_0 \
-v /run/user/$(id -u)/pipewire-0:/tmp/pipewire-0 \
-- guitarix pw-jack guitarix