Compare commits

...

2 Commits

Author SHA1 Message Date
Simon Bruder 6f641bbd97
Add run script and readme
continuous-integration/drone/push Build is failing Details
2020-06-10 16:33:29 +02:00
Simon Bruder da2b952ec7
Remove unnecessary find symlink wizardry 2020-06-10 16:21:55 +02:00
3 changed files with 53 additions and 3 deletions

View File

@ -20,9 +20,7 @@ RUN apt-get update \
ffmpeg \
libgl1 \
pulseaudio \
&& rm -rf /var/lib/apt/lists/* \
&& find /usr/lib/x86_64-linux-gnu/ -type l -name 'libav*.so*' -exec sh -c 'cp {} $(echo {}|sed 's/\.[^\.]*$//')' \; \
&& find /usr/lib/x86_64-linux-gnu/ -type l -name 'libswscale.so*' -exec sh -c 'cp {} $(echo {}|sed 's/\.[^\.]*$//')' \;
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/osu/ /opt/osu/

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# *osu!lazer* in docker
## How to use
Place `run.sh` in a directory of your choice. On first run, the directories
`data` and `import` will be created.
To import a beatmap, place it in the `import` directory, open a graphical file
manager and drag-and-drop the file into *osu!*.
## Known Bugs
* *osu!* shows `Couldnt list input devices. Is libasound2-dev installed?` at
startup. Fixing this requires installing `libasound2-dev` in the runtime
container and mounting `/dev/snd` in the container. This is not done as this
container is intended to be used with PulseAudio (which works).
<small>This is not an official product by ppy Pty Ltd. *osu!* is a registered
trademark by ppy Pty Ltd.</small>

33
run.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
function set_latency_offset() {
if [ $# != 1 ]; then
return 1
fi
echo "Set latency offset to $1 µs" >&2
pactl set-port-latency-offset alsa_card.pci-0000_00_1b.0 analog-output-headphones $1
}
set_latency_offset -40000
trap "set_latency_offset 0" SIGINT SIGTERM EXIT
BASEDIR="$(dirname $(realpath -s $0))"
mkdir -p "$BASEDIR/data" "$BASEDIR/import"
docker run \
--rm \
-it \
--name osu \
-e DISPLAY \
-e PULSE_SERVER=/run/user/$(id -u)/pulse/native \
-e PULSE_COOKIE=/run/pulse/cookie \
--device /dev/dri \
--group-add $(getent group video|cut -d: -f3) \
--group-add $(getent group audio|cut -d: -f3) \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v /run/user/$(id -u)/pulse/native:/run/user/$(id -u)/pulse/native \
-v "$HOME/.config/pulse/cookie:/run/pulse/cookie" \
-v "$BASEDIR/data/:/home/osu/osu/" \
-v "$BASEDIR/import/:$BASEDIR/import/" \
r.sbruder.de/osu \
$@