This repository has been archived on 2023-12-23. You can view files and clone it, but cannot push or open issues or pull requests.
office/install.sh
2023-10-29 21:47:02 +01:00

39 lines
1.1 KiB
Bash
Executable File

#!/bin/bash -e
CRI=(podman)
CRI_OPT=()
if [ -z "$WAYLAND_DISPLAY" ]; then
CRI_OPT+=(
--network=host
-e XAUTHORITY=/app/.Xauthority
-v "$XAUTHORITY:/app/.Xauthority:ro"
)
fi
ISO="$(./get_office.sh)"
DEV="$(udisksctl loop-setup -f "$ISO" | awk '{print $NF}' | awk 1 RS='.\n')"
OFFICE="$(udisksctl mount -b "$DEV" | awk '{print $NF}')"
"${CRI[@]}" volume create -o=o=uid=1000 office || true
"${CRI[@]}" build -t office .
"${CRI[@]}" run --rm --name office \
"${CRI_OPT[@]}" \
--ipc=host \
--device /dev/dri/ \
-e DISPLAY \
-e XDG_RUNTIME_DIR \
-v /tmp/.X11-unix/:/tmp/.X11-unix/ \
-v "$XDG_RUNTIME_DIR:$XDG_RUNTIME_DIR" \
-v /usr/share/fonts/:/usr/share/fonts/:ro \
-v "$OFFICE:/mnt/:ro" \
-v office:/app/ \
--entrypoint install.sh \
office \
/opt/cxoffice/bin/cxinstaller
umount "$OFFICE"
udisksctl loop-delete -b "$DEV"