Skip to content

Instantly share code, notes, and snippets.

@Kyuunex
Last active July 27, 2023 22:14
Show Gist options
  • Save Kyuunex/43a594923ead18ff6a111026f38937c8 to your computer and use it in GitHub Desktop.
Save Kyuunex/43a594923ead18ff6a111026f38937c8 to your computer and use it in GitHub Desktop.
Simplest script to install/run osu! (stable) on Linux (in 50 lines of code)

osu stable on linux

Simplest script to install/run osu! (stable) on Linux

Firstly, make sure you have wine, winetricks, and it's dependencies installed.

You can scroll down at the bottom of this page to audit the script if you want to, it's only 50 lines of code.

When you are ready, download the script in your /home/your_username/.local/bin folder and make it executable through these commands:

mkdir -p "$HOME/.local/bin/"
wget -O "$HOME/.local/bin/osu-stable" "https://gist.githubusercontent.com/Kyuunex/43a594923ead18ff6a111026f38937c8/raw/osu-stable"
chmod +x "$HOME/.local/bin/osu-stable"
  • (This assumes your /home/your_username/.local/bin folder is in your $PATH, which is the case in most beginner-friendly Linux distros, at least after the folder is created and system is restarted. echo $PATH to check, and if it's not there, Google how to add it.)
  • (Optional) Open the script in your text editor of choice and on the first line, change the installation location. If you already have the game files, just point it to it's folder. It won't re-download them.
  • When you are done, run the script in the terminal, osu-stable.
  • During this, it will download the icon, make a menu entry, and set up the wine prefix. Just wait.
  • (Rare) If it hangs while installing the .NET Framework, type killall mscorsvw.exe in a different terminal window.
  • When the script is done, it will launch osu. You can do whatever you want.
  • All subsequent launches can be done through the menu entry the script made.

(My script uses the wine registry strings found in Franc[e]sco's forum post.)

Tablet Drivers (optional)

I recommend OpenTabletDriver

Japanese, Korean, Chinese fonts (optional)

Since my script installs GDI+, you will need Microsoft Windows fonts. You typically extract/copy them from a Windows install and put them in /home/your_username/.fonts/windows-fonts/ folder.

Lower audio latency (optional)

On Line 42, choose between these 2 options:

  • winetricks sound=pulse - If you want to use PulseAudio or PipeWire audio servers. (Default, recommended)
  • winetricks sound=alsa - If you want to use ALSA.

Linux distributions these days either use PulseAudio or PipeWire as the audio server (both sit on top of ALSA).
PulseAudio requires manually tweaking to lower the latency.
PipeWire typically has "good enough" latency out of the box.

If you want to get an even lower latency, you can bypass the audio server and use ALSA directly. The downside is, you need an audio server to mix the audio output from multiple applications (like Discord + osu!) to send to ALSA, so, when osu is outputting sound directly through ALSA to a physical audio port, no other application can output sound to that physical audio port at the same time.

Also, Please don't use Audio Compatibility Mode, it makes the latency higher.

Custom kernels (optional)

If you are experiencing stuttering you can give a custom kernel a try as a last resort.
The stock Linux kernel is not configured specifically for gaming, it is much more generalized to work well on servers, etc. But since it's open-source, there are custom ones made, optimized more for desktop workloads, such as gaming. I personally run the ZEN kernel on Arch.

For Debian/Ubuntu based distros: Liquorix, XanMod
For Arch based distros: The Linux ZEN, Linux-ck, Liquorix, XanMod

#!/bin/sh
export OSU_INSTALL_LOCATION="$HOME/.local/share/osu-stable/"
export WINEPREFIX="$HOME/.local/share/wineprefixes/osu-stable"
export WINEARCH=win32
export vblank_mode=0
export __GL_SYNC_TO_VBLANK=0
if ! command -v wine > /dev/null
then
echo "wine is not installed! please install wine and winetricks first."
exit 1
fi
if [ ! -f "$HOME/.local/share/applications/osu-stable.desktop" ]
then
mkdir -p "$HOME/.local/share/applications/"
echo -e "[Desktop Entry]\nType=Application\nName=osu!\nIcon=osu-stable\nExec=osu-stable %U\nCategories=Game;\nStartupWMClass=osu!.exe\nMimeType=x-scheme-handler/osu" > "$HOME/.local/share/applications/osu-stable.desktop"
fi
if [ ! -f "$HOME/.local/share/icons/osu-stable.png" ]
then
mkdir -p "$HOME/.local/share/icons/"
wget -O "$HOME/.local/share/icons/osu-stable.png" "https://raw.githubusercontent.com/ppy/osu-wiki/c2f8cfe81886cbf582fb670aa5338f2c2ce22996/wiki/Brand_identity_guidelines/img/usage-full-colour.png"
fi
if [ ! -d "$OSU_INSTALL_LOCATION" ]
then
mkdir -p "$OSU_INSTALL_LOCATION"
wget -O "$OSU_INSTALL_LOCATION/osu!.exe" "https://m1.ppy.sh/r/osu!install.exe"
fi
if [ ! -d "$WINEPREFIX" ]
then
mkdir -p "$WINEPREFIX"
winetricks -q --force dotnet48 comctl32 gdiplus_winxp winxp
wine reg add "HKCU\Software\Wine\DirectSound" /v "HelBuflen" /t REG_SZ /d "512" /f
wine reg add "HKCU\Software\Wine\DirectSound" /v "SndQueueMax" /t REG_SZ /d "3" /f
fi
winetricks sound=pulse # `sound=pulse` or `sound=alsa`
cd "$OSU_INSTALL_LOCATION"
wine "osu!.exe" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment