Skip to content

Instantly share code, notes, and snippets.

@iAmInActions
Last active November 15, 2023 08:28
Show Gist options
  • Save iAmInActions/3fb8c92852f482b31e630b0897cc8865 to your computer and use it in GitHub Desktop.
Save iAmInActions/3fb8c92852f482b31e630b0897cc8865 to your computer and use it in GitHub Desktop.
A script to install osu! under Debian, Void or Arch based linux distributions
#!/bin/bash
# Set directory to install to here:
export OSUINSTALLDIR=~/.local/games/osu
#export OSUINSTALLDIR=$(pwd) # uncomment if you want to install to the same directory the script is located in
clear
echo '
__ __ _ _ _ _ __ _ _
| \/ (_)_ _ | |_(_| )___ / _|__ _| |__ _ _| |___ _ _ ___
| |\/| | | " \| / / |/(_-< | _/ _" | "_ \ || | / _ \ || (_-<
|_| |_|_|_||_|_\_\_| /__/ |_| \__,_|_.__/\_,_|_\___/\_,_/__/
| | (_)_ _ _ ___ __ ___ ____ _| | (_)_ _ __| |_ __ _| | |___ _ _
| |__| | " \ || \ \ / / _ (_-< || |_| | | " \(_-< _/ _` | | / -_) "_|
|____|_|_||_\_,_/_\_\ \___/__/\_,_(_) |_|_||_/__/\__\__,_|_|_\___|_|
Version 1.0 - Supports Debian, Void and Arch based distributions.
(c) 2023 mueller_minki; Feel free to modify and/or share'
if [ "$EUID" -eq 0 ]
then
echo "This script must not be run as root."
exit 1
fi
sleep 2
# Install dependencies
if command -v apt &> /dev/null; then
# APT exists
echo "Installing linux dependencies via APT..."
sudo apt install p7zip icoutils
elif command -v xbps-install &> /dev/null; then
# xbps exists
echo "Installing linux dependencies via xbps..."
sudo xbps-install -Su p7zip icoutils
elif command -v pacman &> /dev/null; then
# pacman exists
echo "Installing linux dependencies via pacman..."
sudo pacman -S p7zip icoutils
else
# No supported package manager
echo "Unsupported operating system. This script currently only supports Debian, Void or Arch based systems. Feel free to add support for your distribution!"
exit 127
fi
# Downoad and Extract data
echo "Downloading data..."
mkdir -p $OSUINSTALLDIR
cd $OSUINSTALLDIR
wget https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-23/GE-Proton8-23.tar.gz
tar -xvf GE-Proton8-23.tar.gz
rm GE-Proton8-23.tar.gz
wget https://m1.ppy.sh/r/osu!install.exe
# Create wine prefix for game
echo "Setting prefix..."
export WINEPREFIX="$(pwd)/prefix"
mkdir $WINEPREFIX
# Set up Proton
echo "Installing Proton..."
PATH="$(pwd)/GE-Proton8-23/files/bin":$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$(pwd)/GE-Proton8-23/files/lib":"$(pwd)/GE-Proton8-23/files/lib64"
wineserver
wine wineboot
# Extract icon
echo "Extracting icon..."
7z x 'osu!install.exe' .rsrc/ICON/5.ico
mv .rsrc/ICON/5.ico icon.ico
icotool -x -r icon.ico
rm icon.ico
rm -r .rsrc
# Install osu!
echo "Installing osu..."
wine 'osu!install.exe'
rm 'osu!install.exe'
# Set up dependencies
echo "Installing windows dependencies..."
./GE-Proton8-23/protonfixes/winetricks dxvk dotnet40 cjkfonts
# Modify paths to avoid interpreting names as syntax
echo 'Setting up game directory...'
mv $(pwd)'/prefix/drive_c/users/steamuser/AppData/Local/osu!/'* .
# Create launch script
echo "Creating launch script..."
cat > osu.sh <<- EOM
#!/bin/bash
cd "$OSUINSTALLDIR"
echo "Starting osu!..."
export WINEPREFIX="\$(pwd)/prefix"
PATH="\$(pwd)/GE-Proton8-23/files/bin":\$PATH
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:"\$(pwd)/GE-Proton8-23/files/lib":"\$(pwd)/GE-Proton8-23/files/lib64"
wine 'osu!.exe'
EOM
chmod +x osu.sh
# Install application shortcut
echo "Adding desktop entries..."
mkdir -p ~/.local/share/applications
cat > ~/.local/share/applications/osu.desktop <<- EOM
[Desktop Entry]
Version=1.0
Type=Application
Name=osu!
Comment=The bestest free-to-win rhythm game! Rhythm is just a click away.
Exec="$OSUINSTALLDIR/osu.sh"
Icon=$OSUINSTALLDIR/icon_1_128x128x32.png
Path=$OSUINSTALLDIR
Categories=Proton;Wine;Game;
Keywords=proton;wine;game;osu;rythm;rythmgame;
Terminal=true
StartupNotify=false
EOM
chmod +x ~/.local/share/applications/osu.desktop
echo "Game install completed."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment