configure-stormux/.includes/gaming.sh

44 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# URL from where wine is downloaded, must be i686
wineURL="https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine-7.11-upstream-linux-x86.tar.gz"
# Install required packages
install_package cabextract box86 dos2unix p7zip unzip xdotool
# Download and install wine
wineFile="$(mktemp)"
curl --output "$wineFile" "$wineURL"
# Create wine directory
sudo "${sudoFlags[@]}" mkdir -p /opt/wine
pushd /opt/wine
sudo "${sudoFlags[@]}" tar vxf "$wineFile"
popd
# Create files and links in /usr/local/bin
sudo "${sudoFlags[@]}" mkdir -p /usr/local/bin
echo -e '#!/bin/bash\nsetarch linux32 -L /opt/wine/bin/wine "$@"' | sudo "${sudoFlags[@]}" tee /usr/local/bin/wine > /dev/null
sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/wine
find /opt/wine/bin/ -maxdepth 1 -type f -perm -u+x -exec bash -c '
for i ; do
sudo "${sudoFlags[@]}" ln -s "$i" /usr/local/bin/
sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/"${i##*/}"
done' _ {} \;
# Install audiogame-manager
if [[ -d ~/audiogame-manager ]]; then
git -C ~/audiogame-manager pull
else
git clone https://git.stormux.org/storm/audiogame-manager ~/audiogame-manager
fi
cat << EOF | sudo "${sudoFlags[@]}" tee /usr/local/bin/audiogame-manager &> /dev/null
#!/usr/bin/env bash
pushd ~/audiogame-manager
./audiogame-manager.sh $@
exit 0
EOF
sudo "${sudoFlags[@]}" chmod 755 /usr/local/bin/audiogame-manager
restart