├── stuff ├── cabextract ├── osu-wine.png ├── osu-handler-wine ├── folderfixosu ├── folderfixosu.vbs ├── winello-default.cfg ├── osu-handler.reg └── example.cfg ├── README.md ├── osu-wine ├── LICENSE.md └── osu-winello.sh /stuff/cabextract: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NelloKudo/osu-winello/HEAD/stuff/cabextract -------------------------------------------------------------------------------- /stuff/osu-wine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NelloKudo/osu-winello/HEAD/stuff/osu-wine.png -------------------------------------------------------------------------------- /stuff/osu-handler-wine: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NelloKudo/osu-winello/HEAD/stuff/osu-handler-wine -------------------------------------------------------------------------------- /stuff/folderfixosu: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # if the path ends in a quote, strip it, otherwise keep full path 4 | if [[ "${2}" == *'"' ]]; then 5 | truepath="${2%?}" 6 | else 7 | truepath="${2}" 8 | fi 9 | 10 | # use winepath to convert the Windows path to a proper Unix path 11 | unixpath="$("$WINE_PATH" winepath -u "$truepath")" 12 | exec "$1" "$unixpath" 13 | -------------------------------------------------------------------------------- /stuff/folderfixosu.vbs: -------------------------------------------------------------------------------- 1 | winPath = WScript.Arguments(0) 2 | 3 | If Left(winPath, 1) = """" And Right(winPath, 1) = """" Then 4 | winPath = Mid(winPath, 2, Len(winPath) - 2) 5 | End If 6 | 7 | openPath = Replace(winPath, "\", "/") 8 | 9 | cmd = "winebrowser.exe ""file:///" & openPath 10 | 11 | Set WshShell = CreateObject("WScript.Shell") 12 | WshShell.Run cmd, 0, False 13 | Set WshShell = Nothing 14 | -------------------------------------------------------------------------------- /stuff/winello-default.cfg: -------------------------------------------------------------------------------- 1 | # Don't modify this file, it will be overwritten on updates. 2 | # Instead, move stuff/example.cfg to ~/.local/share/osuconfig/configs and modify that. 3 | # You can add more environment variables if needed there. 4 | 5 | PRE_LAUNCH_ARGS="${LAUNCH_ARGS:-} ${PRE_LAUNCH_ARGS:-}" # LAUNCH_ARGS for backwards compat 6 | POST_LAUNCH_ARGS="${POST_LAUNCH_ARGS:-}" 7 | 8 | WINENTSYNC="${WINENTSYNC:-0}" 9 | WINEFSYNC="${WINEFSYNC:-1}" 10 | WINEESYNC="${WINEESYNC:-1}" 11 | 12 | WINE_DISABLE_FULLSCREEN_HACK="${WINE_DISABLE_FULLSCREEN_HACK:-1}" 13 | 14 | vblank_mode="${vblank_mode:-0}" 15 | 16 | __GL_SYNC_TO_VBLANK="${__GL_SYNC_TO_VBLANK:-0}" 17 | 18 | CUSTOMEDITOR="${CUSTOMEDITOR:-nano}" 19 | 20 | # reduce possibility of breakage (don't allow env override) 21 | LC_ALL="en_US.UTF-8" 22 | LANG="en_US.UTF-8" 23 | -------------------------------------------------------------------------------- /stuff/osu-handler.reg: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | [HKEY_CLASSES_ROOT\osu] 4 | @="URL:osu!" 5 | "URL Protocol"="" 6 | 7 | [HKEY_CLASSES_ROOT\osustable.File.osk] 8 | @="osu! Skin" 9 | 10 | [HKEY_CLASSES_ROOT\osustable.File.osk\DefaultIcon] 11 | @="\"D:\\osu!.exe\",1" 12 | 13 | [HKEY_CLASSES_ROOT\osustable.File.osk\Shell] 14 | 15 | [HKEY_CLASSES_ROOT\osustable.File.osk\Shell\Open] 16 | 17 | [HKEY_CLASSES_ROOT\osustable.File.osk\Shell\Open\Command] 18 | @="\"D:\\osu!.exe\" \"%1\"" 19 | 20 | [HKEY_CLASSES_ROOT\osustable.File.osr] 21 | @="osu! Replay" 22 | 23 | [HKEY_CLASSES_ROOT\osustable.File.osr\DefaultIcon] 24 | @="\"D:\\osu!.exe\",1" 25 | 26 | [HKEY_CLASSES_ROOT\osustable.File.osr\Shell] 27 | 28 | [HKEY_CLASSES_ROOT\osustable.File.osr\Shell\Open] 29 | 30 | [HKEY_CLASSES_ROOT\osustable.File.osr\Shell\Open\Command] 31 | @="\"D:\\osu!.exe\" \"%1\"" 32 | 33 | [HKEY_CLASSES_ROOT\osustable.File.osz] 34 | @="osu! Beatmap" 35 | 36 | [HKEY_CLASSES_ROOT\osustable.File.osz\DefaultIcon] 37 | @="\"D:\\osu!.exe\",1" 38 | 39 | [HKEY_CLASSES_ROOT\osustable.File.osz\Shell] 40 | 41 | [HKEY_CLASSES_ROOT\osustable.File.osz\Shell\Open] 42 | 43 | [HKEY_CLASSES_ROOT\osustable.File.osz\Shell\Open\Command] 44 | @="\"D:\\osu!.exe\" \"%1\"" 45 | 46 | [HKEY_CLASSES_ROOT\osustable.File.osz2] 47 | @="osu! Beatmap" 48 | 49 | [HKEY_CLASSES_ROOT\osustable.File.osz2\DefaultIcon] 50 | @="\"D:\\osu!.exe\",1" 51 | 52 | [HKEY_CLASSES_ROOT\osustable.File.osz2\Shell] 53 | 54 | [HKEY_CLASSES_ROOT\osustable.File.osz2\Shell\Open] 55 | 56 | [HKEY_CLASSES_ROOT\osustable.File.osz2\Shell\Open\Command] 57 | @="\"D:\\osu!.exe\" \"%1\"" 58 | 59 | [HKEY_CLASSES_ROOT\osustable.Uri.osu] 60 | 61 | [HKEY_CLASSES_ROOT\osustable.Uri.osu\DefaultIcon] 62 | @="\"D:\\osu!.exe\",1" 63 | 64 | [HKEY_CLASSES_ROOT\osustable.Uri.osu\Shell] 65 | 66 | [HKEY_CLASSES_ROOT\osustable.Uri.osu\Shell\Open] 67 | 68 | [HKEY_CLASSES_ROOT\osustable.Uri.osu\Shell\Open\Command] 69 | @="\"D:\\osu!.exe\" \"%1\"" 70 | 71 | [HKEY_CLASSES_ROOT\.osk] 72 | 73 | [HKEY_CLASSES_ROOT\.osk\OpenWithProgIds] 74 | "osustable.File.osk"="" 75 | 76 | [HKEY_CLASSES_ROOT\.osr] 77 | 78 | [HKEY_CLASSES_ROOT\.osr\OpenWithProgIds] 79 | "osustable.File.osr"="" 80 | 81 | [HKEY_CLASSES_ROOT\.osz] 82 | 83 | [HKEY_CLASSES_ROOT\.osz\OpenWithProgIds] 84 | "osustable.File.osz"="" 85 | 86 | [HKEY_CLASSES_ROOT\.osz2] 87 | 88 | [HKEY_CLASSES_ROOT\.osz2\OpenWithProgIds] 89 | "osustable.File.osz2"="" 90 | 91 | [HKEY_CLASSES_ROOT\osu] 92 | @=- 93 | "URL Protocol"="" 94 | 95 | [HKEY_CLASSES_ROOT\osu\shell] 96 | 97 | [HKEY_CLASSES_ROOT\osu\shell\open] 98 | 99 | [HKEY_CLASSES_ROOT\osu\shell\open\command] 100 | @="\"D:\\osu!.exe\" \"%1\"" 101 | -------------------------------------------------------------------------------- /stuff/example.cfg: -------------------------------------------------------------------------------- 1 | # This file won't be overwritten, feel free to add your own launch options and environment variables 2 | # You can rename it if you want, or keep it as example.cfg, as long as it stays in the osuconfig/stuff folder 3 | # and ends in .cfg, it will be loaded. 4 | 5 | ## Uncomment this and change it to your favourite editor for `osu-wine --edit-config`! It's "nano" by default. 6 | # CUSTOMEDITOR=microsoft-word 7 | 8 | ## Uncomment (remove the # ) and put wrapper programs like prime-run, gamemoderun, or mangohud in between the quotes here! 9 | # PRE_LAUNCH_ARGS="gamemoderun" 10 | 11 | ## Uncomment (remove the # ) and put arguments you always want to append to `osu!.exe` in between the quotes here: 12 | # POST_LAUNCH_ARGS="-devserver gatari.pw" 13 | 14 | ## Uncomment this to switch to wine-osu-cachy (alternative wine-osu based on wine-cachyos/wine-valve) 15 | ## WINE_USE_CACHY="true" 16 | 17 | ## Uncomment this to play with absolute mode in OTD on Wayland (if this doesn't work, check the "Tablet issues" page in the osu-winello wiki) 18 | # WINE_ENABLE_ABS_TABLET_HACK=2 19 | 20 | ## Uncomment this to enable Windows fonts/boss key, but it might cause crashes in future updates! Revert back if so. 21 | # WINE_BLOCK_GET_VERSION=1 22 | 23 | ## Uncomment this to force fixes for alt-tab (only if needed!) 24 | # WINE_ENABLE_OSU_FOCUS_FIX=1 25 | 26 | ## Uncomment this to enable NTsync (when possible, requires Linux >=6.14 or the DKMS module installed) 27 | # WINENTSYNC=1 28 | 29 | ## Uncomment this to disable Fsync (not recommended, only for troubleshooting) 30 | # WINEFSYNC=0 31 | 32 | ## Uncomment this to disable Esync (not recommended, only for troubleshooting) 33 | # WINEESYNC=0 34 | 35 | ## Uncomment the line below to try the native winewayland.drv driver (unsupported, but feel free to experiment if you're on Wayland) 36 | # DISPLAY= 37 | 38 | ## Set custom logging channels for Wine 39 | # WINEDEBUG="-wineboot" 40 | 41 | ## Uncomment this to enable vsync for mesa 42 | # vblank_mode=1 43 | 44 | ## Uncomment this to enable threaded OpenGL optimizations for AMD/Intel 45 | ## (unsupported, use at your own risk! May INCREASE FPS, but may also INCREASE input latency due to multithreading overhead) 46 | # mesa_glthread=true 47 | 48 | ## Uncomment this to enable vsync for NVIDIA >=510 49 | # __GL_SYNC_TO_VBLANK=1 50 | 51 | ## Uncomment this to enable threaded OpenGL optimizations for NVIDIA 52 | ## (unsupported, use at your own risk! May INCREASE FPS, but may also INCREASE input latency due to multithreading overhead) 53 | # __GL_THREADED_OPTIMIZATIONS=1 54 | 55 | ## Uncomment this to minimize the pre-rendered frames for NVIDIA (driver default is 2, 0 does nothing) 56 | ## (unsupported, use at your own risk! Will LOWER FPS for a slightly LOWER input latency) 57 | # __GL_MaxFramesAllowed=1 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # osu-winello 2 | osu! stable installer for Linux with patched wine-osu and other features. 3 | 4 | ![ezgif com-video-to-gif(1)](https://user-images.githubusercontent.com/98063377/224407211-70fa648c-b96f-442b-b5f5-eaf28a84670a.gif) 5 | 6 | # Index 7 | 8 | - [Installation](#installation) 9 | - [Prerequisites](#prerequisites) 10 | - [Drivers](#drivers) 11 | - [PipeWire](#pipewire) 12 | - [Installing osu!](#installing-osu) 13 | - [Features](#features) 14 | - [Customization](#customization) 15 | - [Optimizations](#optimizations) 16 | - [Troubleshooting](#troubleshooting) 17 | - [Flags](#flags) 18 | - [Steam Deck Support](#steam-deck-support) 19 | - [Credits](#credits) 20 | 21 | # Installation 22 | 23 | ## Prerequisites 24 | 25 | The only requirements, besides **64-bit graphics drivers**, are `git`, `zenity`, `wget`, `unzip` and `xdg-desktop-portal-gtk` (for in-game links). 26 | 27 | You can easily install them like this: 28 | 29 | **Ubuntu/Debian:** `sudo apt install -y git wget unzip zenity xdg-desktop-portal-gtk` 30 | 31 | **Arch Linux:** `sudo pacman -Syu --needed --noconfirm git wget unzip zenity xdg-desktop-portal-gtk` 32 | 33 | **Fedora:** `sudo dnf install -y git wget unzip zenity xdg-desktop-portal-gtk` 34 | 35 | **openSUSE:** `sudo zypper install -y git wget unzip zenity xdg-desktop-portal-gtk` 36 | 37 | ## Drivers: 38 | 39 | As obvious as this might sound, installing drivers the **right** way is needed to have a great experience overall 40 | and avoid poor performance or other problems. 41 | 42 | Keep in mind that osu! needs **64-bit graphics drivers** in order to run as it should, so 43 | if you're having performance problems, it's probably related to this. 44 | 45 | This is usually something like `nvidia-utils` or `nvidia-driver` for NVIDIA, and `libgl1-mesa-dri` for AMD/Intel. 46 | 47 | You may find more helpful instructions for your distro here (only 64-bit is required): 48 | - [Installing Drivers](https://github.com/lutris/docs/blob/master/InstallingDrivers.md) 49 | 50 | If you're still confused, try installing Steam with your package manager. That will install the necessary drivers for your distro. 51 | 52 | ## PipeWire: 53 | 54 | `PipeWire` **isn't really a dependency but is highly recommended, especially with this script.** 55 | 56 | Check if it's already on your system with: 57 | 58 | ``` 59 | LANG=C pactl info | grep "Server Name" 60 | ``` 61 | 62 | If it shows `Server Name: PulseAudio (on Pipewire)` , then you're good to go. 63 | 64 | Otherwise, make sure to install it following the instructions at here: 65 | - [Installing PipeWire](https://github.com/NelloKudo/osu-winello/wiki/Installing-PipeWire) 66 | 67 | ## Installing osu!: 68 | ``` 69 | git clone https://github.com/NelloKudo/osu-winello.git 70 | cd osu-winello 71 | chmod +x ./osu-winello.sh 72 | ./osu-winello.sh 73 | ``` 74 | 75 | You can now launch osu! with: 76 | ``` 77 | osu-wine 78 | ``` 79 | ### ⚠ **!! \o/ !!** ⚠ : 80 | - You might need to relaunch your terminal to launch the game. 81 | - Use **-40/35ms** global offset to make up for Wine quirks (or -25 if you're using audio compatibility mode). These values work for most setups, but your mileage may vary. Keep an eye on the hit meter! 82 | 83 | # Features: 84 | - Comes with **updatable patched** [wine-osu](https://github.com/NelloKudo/WineBuilder/releases) binaries with the latest osu! patches for low-latency audio, better performance, alt-tab behavior, crashes fixes and more. 85 | - Uses [yawl](https://github.com/whrvt/yawl) to run wine-osu in Steam's runtime, providing great performance on every system without needing to download dependencies. 86 | - Provides [osu-handler](https://aur.archlinux.org/packages/osu-handler) for importing maps and skins, Discord RPC with [rpc-bridge](https://github.com/EnderIce2/rpc-bridge) and support for native file managers! 87 | - Supports the latest [tosu](https://github.com/KotRikD/tosu) and legacy [gosumemory](https://github.com/l3lackShark/gosumemory) for streaming etc. with automatic install! (Check [flags](#flags)!) 88 | - Installs osu! on either default or custom path (using the zenity GUI), also working for already existing osu! installations from Windows! 89 | - Skips the pain of downloading Wineprefix thanks to [my fork](https://gitlab.com/NelloKudo/osu-winello-prefix) of [osu-wineprefix](https://gitlab.com/osu-wine/osu-wineprefix) 90 | - Support for Windows fonts pre-installed in Wine (JP fonts, special characters etc.) 91 | 92 | For a clearer overview of everything the script does, DeepWiki did a great job summarizing it. Check it out: 93 | - [deepwiki/osu-winello](https://deepwiki.com/NelloKudo/osu-winello) 94 | 95 | # Customization 96 | 97 | Winello allows you to set launch arguments or custom environment variables using `.cfg` files located in: 98 | 99 | ``` 100 | ~/.local/share/osuconfig/configs 101 | ``` 102 | 103 | An `example.cfg` file is provided, containing all supported environment variables along with usage instructions. 104 | 105 | ### Example 106 | To add `mangohud` to the launch arguments, edit the configuration file: 107 | 108 | ```sh 109 | nano ~/.local/share/osuconfig/configs/example.cfg 110 | # or simply: osu-wine --edit-config 111 | ``` 112 | 113 | There, uncomment the existing `# PRE_LAUNCH_ARGS=""` line (remove the #), or add a new one, like so: 114 | 115 | ```sh 116 | PRE_LAUNCH_ARGS="mangohud" 117 | ``` 118 | 119 | If you want to always run on a custom server, just edit `POST_LAUNCH_ARGS` in a similar fashion. An example is shown in the same file. 120 | 121 | # Optimizations 122 | 123 | Due to the vast variety of distributions and setups, follow the guide below to optimize your osu! performance: 124 | - [Optimizing: osu! performance](https://github.com/NelloKudo/osu-winello/wiki/Optimizing:-osu!-performance) 125 | 126 | # Troubleshooting 127 | 128 | Please refer to [osu-winello's wiki](https://github.com/NelloKudo/osu-winello/wiki) for troubleshooting of any type. 129 | 130 | If that doesn't help, either: 131 | - Join [ThePooN's Discord](https://discord.gg/bc4qaYjqyT) and ask in #osu-linux, they'll know how to help! <3 132 | - Write me on Discord (marshnello) 133 | 134 | # Flags: 135 | **Installation script:** 136 | ``` 137 | ./osu-winello.sh: Installs the game 138 | ./osu-winello.sh --no-deps: Installs the game but skips installing dependencies 139 | ./osu-winello.sh uninstall: Uninstalls the game 140 | ./osu-winello.sh fix-yawl: Tries to fix yawl issues (partial downloads, corruption etc.) 141 | ``` 142 | 143 | **Game script:** 144 | 145 | ``` 146 | osu-wine: Runs osu! 147 | osu-wine --help: Show this help 148 | osu-wine --info: Troubleshooting and more info 149 | osu-wine --edit-config: Open your configuration file to edit launch arguments and other customizations 150 | osu-wine --winecfg : Runs winecfg on the osu! Wineprefix 151 | osu-wine --winetricks: Install packages on osu! Wineprefix 152 | osu-wine --regedit: Opens regedit on osu! Wineprefix 153 | osu-wine --wine : Runs wine + your arguments as if it was normal wine 154 | osu-wine --kill: Kills osu! and related processes in osu! Wineprefix 155 | osu-wine --kill9: Kills osu! but with wineserver -k9 156 | osu-wine --update: Updates wine-osu to the latest version 157 | osu-wine --fixprefix: Reinstalls the osu! Wineprefix from system 158 | osu-wine --fixfolders: Reconfigure osu-handler and native file integration (run this if osu!direct/.osz/.osk/opening folders from ingame is broken) 159 | osu-wine --fix-yawl: Reinstalls files related to yawl and the Steam Runtime in case something went wrong 160 | osu-wine --fixrpc: Reinstalls rpc-bridge if needed! 161 | osu-wine --remove: Uninstalls osu! and the script 162 | osu-wine --changedir: Changes directory of the install according to the user 163 | osu-wine --devserver
: Runs osu with an alternative server (e.g. --devserver akatsuki.gg) 164 | osu-wine --runinprefix : Launches a custom executable within osu!'s Wineprefix 165 | osu-wine --osuhandler : Launches osu-handler-wine with the specified file/link 166 | osu-wine --gosumemory: Installs and runs gosumemory without any needed config! 167 | osu-wine --tosu: Installs and runs tosu without any needed config! 168 | osu-wine --disable-memory-reader: Turn off gosumemory and tosu 169 | osu-wine --akatsuki: Installs and runs Akatsuki patcher 170 | osu-wine --mappingtools: Installs and runs osu! Mapping Tools (experimental, WINE_USE_CACHY=true recommended) 171 | ``` 172 | 173 | NOTE: Any command can be prefixed by the letter 'n' to avoid updating when running it. 174 | 175 | e.g. `osu-wine n --fixprefix` will run `--fixprefix` without overwriting any of your files from the osu-winello git repo 176 | 177 | # Steam Deck Support 178 | 179 | Since osu! runs on Wine in the Steam Linux Runtime (same as Proton), you should be able to play on Steam Deck as well! 180 | 181 | It is recommended to not manually install PipeWire on the Steam Deck as it is already installed by default and attempting to do so may cause audio issues. 182 | 183 | # Credits 184 | 185 | Special thanks to: 186 | 187 | - [whrvt aka spectator](https://github.com/whrvt/wine-osu-patches) for his help with Wine, Proton and related, never failed to solve any issue :') 188 | - [ThePooN's Discord](https://discord.gg/bc4qaYjqyT) for supporting Winello since its early stages! 189 | - [gonX's wine-osu](https://drive.google.com/drive/folders/17MVlyXixv7uS3JW4B-H8oS4qgLn7eBw5) 190 | - [Integrating native file manager by Maot](https://gist.github.com/maotovisk/1bf3a7c9054890f91b9234c3663c03a2) 191 | - [KatouMegumi's guide](https://wiki.archlinux.org/title/User:Katoumegumi#osu!_(stable)_on_Arch_Linux) 192 | - [hwsnemo's wine-osu](https://software.opensuse.org//download.html?project=home%3Ahwsnemo%3Apackaged-wine-osu&package=wine-osu) 193 | - [diamondburned's osu-wine](https://gitlab.com/osu-wine/osu-wine) 194 | - [openglfreak's packages](https://github.com/openglfreak) 195 | - [EnderIce2's rpc-bridge](https://github.com/EnderIce2/rpc-bridge) 196 | - Last but not least, every contributor. Thanks for making Winello even better! 197 | 198 | And that's all. Have fun playing osu! 199 | 200 | ## Check the guide above for troubleshooting or extra tools! 201 | 202 | -------------------------------------------------------------------------------- /osu-wine: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" 3 | export BINDIR="${BINDIR:-$HOME/.local/bin}" 4 | 5 | ## Welcome to your osu! launch script! 6 | 7 | set -a 8 | ## Add your launch options to a file in $XDG_DATA_HOME/osuconfig/configs, likely ~/.local/share/osuconfig/configs 9 | ## You can look at the $XDG_DATA_HOME/osuconfig/configs/example.cfg for some common options (also on the git repo under 'stuff/'). 10 | ## This example file won't be overwritten, but you can copy/rename it etc. as long as it ends in .cfg 11 | 12 | ## Variables are explained with comments, but if you just need to prepend 13 | ## any argument (like gamemoderun or mangohud) before osu!, use 'PRE_LAUNCH_ARGS'! 14 | 15 | source "$XDG_DATA_HOME/osuconfig/configs/"*.cfg 2>/dev/null 16 | set +a 17 | 18 | ################################################################################################### 19 | # osu-winello internal variables, you probably don't have to touch these! 20 | ################################################################################################### 21 | 22 | set -a 23 | # Don't change this 'winello-default' file! It'll be overwritten on updates. 24 | source "$XDG_DATA_HOME/osuconfig/update/stuff/winello-default.cfg" 25 | set +a 26 | 27 | export WINE="${WINE:-$XDG_DATA_HOME/osuconfig/yawl-winello}" 28 | export WINESERVER="${WINESERVER:-${WINE}server}" 29 | export WINEPREFIX="${WINEPREFIX:-$XDG_DATA_HOME/wineprefixes/osu-wineprefix}" 30 | export WINE_INSTALL_PATH="${WINE_INSTALL_PATH:-$XDG_DATA_HOME/osuconfig/wine-osu}" 31 | 32 | export WINETRICKS="${WINETRICKS:-$XDG_DATA_HOME/osuconfig/winetricks}" 33 | 34 | export WINEDLLOVERRIDES="winemenubuilder.exe=;" # Blocks wine from creating .desktop files 35 | 36 | LAUNCHERPATH="$(realpath "$0")" 37 | export LAUNCHERPATH 38 | 39 | # Make all paths visible to pressure-vessel 40 | _mainscriptpath="$(realpath "$XDG_DATA_HOME/osuconfig/update/osu-winello.sh")" 41 | _mountline="$(df -P "$_mainscriptpath" 2>/dev/null | tail -1)" && [ -n "${_mountline}" ] && _mainscript_mount="${_mountline##* }:" # mountpoint to main script path 42 | _mountline="$(df -P "$LAUNCHERPATH" 2>/dev/null | tail -1)" && [ -n "${_mountline}" ] && _curdir_mount="${_mountline##* }:" # mountpoint to current directory 43 | _mountline="$(df -P "$XDG_DATA_HOME" 2>/dev/null | tail -1)" && [ -n "${_mountline}" ] && _home_mount="${_mountline##* }:" # mountpoint to XDG_DATA_HOME 44 | PRESSURE_VESSEL_FILESYSTEMS_RW+="${_mainscript_mount:-}${_curdir_mount:-}${_home_mount:-}/mnt:/media:/run/media" 45 | [ -r "$XDG_DATA_HOME/osuconfig/osupath" ] && OSUPATH=$(/dev/null)" # mountpoint to osu/songs directory 47 | export PRESSURE_VESSEL_FILESYSTEMS_RW="${PRESSURE_VESSEL_FILESYSTEMS_RW//\/:/:}" OSUPATH # clean any "just /" mounts, pressure-vessel doesn't like that 48 | 49 | mapfile -t configs < <(find "$XDG_DATA_HOME/osuconfig/configs" -name '*.cfg') 50 | 51 | ################################################################################################### 52 | # Helper functions for the launcher script 53 | ################################################################################################### 54 | 55 | Help() { 56 | Info "NOTE: Any command can be prefixed by the letter 'n' to avoid updating when running it 57 | e.g. \`osu-wine n --fixprefix\` will run \`--fixprefix\` without overwriting any of your files from the osu-winello git repo 58 | Script features: 59 | osu-wine: Runs osu! 60 | osu-wine --help: Show this help 61 | osu-wine --info: Troubleshooting and more info 62 | osu-wine --edit-config: Open your configuration file to edit launch arguments and other customizations 63 | osu-wine --winecfg : Runs winecfg on the osu! Wineprefix 64 | osu-wine --winetricks: Install packages on osu! Wineprefix 65 | osu-wine --regedit: Opens regedit on osu! Wineprefix 66 | osu-wine --wine : Runs wine + your arguments as if it was normal wine 67 | osu-wine --kill: Kills osu! and related processes in osu! Wineprefix 68 | osu-wine --kill9: Kills osu! but with wineserver -k9 69 | osu-wine --update: Updates wine-osu to the latest version 70 | osu-wine --fixprefix: Reinstalls the osu! Wineprefix from system 71 | osu-wine --fixfolders: Reconfigure osu-handler and native file integration (run this if osu!direct/.osz/.osk/opening folders from ingame is broken) 72 | osu-wine --fix-yawl: Reinstalls files related to yawl and the Steam Runtime in case something went wrong 73 | osu-wine --fixrpc: Reinstalls rpc-bridge if needed! 74 | osu-wine --remove: Uninstalls osu! and the script 75 | osu-wine --changedir: Changes directory of the install according to the user 76 | osu-wine --devserver
: Runs osu with an alternative server (e.g. --devserver akatsuki.gg) 77 | osu-wine --runinprefix : Launches a custom executable within osu!'s Wineprefix 78 | osu-wine --osuhandler : Launches osu-handler-wine with the specified file/link 79 | osu-wine --gosumemory: Installs and runs gosumemory without any needed config! 80 | osu-wine --tosu: Installs and runs tosu without any needed config! 81 | osu-wine --disable-memory-reader: Turn off gosumemory and tosu 82 | osu-wine --akatsuki: Installs and runs Akatsuki patcher 83 | osu-wine --mappingtools: Installs and runs osu! Mapping Tools (experimental, WINE_USE_CACHY=true recommended)" 84 | } 85 | 86 | # Won't return failure if there's no internet connection, but tries to update the main script first before calling the function 87 | MainScriptUpdate() { 88 | _clone() { GIT_TERMINAL_PROMPT=0 git clone "https://github.com/NelloKudo/osu-winello.git" "$XDG_DATA_HOME/osuconfig/update" --quiet 2>/dev/null; } 89 | _pull() { GIT_TERMINAL_PROMPT=0 git -C "$XDG_DATA_HOME/osuconfig/update" pull --quiet 2>/dev/null; } 90 | _reset() { GIT_TERMINAL_PROMPT=0 git -C "$XDG_DATA_HOME/osuconfig/update" reset --hard "${1:-HEAD}" --quiet 2>/dev/null; } 91 | if [ ! -d "$XDG_DATA_HOME/osuconfig/update" ]; then 92 | _clone # where did the update directory go? need to clone it first. 93 | else 94 | _pull || { _reset origin/main && _pull; } # I think this should handle when a branch is deleted/main branch changes? 95 | fi 96 | _reset 97 | # check again, doesn't hurt 98 | [ -d "$XDG_DATA_HOME/osuconfig/update" ] || ErrorAndExit "Your osu-winello folder is broken, please reinstall from scratch..." 99 | MainScript "${@:-}" 100 | return $? 101 | } 102 | 103 | # Same as above, but without checking for updates 104 | MainScript() { 105 | declare -a CMD POST_ARGS 106 | POST_ARGS=("${@:-}") 107 | CMD=("bash") 108 | # Check for MainScript(Update) exec to not re-enter the launcher after calling the main script 109 | [[ "${POST_ARGS[0]}" = exec* ]] && CMD=("exec" "bash") && POST_ARGS=("${POST_ARGS[@]:1}") 110 | [ -z "${POST_ARGS[*]}" ] && ErrorAndExit "(internal) Missing arguments?" 111 | 112 | "${CMD[@]}" "$XDG_DATA_HOME/osuconfig/update/osu-winello.sh" "${POST_ARGS[@]}" 113 | return $? # shouldn't reach this if using exec 114 | } 115 | 116 | # Use wine-osu-cachy when enabled in the configuration file 117 | if [ "$WINE_USE_CACHY" == "true" ]; then 118 | MainScript winecachy-setup 119 | export WINE="$XDG_DATA_HOME/osuconfig/yawl-winello-cachy" 120 | export WINE_INSTALL_PATH="$XDG_DATA_HOME/osuconfig/wine-osu-cachy-10.0" 121 | fi 122 | 123 | LaunchOsu() { 124 | declare -a PRE_ARGS POST_ARGS 125 | # only add custom arguments from config if there were none passed to LaunchOsu 126 | if [ -z "${*}" ]; then 127 | # this is sketchy because double spaces won't be handled properly 128 | IFS=" " read -r -a POST_ARGS <<<"${POST_LAUNCH_ARGS}" 129 | else 130 | POST_ARGS=("${@:-}") 131 | fi 132 | IFS=" " read -r -a PRE_ARGS <<<"env ${PRE_LAUNCH_ARGS}" 133 | 134 | Info "Opening: $OSUPATH/osu!.exe ${POST_ARGS[*]}" 135 | if [ -f "${OSUPATH}/launch_with_memory.bat" ]; then 136 | if command -v pgrep &>/dev/null; then 137 | { pgrep 'osu!.exe' &>/dev/null; } || $WINESERVER -k # stop lingering tosu process if any 138 | fi 139 | OSU_EXE=("launch_with_memory.bat") 140 | Info "Click here to open the tosu/gosumemory page: http://localhost:24050 or http://127.0.0.1:24050" 141 | else 142 | OSU_EXE=("osu!.exe") 143 | fi 144 | WINELLO_LOGS_PATH="${XDG_DATA_HOME}/osuconfig/winello.log" 145 | 146 | echo "Using configs: ${configs[*]}" &>"${WINELLO_LOGS_PATH}" 147 | 148 | Info "The run log is located in ${WINELLO_LOGS_PATH}. Attach this file if you make an issue on GitHub or ask for help on Discord." 149 | Info "Launching: ${PRE_ARGS[*]} ${WINE} ${OSU_EXE[*]} ${POST_ARGS[*]}" 150 | 151 | export WINEDEBUG="+timestamp,+pid,+tid,+threadname,+debugstr,+loaddll,+winebrowser,+exec${WINEDEBUG:+,${WINEDEBUG}}" 152 | cd "${OSUPATH}" || { Error "Couldn't change the working directory to your osu! folder... Did you remove it? Try \`osu-wine --changedir\`." && return 1; } 153 | exec "${PRE_ARGS[@]}" "${WINE}" "${OSU_EXE[@]}" "${POST_ARGS[@]}" &>>"${WINELLO_LOGS_PATH}" || return 1 154 | return 0 155 | } 156 | 157 | Info() { 158 | echo -e '\033[1;34m'"Winello:\033[0m $*" 159 | } 160 | 161 | Warning() { 162 | echo -e '\033[0;33m'"Winello:\033[0m $*" 163 | } 164 | 165 | Error() { 166 | echo -e '\033[1;31m'"Winello (error):\033[0m $*" 167 | } 168 | 169 | ErrorAndExit() { 170 | echo -e '\033[1;31m'"Script failed:\033[0m $*" 171 | exit 1 172 | } 173 | 174 | ################################################################################################### 175 | # Begin argument handling 176 | ################################################################################################### 177 | 178 | # default to MainSciptUpdate, allow overriding from config 179 | : "${mainscriptcommand:=MainScriptUpdate}" 180 | 181 | case "$1" in 182 | 'n') 183 | # Don't update the launcher before running a command 184 | # e.g. osu-wine n --fixprefix 185 | mainscriptcommand=MainScript 186 | export NOLAUNCHERUPDATE=1 # let osu-winello.sh know we don't want osu-wine to be updated/overwritten 187 | shift 188 | ;; 189 | esac 190 | 191 | shopt -s extglob 192 | 193 | case "$1" in 194 | '--devserver') 195 | if [ -z "$2" ]; then ErrorAndExit "You need to specify a server, e.g. --devserver akatsuki.gg"; fi 196 | LaunchOsu "-devserver" "${@:2}" 197 | ;; 198 | 199 | ################################################################################################### 200 | 201 | '--wine') 202 | "$WINE" "${@:2}" 203 | ;; 204 | 205 | ################################################################################################### 206 | 207 | '--regedit') 208 | "$WINE" regedit 209 | ;; 210 | 211 | ################################################################################################### 212 | 213 | '--winecfg') 214 | "$WINE" winecfg 215 | ;; 216 | 217 | ################################################################################################### 218 | 219 | '--edit-config') 220 | Info "Opening your configuration files: ${configs[*]}" 221 | command -v "${CUSTOMEDITOR}" >/dev/null 2>&1 && exec "${CUSTOMEDITOR}" "${configs[*]}" 222 | xdg-open "${configs[*]}" || ErrorAndExit "No text editors were able to open your configuration files..." 223 | ;; 224 | 225 | ################################################################################################### 226 | 227 | '--winetricks') 228 | [ ! -x "$XDG_DATA_HOME/osuconfig/winetricks" ] && { $mainscriptcommand "installwinetricks" || ErrorAndExit "Couldn't install winetricks..."; } 229 | "$WINETRICKS" "${@:2}" || ErrorAndExit "Your winetricks command completed with errors..." 230 | ;; 231 | 232 | ################################################################################################### 233 | 234 | '--changedir') 235 | $mainscriptcommand "changedir" || ErrorAndExit "Changing directories failed..." 236 | ;; 237 | 238 | ################################################################################################### 239 | 240 | '--remove') 241 | $mainscriptcommand "uninstall" || ErrorAndExit "You may have to uninstall/remove the folders manually..." 242 | ;; 243 | 244 | ################################################################################################### 245 | 246 | '--kill') 247 | "$WINESERVER" -k 248 | ;; 249 | 250 | ################################################################################################### 251 | 252 | '--kill9') 253 | "$WINESERVER" -k9 254 | ;; 255 | 256 | ################################################################################################### 257 | 258 | '--update') 259 | # It might look pointless to allow "not-updating" if you want to update... but it's better to leave it predictable 260 | $mainscriptcommand "exec" "update" || ErrorAndExit "The update partially or completely failed..." 261 | ;; 262 | 263 | ################################################################################################### 264 | 265 | '--fixfolders') 266 | $mainscriptcommand "fixfolders" || Error "The native file manager integration failed. Will still try to fix osu-handler..." 267 | $mainscriptcommand "fixosuhandler" || ErrorAndExit "The osu-handler setup was unsuccessful..." 268 | ;; 269 | 270 | ################################################################################################### 271 | 272 | *--fix*yawl*) 273 | $mainscriptcommand "fixyawl" || ErrorAndExit "yawl may not have been fixed..." 274 | ;; 275 | 276 | ################################################################################################### 277 | 278 | '--fixrpc') 279 | $mainscriptcommand "discordrpc" || ErrorAndExit "The Discord RPC bridge installation completed with errors..." 280 | ;; 281 | 282 | ################################################################################################### 283 | 284 | '--fixprefix') 285 | $mainscriptcommand "fixprefix" || 286 | ErrorAndExit "The prefix setup completed with issues... It might have worked, though, so try osu!, or --fixprefix again if it didn't work." 287 | $mainscriptcommand "fixosuhandler" || ErrorAndExit "The osu-handler setup was unsuccessful..." 288 | ;; 289 | 290 | ################################################################################################### 291 | 292 | '--tosu') 293 | $mainscriptcommand "tosu" || ErrorAndExit "Couldn't set up tosu..." 294 | ;; 295 | '--gosumemory') 296 | $mainscriptcommand "gosumemory" || ErrorAndExit "Couldn't set up gosumemory..." 297 | ;; 298 | 299 | ################################################################################################### 300 | 301 | '--akatsuki') 302 | MainScript "akatsukiPatcher" || ErrorAndExit "Couldn't launch akatsuki patcher..." 303 | ;; 304 | 305 | ################################################################################################### 306 | 307 | '--mappingtools') 308 | MainScript "mappingTools" || ErrorAndExit "Couldn't launch Mapping Tools..." 309 | ;; 310 | 311 | ################################################################################################### 312 | 313 | *--disable-@(*osu*|memory*)) 314 | rm -f "$OSUPATH/launch_with_memory.bat" 315 | Info "Memory reader (tosu/gosumemory) disabled." 316 | ;; 317 | 318 | ################################################################################################### 319 | 320 | '--osuhandler') 321 | # don't update to avoid unnecessary slowdown 322 | MainScript "exec" "handle" "${@:2}" 323 | ;; 324 | 325 | ################################################################################################### 326 | 327 | '--info') 328 | Info "Need info?: 329 | Wineprefix location: $WINEPREFIX 330 | osu! folder: '$OSUPATH' 331 | 332 | If you need to add more options to osu!, check the Launch function of the script (ex. nano $BINDIR/osu-wine) 333 | You can run 'osu-wine --help' to see all the script's functions (fix prefix, change dir etc.) 334 | You can find more troubleshooting and info at here: https://osu.ppy.sh/community/forums/topics/1248084?n=1 335 | 336 | If you get an error like 'Runtime Platform missing or download incomplete', try running 'osu-wine --fix-yawl'." 337 | ;; 338 | 339 | ################################################################################################### 340 | 341 | *--help*) 342 | Help 343 | ;; 344 | 345 | ################################################################################################### 346 | 347 | *) 348 | # Fall through to osu 349 | LaunchOsu "${@:1}" 350 | ;; 351 | esac 352 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /osu-winello.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ======================================= 4 | # Welcome to Winello! 5 | # The whole script is divided in different 6 | # functions to make it easier to read. 7 | # Feel free to contribute! 8 | # ======================================= 9 | 10 | # Wine-osu current versions for update 11 | MAJOR=10 12 | MINOR=15 13 | PATCH=4 14 | WINEVERSION=$MAJOR.$MINOR-$PATCH 15 | LASTWINEVERSION=0 16 | 17 | # Wine-osu mirror 18 | WINELINK="https://github.com/NelloKudo/WineBuilder/releases/download/wine-osu-staging-${WINEVERSION}/wine-osu-winello-fonts-wow64-${WINEVERSION}-x86_64.tar.xz" 19 | WINECACHYLINK="https://github.com/NelloKudo/WineBuilder/releases/download/wine-osu-cachyos-v10.0-3/wine-osu-cachy-winello-fonts-wow64-10.0-3-x86_64.tar.xz" 20 | 21 | # Other versions for external downloads 22 | DISCRPCBRIDGEVERSION=1.2 23 | GOSUMEMORYVERSION=1.3.9 24 | TOSUVERSION=4.3.1 25 | YAWLVERSION=0.7.1 26 | MAPPINGTOOLSVERSION=1.12.27 27 | 28 | # Other download links 29 | WINETRICKSLINK="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" # Winetricks for --fixprefix 30 | PREFIXLINK="https://github.com/NelloKudo/osu-winello/releases/download/winello-bins/osu-winello-prefix.tar.xz" # Default WINEPREFIX 31 | OSUMIMELINK="https://github.com/NelloKudo/osu-winello/releases/download/winello-bins/osu-mime.tar.gz" # osu-mime (file associations) 32 | YAWLLINK="https://github.com/whrvt/yawl/releases/download/v${YAWLVERSION}/yawl" # yawl (Wine launcher for Steam Runtime) 33 | 34 | OSUDOWNLOADURL="https://m1.ppy.sh/r/osu!install.exe" 35 | 36 | DISCRPCLINK="https://github.com/EnderIce2/rpc-bridge/releases/download/v${DISCRPCBRIDGEVERSION}/bridge.zip" 37 | GOSUMEMORYLINK="https://github.com/l3lackShark/gosumemory/releases/download/${GOSUMEMORYVERSION}/gosumemory_windows_amd64.zip" 38 | TOSULINK="https://github.com/tosuapp/tosu/releases/download/v${TOSUVERSION}/tosu-windows-v${TOSUVERSION}.zip" 39 | AKATSUKILINK="https://air_conditioning.akatsuki.gg/loader" 40 | MAPPINGTOOLSLINK="https://github.com/OliBomby/Mapping_Tools/releases/download/v${MAPPINGTOOLSVERSION}/mapping_tools_installer_x64.exe" 41 | 42 | # The URL for our git repo 43 | WINELLOGIT="https://github.com/NelloKudo/osu-winello.git" 44 | 45 | # The directory osu-winello.sh is in 46 | SCRDIR="$(realpath "$(dirname "$0")")" 47 | # The full path to osu-winello.sh 48 | SCRPATH="$(realpath "$0")" 49 | 50 | # Exported global variables 51 | 52 | export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" 53 | export BINDIR="${BINDIR:-$HOME/.local/bin}" 54 | 55 | OSUPATH="${OSUPATH:-}" # Could either be exported from the osu-wine launcher, from the osuconfig/osupath, or empty at first install (will set up in installOrChangeDir) 56 | 57 | # Don't rely on this! We should get the launcher path from `osu-wine --update`, this is a "hack" to support updating from umu 58 | if [ -z "${LAUNCHERPATH}" ]; then 59 | LAUNCHERPATH="$(realpath /proc/$PPID/exe)" || LAUNCHERPATH="$(readlink /proc/$PPID/exe)" 60 | [[ ! "${LAUNCHERPATH}" =~ .*osu.* ]] && LAUNCHERPATH= 61 | fi 62 | [ -z "${LAUNCHERPATH}" ] && LAUNCHERPATH="$BINDIR/osu-wine" # If we STILL couldn't find it, just use the default directory 63 | 64 | export WINEDLLOVERRIDES="winemenubuilder.exe=;" # Blocks wine from creating .desktop files 65 | export WINEDEBUG="-wineboot,${WINEDEBUG:-}" # Don't show "failed to start winemenubuilder" 66 | 67 | export WINENTSYNC="${WINENTSYNC:-0}" # Don't use these for setup-related stuff to be safe 68 | export WINEFSYNC="${WINEFSYNC:-0}" # (still, don't override launcher settings, because if wineserver is running with different settings, it will fail to start) 69 | export WINEESYNC="${WINEESYNC:-0}" 70 | 71 | # Other shell local variables 72 | WINETRICKS="${WINETRICKS:-"$XDG_DATA_HOME/osuconfig/winetricks"}" 73 | YAWL_INSTALL_PATH="${YAWL_INSTALL_PATH:-"$XDG_DATA_HOME/osuconfig/yawl"}" 74 | export WINE="${WINE:-"${YAWL_INSTALL_PATH}-winello"}" 75 | export WINESERVER="${WINESERVER:-"${WINE}server"}" 76 | export WINEPREFIX="${WINEPREFIX:-"$XDG_DATA_HOME/wineprefixes/osu-wineprefix"}" 77 | export WINE_INSTALL_PATH="${WINE_INSTALL_PATH:-"$XDG_DATA_HOME/osuconfig/wine-osu"}" 78 | 79 | # Make all paths visible to pressure-vessel 80 | [ -z "${PRESSURE_VESSEL_FILESYSTEMS_RW}" ] && { 81 | _mountline="$(df -P "$SCRPATH" 2>/dev/null | tail -1)" && [ -n "${_mountline}" ] && _mainscript_mount="${_mountline##* }:" # mountpoint to main script path 82 | _mountline="$(df -P "$LAUNCHERPATH" 2>/dev/null | tail -1)" && [ -n "${_mountline}" ] && _curdir_mount="${_mountline##* }:" # mountpoint to current directory 83 | _mountline="$(df -P "$XDG_DATA_HOME" 2>/dev/null | tail -1)" && [ -n "${_mountline}" ] && _home_mount="${_mountline##* }:" # mountpoint to XDG_DATA_HOME 84 | PRESSURE_VESSEL_FILESYSTEMS_RW+="${_mainscript_mount:-}${_curdir_mount:-}${_home_mount:-}/mnt:/media:/run/media" 85 | [ -r "$XDG_DATA_HOME/osuconfig/osupath" ] && OSUPATH=$(/dev/null)" # mountpoint to osu/songs directory 87 | export PRESSURE_VESSEL_FILESYSTEMS_RW="${PRESSURE_VESSEL_FILESYSTEMS_RW//\/:/:}" # clean any "just /" mounts, pressure-vessel doesn't like that 88 | } 89 | 90 | export LC_ALL=en_US.UTF-8 91 | export LANG=en_US.UTF-8 92 | 93 | # ===================================== 94 | # ===================================== 95 | # INSTALLER FUNCTIONS 96 | # ===================================== 97 | # ===================================== 98 | 99 | # Simple echo function (but with cool text e.e) 100 | Info() { 101 | echo -e '\033[1;34m'"Winello:\033[0m $*" 102 | } 103 | 104 | Warning() { 105 | echo -e '\033[0;33m'"Winello (WARNING):\033[0m $*" 106 | } 107 | 108 | # Function to quit the install but not revert it in some cases 109 | Quit() { 110 | echo -e '\033[1;31m'"Winello:\033[0m $*" 111 | exit 1 112 | } 113 | 114 | # Function to revert the install in case of any type of fail 115 | Revert() { 116 | echo -e '\033[1;31m'"Reverting install...:\033[0m" 117 | rm -f "$XDG_DATA_HOME/icons/osu-wine.png" 118 | rm -f "$XDG_DATA_HOME/applications/osu-wine.desktop" 119 | rm -f "$BINDIR/osu-wine" 120 | rm -rf "$XDG_DATA_HOME/osuconfig" 121 | rm -f "/tmp/wine-osu-winello-fonts-wow64-$MAJOR.$MINOR-$PATCH-x86_64.tar.xz" 122 | rm -f "/tmp/osu-mime.tar.xz" 123 | rm -rf "/tmp/osu-mime" 124 | rm -f "$XDG_DATA_HOME/mime/packages/osuwinello-file-extensions.xml" 125 | rm -f "$XDG_DATA_HOME/applications/osuwinello-file-extensions-handler.desktop" 126 | rm -f "$XDG_DATA_HOME/applications/osuwinello-url-handler.desktop" 127 | rm -f "/tmp/winestreamproxy-2.0.3-amd64.tar.xz" 128 | rm -rf "/tmp/winestreamproxy" 129 | echo -e '\033[1;31m'"Reverting done, try again with ./osu-winello.sh\033[0m" 130 | exit 1 131 | } 132 | 133 | # Error function pointing at Revert(), but with an appropriate message 134 | InstallError() { 135 | echo -e '\033[1;31m'"Script failed:\033[0m $*" 136 | Revert 137 | } 138 | 139 | # Error function for other features besides install 140 | Error() { 141 | echo -e '\033[1;31m'"Script failed:\033[0m $*" 142 | return 0 # don't exit, handle errors ourselves, propagate result to launcher if needed 143 | } 144 | 145 | # Shorthand for a lot of functions succeeding 146 | okay="eval Info Done! && return 0" 147 | 148 | wgetcommand="wget -q --show-progress" 149 | _wget() { 150 | local url="$1" 151 | local output="$2" 152 | $wgetcommand "$url" -O "$output" && return 0 153 | { [ $? = 2 ] && wgetcommand="wget"; } || wgetcommand="wget --no-check-certificate" 154 | $wgetcommand "$url" -O "$output" && return 0 155 | wgetcommand='' # broken, use curl from now on 156 | return 1 157 | } 158 | 159 | DownloadFile() { 160 | local url="$1" 161 | local output="$2" 162 | Info "Downloading $1 to $2..." 163 | if [ -n "$wgetcommand" ] && command -v wget >/dev/null 2>&1; then 164 | _wget "$url" "$output" && return 0 165 | fi # fall through to curl 166 | if command -v curl >/dev/null 2>&1; then 167 | curl -sSL "$url" -o "$output" && return 0 168 | fi 169 | Error "Failed to download $url. Check your connection." 170 | return 1 171 | } 172 | 173 | # Function looking for basic stuff needed for installation 174 | InitialSetup() { 175 | # Better to not run the script as root, right? 176 | if [ "$USER" = "root" ]; then InstallError "Please run the script without root"; fi 177 | 178 | # Checking for previous versions of osu-wine (mine or DiamondBurned's) 179 | if [ -e /usr/bin/osu-wine ]; then Quit "Please uninstall old osu-wine (/usr/bin/osu-wine) before installing!"; fi 180 | if [ -e "$BINDIR/osu-wine" ]; then Quit "Please uninstall Winello (osu-wine --remove) before installing!"; fi 181 | 182 | Info "Welcome to the script! Follow it to install osu! 8)" 183 | 184 | # Checking if $BINDIR is in PATH: 185 | mkdir -p "$BINDIR" 186 | pathcheck=$(echo "$PATH" | grep -q "$BINDIR" && echo "y") 187 | 188 | # If $BINDIR is not in PATH: 189 | if [ "$pathcheck" != "y" ]; then 190 | 191 | if grep -q "bash" "$SHELL"; then 192 | touch -a "$HOME/.bashrc" 193 | echo "export PATH=$BINDIR:$PATH" >>"$HOME/.bashrc" 194 | fi 195 | 196 | if grep -q "zsh" "$SHELL"; then 197 | touch -a "$HOME/.zshrc" 198 | echo "export PATH=$BINDIR:$PATH" >>"$HOME/.zshrc" 199 | fi 200 | 201 | if grep -q "fish" "$SHELL"; then 202 | mkdir -p "$HOME/.config/fish" && touch -a "$HOME/.config/fish/config.fish" 203 | fish -c fish_add_path "$BINDIR/" 204 | fi 205 | fi 206 | 207 | # Well, we do need internet ig... 208 | Info "Checking for internet connection.." 209 | ! ping -c 2 1.1.1.1 >/dev/null 2>&1 && ! ping -c 2 google.com >/dev/null 2>&1 && InstallError "Please connect to internet before continuing xd. Run the script again" 210 | 211 | # Looking for dependencies.. 212 | deps=(pgrep realpath wget zenity unzip) 213 | for dep in "${deps[@]}"; do 214 | if ! command -v "$dep" >/dev/null 2>&1; then 215 | InstallError "Please install $dep before continuing!" 216 | fi 217 | done 218 | } 219 | 220 | # Helper to wait for wineserver to close before continuing to a next step, reduces the chance of flakiness 221 | # Don't return failure, it's probably harmless, unrelated, or unreliable to use as a success indicator (besides specific cases) 222 | waitWine() { 223 | { 224 | "$WINESERVER" -w 225 | "$WINE" "${@:-"--version"}" 226 | } 227 | return 0 228 | } 229 | 230 | # Function to install script files, yawl and Wine-osu 231 | InstallWine() { 232 | # Installing game launcher and related... 233 | Info "Installing game script:" 234 | cp "${SCRDIR}/osu-wine" "$BINDIR/osu-wine" && chmod +x "$BINDIR/osu-wine" 235 | 236 | Info "Installing icons:" 237 | mkdir -p "$XDG_DATA_HOME/icons" 238 | cp "${SCRDIR}/stuff/osu-wine.png" "$XDG_DATA_HOME/icons/osu-wine.png" && chmod 644 "$XDG_DATA_HOME/icons/osu-wine.png" 239 | 240 | Info "Installing .desktop:" 241 | mkdir -p "$XDG_DATA_HOME/applications" 242 | echo "[Desktop Entry] 243 | Name=osu! 244 | Comment=osu! - Rhythm is just a *click* away! 245 | Type=Application 246 | Exec=$BINDIR/osu-wine %U 247 | Icon=$XDG_DATA_HOME/icons/osu-wine.png 248 | Terminal=false 249 | Categories=Wine;Game;" | tee "$XDG_DATA_HOME/applications/osu-wine.desktop" >/dev/null 250 | chmod +x "$XDG_DATA_HOME/applications/osu-wine.desktop" 251 | 252 | if [ -d "$XDG_DATA_HOME/osuconfig" ]; then 253 | Info "Skipping osuconfig.." 254 | else 255 | mkdir "$XDG_DATA_HOME/osuconfig" 256 | fi 257 | 258 | Info "Installing Wine-osu:" 259 | # Downloading Wine.. 260 | DownloadFile "$WINELINK" "/tmp/wine-osu-winello-fonts-wow64-$MAJOR.$MINOR-$PATCH-x86_64.tar.xz" || InstallError "Couldn't download wine-osu." 261 | 262 | # This will extract Wine-osu and set last version to the one downloaded 263 | tar -xf "/tmp/wine-osu-winello-fonts-wow64-$MAJOR.$MINOR-$PATCH-x86_64.tar.xz" -C "$XDG_DATA_HOME/osuconfig" 264 | LASTWINEVERSION="$WINEVERSION" 265 | rm -f "/tmp/wine-osu-winello-fonts-wow64-$MAJOR.$MINOR-$PATCH-x86_64.tar.xz" 266 | 267 | # Install and verify yawl ASAP, the wrapper mode does not download/install the runtime if no arguments are passed 268 | installYawl || Revert 269 | 270 | # The update function works under this folder: it compares variables from files stored in osuconfig 271 | # with latest values from GitHub and check whether to update or not 272 | Info "Installing script copy for updates.." 273 | mkdir -p "$XDG_DATA_HOME/osuconfig/update" 274 | 275 | { git clone . "$XDG_DATA_HOME/osuconfig/update" || git clone "${WINELLOGIT}" "$XDG_DATA_HOME/osuconfig/update"; } || 276 | InstallError "Git failed, check your connection.." 277 | 278 | git -C "$XDG_DATA_HOME/osuconfig/update" remote set-url origin "${WINELLOGIT}" 279 | 280 | echo "$LASTWINEVERSION" >>"$XDG_DATA_HOME/osuconfig/wineverupdate" 281 | } 282 | 283 | # Function configuring folders to install the game 284 | InitialOsuInstall() { 285 | local installpath=1 286 | Info "Where do you want to install the game?: 287 | 1 - Default path ($XDG_DATA_HOME/osu-wine) 288 | 2 - Custom path" 289 | read -r -p "$(Info "Choose your option: ")" installpath 290 | 291 | case "$installpath" in 292 | '2') 293 | installOrChangeDir || return 1 294 | ;; 295 | *) 296 | Info "Installing to default.. ($XDG_DATA_HOME/osu-wine)" 297 | installOrChangeDir "$XDG_DATA_HOME/osu-wine" || return 1 298 | ;; 299 | esac 300 | $okay 301 | } 302 | 303 | # Here comes the real Winello 8) 304 | # What the script will install, in order, is: 305 | # - osu!mime and osu!handler to properly import skins and maps 306 | # - Wineprefix 307 | # - Regedit keys to integrate native file manager with Wine 308 | # - rpc-bridge for Discord RPC (flatpak users, google "flatpak discord rpc") 309 | FullInstall() { 310 | # Time to install my prepackaged Wineprefix, which works in most cases 311 | # The script is still bundled with osu-wine --fixprefix, which should do the job for me as well 312 | 313 | mkdir -p "$XDG_DATA_HOME/osuconfig/configs" # make the configs directory and copy the example if it doesnt exist 314 | [ ! -r "$XDG_DATA_HOME/osuconfig/configs/example.cfg" ] && cp "${SCRDIR}/stuff/example.cfg" "$XDG_DATA_HOME/osuconfig/configs/example.cfg" 315 | 316 | Info "Configuring Wineprefix:" 317 | 318 | # Variable to check if download finished properly 319 | local failprefix="false" 320 | mkdir -p "$XDG_DATA_HOME/wineprefixes" 321 | if [ -r "$XDG_DATA_HOME/wineprefixes/osu-wineprefix/system.reg" ]; then 322 | Info "Wineprefix already exists; do you want to reinstall it?" 323 | Warning "HIGHLY RECOMMENDED UNLESS YOU KNOW WHAT YOU'RE DOING!" 324 | read -r -p "$(Info "Choose (y/N): ")" prefchoice 325 | if [ "$prefchoice" = 'y' ] || [ "$prefchoice" = 'Y' ]; then 326 | rm -rf "$XDG_DATA_HOME/wineprefixes/osu-wineprefix" 327 | fi 328 | fi 329 | 330 | # So if there's no prefix (or the user wants to reinstall): 331 | if [ ! -r "$XDG_DATA_HOME/wineprefixes/osu-wineprefix/system.reg" ]; then 332 | # Downloading prefix in temporary ~/.winellotmp folder 333 | # to make up for this issue: https://github.com/NelloKudo/osu-winello/issues/36 334 | mkdir -p "$HOME/.winellotmp" 335 | DownloadFile "${PREFIXLINK}" "$HOME/.winellotmp/osu-winello-prefix.tar.xz" || Revert 336 | 337 | # Checking whether to create prefix manually or install it from repos 338 | if [ "$failprefix" = "true" ]; then 339 | reconfigurePrefix nowinepath fresh || Revert 340 | else 341 | tar -xf "$HOME/.winellotmp/osu-winello-prefix.tar.xz" -C "$XDG_DATA_HOME/wineprefixes" 342 | mv "$XDG_DATA_HOME/wineprefixes/osu-prefix" "$XDG_DATA_HOME/wineprefixes/osu-wineprefix" 343 | reconfigurePrefix nowinepath || Revert 344 | fi 345 | # Cleaning.. 346 | rm -rf "$HOME/.winellotmp" 347 | fi 348 | 349 | # Now set up desktop files and such, no matter whether its a new or old prefix 350 | osuHandlerSetup || Revert 351 | 352 | Info "Configure and install osu!" 353 | InitialOsuInstall || Revert 354 | 355 | Info "Installation is completed! Run 'osu-wine' to play osu!" 356 | Warning "If 'osu-wine' doesn't work, just close and relaunch your terminal." 357 | exit 0 358 | } 359 | 360 | # ===================================== 361 | # ===================================== 362 | # POST-INSTALL FUNCTIONS 363 | # ===================================== 364 | # ===================================== 365 | 366 | longPathsFix() { 367 | Info "Applying fix for long song names (e.g. because of deeply nested osu! folder)..." 368 | 369 | rm -rf "$WINEPREFIX/dosdevices" 370 | rm -rf "$WINEPREFIX/drive_c/users/nellokudo" 371 | mkdir -p "$WINEPREFIX/dosdevices" 372 | ln -s "$WINEPREFIX/drive_c/" "$WINEPREFIX/dosdevices/c:" 373 | ln -s / "$WINEPREFIX/dosdevices/z:" 374 | ln -s "$OSUPATH" "$WINEPREFIX/dosdevices/d:" 2>/dev/null # it's fine if this fails on a fresh install 375 | waitWine wineboot -u 376 | return 0 377 | } 378 | 379 | saveOsuWinepath() { 380 | local osupath="${OSUPATH}" 381 | if [ -z "${osupath}" ]; then 382 | { [ -r "$XDG_DATA_HOME/osuconfig/osupath" ] && osupath=$(<"$XDG_DATA_HOME/osuconfig/osupath"); } || { 383 | Error "Can't find the osu! path!" && return 1 384 | } 385 | fi 386 | 387 | Info "Saving a copy of the osu! path..." 388 | 389 | PRESSURE_VESSEL_FILESYSTEMS_RW="$(realpath "$osupath"):$(realpath "$osupath"/Songs 2>/dev/null):${PRESSURE_VESSEL_FILESYSTEMS_RW}" 390 | export PRESSURE_VESSEL_FILESYSTEMS_RW 391 | 392 | local temp_winepath 393 | temp_winepath="$(waitWine winepath -w "$osupath")" 394 | [ -z "${temp_winepath}" ] && Error "Couldn't get the osu! path from winepath... Check $osupath/osu!.exe ?" && return 1 395 | 396 | echo -n "${temp_winepath}" >"$XDG_DATA_HOME/osuconfig/.osu-path-winepath" 397 | echo -n "${temp_winepath}osu!.exe" >"$XDG_DATA_HOME/osuconfig/.osu-exe-winepath" 398 | $okay 399 | } 400 | 401 | deleteFolder() { 402 | local folder="${1}" 403 | Info "Do you want to remove the previous install at ${folder}?" 404 | read -r -p "$(Info "Choose your option (y/N): ")" dirchoice 405 | 406 | if [ "$dirchoice" = 'y' ] || [ "$dirchoice" = 'Y' ]; then 407 | read -r -p "$(Info "Are you sure? This will delete your osu! files! (y/N)")" dirchoice2 408 | if [ "$dirchoice2" = 'y' ] || [ "$dirchoice2" = 'Y' ]; then 409 | rm -rf "${folder}" || { Error "Couldn't remove folder!" && return 1; } 410 | return 0 411 | fi 412 | fi 413 | Info "Skipping.." 414 | return 0 415 | } 416 | 417 | # Handle `osu-wine --changedir` and installation setup 418 | installOrChangeDir() { 419 | local newdir="${1:-}" 420 | local lastdir="${OSUPATH:-}" 421 | if [ -z "${newdir}" ]; then 422 | Info "Please choose your osu! directory:" 423 | newdir="$(zenity --file-selection --directory)" 424 | [ ! -d "$newdir" ] && { Error "No folder selected, please make sure zenity is installed.." && return 1; } 425 | fi 426 | 427 | [ ! -s "$newdir/osu!.exe" ] && newdir="$newdir/osu!" # Make it a subdirectory unless osu!.exe is already there 428 | if [ -s "$newdir/osu!.exe" ] || [ "$newdir" = "$lastdir" ]; then 429 | Info "The osu! installation already exists..." 430 | else 431 | mkdir -p "$newdir" 432 | DownloadFile "${OSUDOWNLOADURL}" "$newdir/osu!.exe" || return 1 433 | 434 | [ -n "${lastdir}" ] && { deleteFolder "$lastdir" || return 1; } 435 | fi 436 | 437 | echo "${newdir}" >"$XDG_DATA_HOME/osuconfig/osupath" # Save it for later 438 | export OSUPATH="${newdir}" 439 | 440 | longPathsFix || return 1 441 | saveOsuWinepath || return 1 442 | Info "osu! installed to '$newdir'!" 443 | return 0 444 | } 445 | 446 | reconfigurePrefix() { 447 | local freshprefix='' 448 | local nowinepath='' 449 | while [[ $# -gt 0 ]]; do 450 | case "${1}" in 451 | 'nowinepath') 452 | nowinepath=1 453 | ;; 454 | 'fresh') 455 | freshprefix=1 456 | ;; 457 | *) ;; 458 | esac 459 | shift 460 | done 461 | 462 | installWinetricks 463 | 464 | [ -n "${freshprefix}" ] && { 465 | Info "Checking for internet connection.." # The bundled prefix install already checks for internet, so no point checking again 466 | ! ping -c 2 1.1.1.1 >/dev/null 2>&1 && { Error "Please connect to internet before continuing xd. Run the script again" && return 1; } 467 | 468 | [ -d "${WINEPREFIX:?}" ] && rm -rf "${WINEPREFIX}" 469 | 470 | Info "Downloading and installing a new prefix with winetricks. This might take a while, so go make a coffee or something." 471 | "$WINESERVER" -k 472 | PATH="${SCRDIR}/stuff:${PATH}" WINEDEBUG="fixme-winediag,${WINEDEBUG:-}" WINENTSYNC=0 WINEESYNC=0 WINEFSYNC=0 \ 473 | "$WINETRICKS" -q nocrashdialog autostart_winedbg=disabled dotnet48 dotnet20 gdiplus_winxp meiryo dxvk win10 || 474 | { Error "winetricks failed catastrophically!" && return 1; } 475 | } 476 | 477 | folderFixSetup || return 1 478 | discordRpc || return 1 479 | 480 | # save the osu winepath with the new folder, unless its a first-time install (need to install osu first) 481 | [ -z "${nowinepath}" ] && { saveOsuWinepath || return 1; } 482 | 483 | $okay 484 | } 485 | 486 | # Remember whether the user wants to overwrite their local files 487 | askConfirmTimeout() { 488 | [ -z "${1:-}" ] && Info "Missing an argument for ${FUNCNAME[0]}!?" && exit 1 489 | 490 | local rememberfile="${XDG_DATA_HOME}/osuconfig/rememberupdatechoice" 491 | touch "${rememberfile}" 492 | 493 | local lastchoice 494 | lastchoice="$(grep "${1}" "${rememberfile}" | grep -Eo '(y|n)' | tail -n 1)" 495 | 496 | if [ -n "$lastchoice" ] && [ "$lastchoice" = "n" ]; then 497 | Info "Won't update ${1}, using saved choice from ${rememberfile}" 498 | Info "Remove this file if you've changed your mind." 499 | return 1 500 | elif [ -n "$lastchoice" ] && [ "$lastchoice" = "y" ]; then 501 | Info "Will update ${1}, using saved choice from ${rememberfile}" 502 | Info "Remove this file if you've changed your mind." 503 | return 0 504 | fi 505 | 506 | local _timeout=${2:-7} # use a 7 second timeout unless manually specified 507 | echo -n "$(Info "Choose: (Y/n) [${_timeout}s] ")" 508 | 509 | read -t "$_timeout" -r prefchoice 510 | 511 | if [[ "$prefchoice" =~ ^(n|N)(o|O)?$ ]]; then 512 | Info "Okay, won't update ${1}, saving this choice to ${rememberfile}." 513 | echo "${1} n" >>"${rememberfile}" 514 | return 1 515 | fi 516 | Info "Will update ${1}, saving this choice to ${rememberfile}." 517 | echo "${1} y" >>"${rememberfile}" 518 | echo "" 519 | return 0 520 | } 521 | 522 | # A helper for updating the osu-wine launcher itself 523 | launcherUpdate() { 524 | local launcher="${1}" 525 | local update_source="$XDG_DATA_HOME/osuconfig/update/osu-wine" 526 | local backup_path="$XDG_DATA_HOME/osuconfig/osu-wine.bak" 527 | 528 | if [ ! -f "$update_source" ]; then 529 | Warning "Update source not found: $update_source" 530 | return 1 531 | fi 532 | 533 | if ! cp -f "$launcher" "$backup_path"; then 534 | Warning "Failed to create backup at $backup_path" 535 | return 1 536 | fi 537 | 538 | if ! cp -f "$update_source" "$launcher"; then 539 | Warning "Failed to apply update to $launcher" 540 | Warning "Attempting to restore from backup..." 541 | 542 | if ! cp -f "$backup_path" "$launcher"; then 543 | Warning "Failed to restore backup - system may be in inconsistent state" 544 | Warning "Manual restoration required from: $backup_path" 545 | return 1 546 | fi 547 | return 1 548 | fi 549 | 550 | if ! chmod --reference="$backup_path" "$launcher" 2>/dev/null; then 551 | chmod +x "$launcher" 2>/dev/null || { 552 | Warning "Failed to set executable permissions on $launcher" 553 | return 1 554 | } 555 | fi 556 | $okay 557 | } 558 | 559 | installYawl() { 560 | Info "Installing yawl..." 561 | DownloadFile "$YAWLLINK" "/tmp/yawl" || return 1 562 | mv "/tmp/yawl" "$XDG_DATA_HOME/osuconfig" 563 | chmod +x "$YAWL_INSTALL_PATH" 564 | 565 | # Also setup yawl here, this will be required anyways when updating from umu-based osu-wine versions 566 | YAWL_VERBS="make_wrapper=winello;exec=$WINE_INSTALL_PATH/bin/wine;wineserver=$WINE_INSTALL_PATH/bin/wineserver" "$YAWL_INSTALL_PATH" 567 | YAWL_VERBS="update;verify;exec=/bin/true" "$YAWL_INSTALL_PATH" || { Error "There was an error setting up yawl!" && return 1; } 568 | $okay 569 | } 570 | 571 | # This function reads files located in $XDG_DATA_HOME/osuconfig 572 | # to see whether a new wine-osu version has been released. 573 | Update() { 574 | local launcher_path="${1:-"${LAUNCHERPATH}"}" 575 | if [ ! -x "$WINE" ]; then 576 | rm -f "${XDG_DATA_HOME}/osuconfig/rememberupdatechoice" 577 | installYawl || Info "Continuing, but things might be broken..." 578 | else 579 | local INSTALLED_YAWL_VERSION 580 | INSTALLED_YAWL_VERSION="$(env "YAWL_VERBS=version" "$WINE" 2>/dev/null)" 581 | if [[ "$INSTALLED_YAWL_VERSION" =~ 0\.5\.* ]]; then 582 | installYawl || Info "Continuing, but things might be broken..." 583 | else 584 | Info "Checking for yawl updates..." 585 | YAWL_VERBS="update" "$WINE" "--version" 586 | fi 587 | fi 588 | 589 | # Reading the last version installed 590 | [ -r "$XDG_DATA_HOME/osuconfig/wineverupdate" ] && LASTWINEVERSION=$("$XDG_DATA_HOME/osuconfig/wineverupdate" 603 | Info "Update is completed!" 604 | waitWine wineboot -u 605 | else 606 | Info "Your Wine-osu is already up-to-date!" 607 | fi 608 | 609 | mkdir -p "$XDG_DATA_HOME/osuconfig/configs" # make the configs directory and copy the example if it doesnt exist 610 | [ ! -r "$XDG_DATA_HOME/osuconfig/configs/example.cfg" ] && cp "${SCRDIR}/stuff/example.cfg" "$XDG_DATA_HOME/osuconfig/configs/example.cfg" 611 | 612 | # Will be required when updating from umu-launcher 613 | [ ! -r "$XDG_DATA_HOME/osuconfig/.osu-path-winepath" ] && { saveOsuWinepath || return 1; } 614 | 615 | [ -n "$NOLAUNCHERUPDATE" ] && Info "Your osu-wine launcher will be left alone." && $okay 616 | 617 | [ ! -x "${launcher_path}" ] && { Error "Can't find the path to the osu-wine launcher to update it. Please reinstall osu-winello." && return 1; } 618 | 619 | if [ ! -w "${launcher_path}" ]; then 620 | Warning "Note: ${launcher_path} is not writable - updating the osu-wine launcher will not be possible" 621 | Warning "Try running the update with appropriate permissions if you want to update the launcher," 622 | Warning " or move it to a place like $BINDIR and then run it from there." 623 | return 0 624 | fi 625 | 626 | Info "Updating the launcher (${launcher_path})..." 627 | if launcherUpdate "${launcher_path}"; then 628 | Info "Launcher update successful!" 629 | Info "Backup saved to: $XDG_DATA_HOME/osuconfig/osu-wine.bak" 630 | else 631 | Error "Launcher update failed" && return 1 632 | fi 633 | $okay 634 | } 635 | 636 | # Well, simple function to install the game (also implement in osu-wine --remove) 637 | Uninstall() { 638 | Info "Uninstalling icons:" 639 | rm -f "$XDG_DATA_HOME/icons/osu-wine.png" 640 | 641 | Info "Uninstalling .desktop:" 642 | rm -f "$XDG_DATA_HOME/applications/osu-wine.desktop" 643 | 644 | Info "Uninstalling game script, utilities & folderfix:" 645 | rm -f "$BINDIR/osu-wine" 646 | rm -f "$BINDIR/folderfixosu" 647 | rm -f "$BINDIR/folderfixosu.vbs" 648 | rm -f "$XDG_DATA_HOME/mime/packages/osuwinello-file-extensions.xml" 649 | rm -f "$XDG_DATA_HOME/applications/osuwinello-file-extensions-handler.desktop" 650 | rm -f "$XDG_DATA_HOME/applications/osuwinello-url-handler.desktop" 651 | 652 | Info "Uninstalling wine-osu:" 653 | rm -rf "$XDG_DATA_HOME/osuconfig/wine-osu" 654 | 655 | Info "Uninstalling yawl and the steam runtime:" 656 | rm -rf "$XDG_DATA_HOME/yawl" 657 | 658 | read -r -p "$(Info "Do you want to uninstall Wineprefix? (y/N)")" wineprch 659 | 660 | if [ "$wineprch" = 'y' ] || [ "$wineprch" = 'Y' ]; then 661 | rm -rf "$XDG_DATA_HOME/wineprefixes/osu-wineprefix" 662 | else 663 | Info "Skipping.." 664 | fi 665 | 666 | read -r -p "$(Info "Do you want to uninstall game files? (y/N)")" choice 667 | 668 | if [ "$choice" = 'y' ] || [ "$choice" = 'Y' ]; then 669 | read -r -p "$(Info "Are you sure? This will delete your files! (y/N)")" choice2 670 | 671 | if [ "$choice2" = 'y' ] || [ "$choice2" = 'Y' ]; then 672 | Info "Uninstalling game:" 673 | if [ -e "$XDG_DATA_HOME/osuconfig/osupath" ]; then 674 | OSUUNINSTALLPATH=$(<"$XDG_DATA_HOME/osuconfig/osupath") 675 | rm -rf "$OSUUNINSTALLPATH" 676 | rm -rf "$XDG_DATA_HOME/osuconfig" 677 | else 678 | rm -rf "$XDG_DATA_HOME/osuconfig" 679 | fi 680 | else 681 | rm -rf "$XDG_DATA_HOME/osuconfig" 682 | Info "Exiting.." 683 | fi 684 | else 685 | rm -rf "$XDG_DATA_HOME/osuconfig" 686 | fi 687 | 688 | Info "Uninstallation completed!" 689 | return 0 690 | } 691 | 692 | SetupReader() { 693 | local READER_NAME="${1}" 694 | Info "Setting up $READER_NAME wrapper..." 695 | # get all the required paths first 696 | local READER_PATH 697 | local OSU_WINEDIR 698 | local OSU_WINEEXE 699 | READER_PATH="$(WINEDEBUG=-all "$WINE" winepath -w "$XDG_DATA_HOME/osuconfig/$READER_NAME/$READER_NAME.exe" 2>/dev/null)" || { Error "Didn't find $READER_NAME in the expected location..." && return 1; } 700 | { [ -r "$XDG_DATA_HOME/osuconfig/.osu-path-winepath" ] && read -r OSU_WINEDIR <<<"$(cat "$XDG_DATA_HOME/osuconfig/.osu-path-winepath")" && 701 | [ -r "$XDG_DATA_HOME/osuconfig/.osu-exe-winepath" ] && read -r OSU_WINEEXE <<<"$(cat "$XDG_DATA_HOME/osuconfig/.osu-exe-winepath")"; } || 702 | { Error "You need to fully install osu-winello before trying to set up $READER_NAME.\n\t(Missing $XDG_DATA_HOME/osuconfig/.osu-path-winepath or .osu-exe-winepath .)" && return 1; } 703 | 704 | # launcher batch file to open tosu/gosumemory together with osu in the container, and tries to stop hung gosumemory/tosu process when osu! exits (why does that happen!?) 705 | cat >"$OSUPATH/launch_with_memory.bat" <nul 714 | if ERRORLEVEL 1 ( 715 | taskkill /F /IM $READER_NAME.exe 716 | taskkill /F /IM ${READER_NAME}_overlay.exe 717 | wineboot -e -f 718 | exit 719 | ) 720 | ping -n 5 127.0.0.1 >nul 721 | goto loop 722 | EOF 723 | 724 | Info "$READER_NAME wrapper enabled. Launch osu! normally to use it!" 725 | return 0 726 | } 727 | 728 | # Simple function that downloads Gosumemory! 729 | Gosumemory() { 730 | if [ ! -d "$XDG_DATA_HOME/osuconfig/gosumemory" ]; then 731 | Info "Downloading gosumemory.." 732 | mkdir -p "$XDG_DATA_HOME/osuconfig/gosumemory" 733 | DownloadFile "${GOSUMEMORYLINK}" "/tmp/gosumemory.zip" || return 1 734 | unzip -d "$XDG_DATA_HOME/osuconfig/gosumemory" -q "/tmp/gosumemory.zip" 735 | rm "/tmp/gosumemory.zip" 736 | fi 737 | SetupReader "gosumemory" || return 1 738 | $okay 739 | } 740 | 741 | tosu() { 742 | if [ ! -d "$XDG_DATA_HOME/osuconfig/tosu" ]; then 743 | Info "Downloading tosu.." 744 | mkdir -p "$XDG_DATA_HOME/osuconfig/tosu" 745 | DownloadFile "${TOSULINK}" "/tmp/tosu.zip" || return 1 746 | unzip -d "$XDG_DATA_HOME/osuconfig/tosu" -q "/tmp/tosu.zip" 747 | rm "/tmp/tosu.zip" 748 | fi 749 | SetupReader "tosu" || return 1 750 | $okay 751 | } 752 | 753 | # Installs Akatsuki patcher (https://akatsuki.gg/patcher) 754 | akatsukiPatcher() { 755 | local AKATSUKI_PATH="$XDG_DATA_HOME/osuconfig/akatsukiPatcher" 756 | 757 | if ! grep -q 'dotnetdesktop6' "$WINEPREFIX/winetricks.log" 2>/dev/null; then 758 | Info "Akatsuki Patcher needs .NET Desktop Runtime 6, installing it with winetricks..." 759 | $WINETRICKS -q -f dotnetdesktop6 760 | fi 761 | 762 | if [ ! -d "$AKATSUKI_PATH" ]; then 763 | Info "Downloading patcher.." 764 | mkdir -p "$AKATSUKI_PATH" 765 | wget --content-disposition -O "$AKATSUKI_PATH/akatsuki_patcher.exe" "$AKATSUKILINK" 766 | fi 767 | 768 | # Setup usual LaunchOsu settings 769 | export WINEDEBUG="+timestamp,+pid,+tid,+threadname,+debugstr,+loaddll,+winebrowser,+exec${WINEDEBUG:+,${WINEDEBUG}}" 770 | WINELLO_LOGS_PATH="${XDG_DATA_HOME}/osuconfig/winello.log" 771 | 772 | Info "Opening $AKATSUKI_PATH/akatsuki_patcher.exe .." 773 | Info "If the patcher fails to find osu!, click on Locate > My Computer > D:, then press open and launch!" 774 | Info "The run log is located in ${WINELLO_LOGS_PATH}. Attach this file if you make an issue on GitHub or ask for help on Discord." 775 | "$WINE" "$AKATSUKI_PATH/akatsuki_patcher.exe" &>>"${WINELLO_LOGS_PATH}" || return 1 776 | return 0 777 | } 778 | 779 | # Installs osu! Mapping Tools (https://github.com/olibomby/mapping_tools) 780 | mappingTools() { 781 | local MAPPINGTOOLSPATH="${WINEPREFIX}/drive_c/Program Files/Mapping Tools" 782 | local OSUPID 783 | 784 | export DOTNET_BUNDLE_EXTRACT_BASE_DIR="C:\\dotnet_tmp" 785 | export DOTNET_ROOT="C:\\Program Files\\dotnet" 786 | [ ! -d "${WINEPREFIX}/drive_c/dotnet_tmp" ] && mkdir -p "${WINEPREFIX}/drive_c/dotnet_tmp" 787 | [ ! -d "${WINEPREFIX}/drive_c/Program Files/dotnet" ] && mkdir -p "${WINEPREFIX}/drive_c/Program Files/dotnet" 788 | 789 | # Disable icu.dll to prevent issues 790 | export WINEDLLOVERRIDES="${WINEDLLOVERRIDES};icu.dll=d" 791 | 792 | if [ ! -d "${MAPPINGTOOLSPATH}" ]; then 793 | if OSUPID="$(pgrep osu!.exe)"; then Quit "Please close osu! before installing mapping tools for the first time."; fi 794 | 795 | "$WINESERVER" -k 796 | 797 | Info "Setting up regedit for Mapping Tools.." 798 | waitWine reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics" /v DisableHWAcceleration /t REG_DWORD /d 1 /f 799 | 800 | Info "Downloading Mapping Tools, please confirm the installer prompts.." 801 | DownloadFile "${MAPPINGTOOLSLINK}" /tmp/mapping_tools_installer_x64.exe 802 | 803 | waitWine /tmp/mapping_tools_installer_x64.exe 804 | rm /tmp/mapping_tools_installer_x64.exe 805 | fi 806 | 807 | if [ -x "$YAWL_INSTALL_PATH" ] && OSUPID="$(pgrep osu!.exe)"; then 808 | Info "Launching Mapping Tools.." 809 | YAWL_VERBS="enter=$OSUPID" "${WINE_INSTALL_PATH}/bin/wine" "$MAPPINGTOOLSPATH/"'Mapping Tools.exe' 810 | else 811 | Quit "Please launch osu! before launching Mapping Tools!" 812 | fi 813 | } 814 | 815 | # Installs rpc-bridge for Discord RPC (https://github.com/EnderIce2/rpc-bridge) 816 | discordRpc() { 817 | Info "Setting up Discord RPC integration..." 818 | if [ -f "${WINEPREFIX}/drive_c/windows/bridge.exe" ]; then 819 | Info "rpc-bridge (Discord RPC) is already installed, do you want to reinstall it?" 820 | askConfirmTimeout "rpc-bridge (Discord RPC)" || return 0 821 | fi 822 | 823 | # try uninstalling the service first 824 | waitWine reg delete 'HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\rpc-bridge' /f &>/dev/null 825 | local chk 826 | 827 | DownloadFile "${DISCRPCLINK}" "/tmp/bridge.zip" || return 1 828 | 829 | mkdir -p /tmp/rpc-bridge 830 | unzip -d /tmp/rpc-bridge -q "/tmp/bridge.zip" 831 | waitWine /tmp/rpc-bridge/bridge.exe --install 832 | rm -f "/tmp/bridge.zip" 833 | rm -rf "/tmp/rpc-bridge" 834 | $okay 835 | } 836 | 837 | folderFixSetup() { 838 | longPathsFix || return 1 839 | # Integrating native file explorer (inspired by) Maot: https://gist.github.com/maotovisk/1bf3a7c9054890f91b9234c3663c03a2 840 | # This only involves regedit keys. 841 | Info "Setting up native file explorer integration..." 842 | 843 | local VBS_PATH="$XDG_DATA_HOME/osuconfig/folderfixosu.vbs" 844 | local FALLBACK_PATH="$XDG_DATA_HOME/osuconfig/folderfixosu" 845 | cp "${SCRDIR}/stuff/folderfixosu.vbs" "${VBS_PATH}" 846 | cp "${SCRDIR}/stuff/folderfixosu" "${FALLBACK_PATH}" 847 | 848 | local VBS_WINPATH 849 | local fallback 850 | VBS_WINPATH="$(WINEDEBUG=-all waitWine winepath.exe -w "${VBS_PATH}" 2>/dev/null)" || fallback="1" 851 | [ -z "$VBS_WINPATH" ] && fallback="1" 852 | 853 | waitWine reg add "HKEY_CLASSES_ROOT\folder\shell\open\command" /f 854 | waitWine reg delete "HKEY_CLASSES_ROOT\folder\shell\open\ddeexec" /f 855 | if [ -z "${fallback:-}" ]; then 856 | waitWine reg add "HKEY_CLASSES_ROOT\folder\shell\open\command" /f /ve /t REG_SZ /d "wscript.exe \"${VBS_WINPATH//\\/\\\\}\" \"%1\"" 857 | else 858 | waitWine reg add "HKEY_CLASSES_ROOT\folder\shell\open\command" /f /ve /t REG_SZ /d "${FALLBACK_PATH} xdg-open \"%1\"" 859 | fi 860 | $okay 861 | } 862 | 863 | osuHandlerSetup() { 864 | Info "Configuring osu-mime and osu-handler..." 865 | 866 | # Installing osu-mime from https://aur.archlinux.org/packages/osu-mime 867 | DownloadFile "${OSUMIMELINK}" "/tmp/osu-mime.tar.gz" || return 1 868 | 869 | tar -xf "/tmp/osu-mime.tar.gz" -C "/tmp" 870 | mkdir -p "$XDG_DATA_HOME/mime/packages" 871 | cp "/tmp/osu-mime/osu-file-extensions.xml" "$XDG_DATA_HOME/mime/packages/osuwinello-file-extensions.xml" 872 | update-mime-database "$XDG_DATA_HOME/mime" 873 | rm -f "/tmp/osu-mime.tar.gz" 874 | rm -rf "/tmp/osu-mime" 875 | 876 | # Installing osu-handler from https://github.com/openglfreak/osu-handler-wine / https://aur.archlinux.org/packages/osu-handler 877 | # Binary was compiled from source on Ubuntu 18.04 878 | chmod +x "$XDG_DATA_HOME/osuconfig/update/stuff/osu-handler-wine" 879 | 880 | # Creating entries for those two 881 | echo "[Desktop Entry] 882 | Type=Application 883 | Name=osu! 884 | MimeType=application/x-osu-skin-archive;application/x-osu-replay;application/x-osu-beatmap-archive; 885 | Exec=$BINDIR/osu-wine --osuhandler %f 886 | NoDisplay=true 887 | StartupNotify=true 888 | Icon=$XDG_DATA_HOME/icons/osu-wine.png" | tee "$XDG_DATA_HOME/applications/osuwinello-file-extensions-handler.desktop" >/dev/null 889 | chmod +x "$XDG_DATA_HOME/applications/osuwinello-file-extensions-handler.desktop" >/dev/null 890 | 891 | echo "[Desktop Entry] 892 | Type=Application 893 | Name=osu! 894 | MimeType=x-scheme-handler/osu; 895 | Exec=$BINDIR/osu-wine --osuhandler %u 896 | NoDisplay=true 897 | StartupNotify=true 898 | Icon=$XDG_DATA_HOME/icons/osu-wine.png" | tee "$XDG_DATA_HOME/applications/osuwinello-url-handler.desktop" >/dev/null 899 | chmod +x "$XDG_DATA_HOME/applications/osuwinello-url-handler.desktop" >/dev/null 900 | update-desktop-database "$XDG_DATA_HOME/applications" 901 | 902 | # Fix to importing maps/skins/osu links after Stable update 20250122.1: https://osu.ppy.sh/home/changelog/stable40/20250122.1 903 | Info "Setting up file (.osz/.osk) and url associations..." 904 | 905 | # Adding the osu-handler.reg file to registry 906 | waitWine regedit /s "$XDG_DATA_HOME/osuconfig/update/stuff/osu-handler.reg" 907 | $okay 908 | } 909 | 910 | # Open files/links with osu-handler-wine 911 | osuHandlerHandle() { 912 | local ARG="${*:-}" OSUPID 913 | local HANDLERRUN=("$XDG_DATA_HOME/osuconfig/update/stuff/osu-handler-wine") 914 | [ ! -x "${HANDLERRUN[0]}" ] && chmod +x "${HANDLERRUN[0]}" 915 | 916 | if [ -x "$YAWL_INSTALL_PATH" ] && OSUPID="$(pgrep osu!.exe)"; then 917 | HANDLERRUN=("env" "YAWL_VERBS=enter=$OSUPID" "$YAWL_INSTALL_PATH" "${HANDLERRUN[0]}") 918 | echo "Trying to open osu-handler-wine in the running container for osu! (PID=$OSUPID)" >&2 919 | else 920 | HANDLERRUN=("env" "${WINE}") # we don't actually need osu-handler if we're starting a new instance 921 | echo "Trying to open a new instance of osu! to handle ${ARG}" >&2 922 | fi 923 | 924 | case "$ARG" in 925 | osu://*) 926 | echo "Trying to load link ($ARG).." >&2 927 | exec "${HANDLERRUN[@]}" 'C:\\windows\\system32\\start.exe' "$ARG" 928 | ;; 929 | *.osr | *.osz | *.osk | *.osz2) 930 | local EXT="${ARG##*.}" FULLARGPATH FILEDIR 931 | FULLARGPATH="$(realpath "${ARG}")" || FULLARGPATH="${ARG}" # || for fallback if realpath failed 932 | 933 | # also, add the containing directory to the PRESSURE_VESSEL_FILESYSTEMS_RW, because it might be in some other location 934 | FILEDIR="$(realpath "$(dirname "${FULLARGPATH}")")" 935 | if [ -n "${FILEDIR}" ] && [ "${FILEDIR}" != "/" ]; then 936 | export PRESSURE_VESSEL_FILESYSTEMS_RW="${PRESSURE_VESSEL_FILESYSTEMS_RW}:${FILEDIR}" 937 | fi 938 | 939 | echo "Trying to load file ($FULLARGPATH).." >&2 940 | exec "${HANDLERRUN[@]}" 'C:\\windows\\system32\\start.exe' "/ProgIDOpen" "osustable.File.$EXT" "$FULLARGPATH" 941 | ;; 942 | esac 943 | # If we reached here, it must means osu-handler failed/none of the cases matched 944 | Error "Unsupported osu! file ($ARG) !" >&2 945 | Error "Try running \"bash $SCRPATH fixosuhandler\" !" >&2 946 | return 1 947 | } 948 | 949 | installWinetricks() { 950 | if [ ! -x "$WINETRICKS" ]; then 951 | Info "Installing winetricks..." 952 | DownloadFile "$WINETRICKSLINK" "/tmp/winetricks" || return 1 953 | mv "/tmp/winetricks" "$XDG_DATA_HOME/osuconfig" 954 | chmod +x "$WINETRICKS" 955 | $okay 956 | fi 957 | return 0 958 | } 959 | 960 | FixUmu() { 961 | if [ ! -f "$BINDIR/osu-wine" ] || [ -z "${LAUNCHERPATH}" ]; then 962 | Error "Looks like you haven't installed osu-winello yet, so you should run ./osu-winello.sh first." && return 1 963 | fi 964 | Info "Looks like you're updating from the umu-launcher based osu-wine, so we'll try to run a full update now..." 965 | Info "Please answer 'yes' when asked to update the 'osu-wine' launcher" 966 | 967 | Update "${LAUNCHERPATH}" || { Error "Updating failed... Please do a fresh install of osu-winello." && return 1; } 968 | $okay 969 | } 970 | 971 | FixYawl() { 972 | if [ ! -f "$BINDIR/osu-wine" ]; then 973 | Error "Looks like you haven't installed osu-winello yet, so you should run ./osu-winello.sh first." && return 1 974 | elif [ ! -f "$YAWL_INSTALL_PATH" ]; then 975 | Error "yawl not found, you should run ./osu-winello.sh first." && return 1 976 | fi 977 | 978 | Info "Fixing yawl..." 979 | YAWL_VERBS="update;verify;exec=/bin/true" "$YAWL_INSTALL_PATH" && chk=$? 980 | YAWL_VERBS="make_wrapper=winello;exec=$WINE_INSTALL_PATH/bin/wine;wineserver=$WINE_INSTALL_PATH/bin/wineserver" "$YAWL_INSTALL_PATH" 981 | if [ "${chk}" != 0 ]; then 982 | Error "That didn't seem to work... try again?" && return 1 983 | else 984 | Info "yawl should be good to go now." 985 | fi 986 | $okay 987 | } 988 | 989 | WineCachySetup() { 990 | # First time setup: yawl-winello-cachy 991 | if [ ! -d "$XDG_DATA_HOME/osuconfig/wine-osu-cachy-10.0" ]; then 992 | DownloadFile "$WINECACHYLINK" "/tmp/winecachy.tar.xz" 993 | tar -xf "/tmp/winecachy.tar.xz" -C "$XDG_DATA_HOME/osuconfig" 994 | rm -f "/tmp/winecachy.tar.xz" 995 | 996 | WINE_INSTALL_PATH="$XDG_DATA_HOME/osuconfig/wine-osu-cachy-10.0" 997 | YAWL_VERBS="make_wrapper=winello-cachy;exec=$WINE_INSTALL_PATH/bin/wine;wineserver=$WINE_INSTALL_PATH/bin/wineserver" "$YAWL_INSTALL_PATH" 998 | fi 999 | } 1000 | 1001 | # Help! 1002 | Help() { 1003 | Info "To install the game, run ./osu-winello.sh 1004 | To uninstall the game, run ./osu-winello.sh uninstall 1005 | To retry installing yawl-related files, run ./osu-winello.sh fixyawl 1006 | You can read more at README.md or https://github.com/NelloKudo/osu-winello" 1007 | } 1008 | 1009 | # ===================================== 1010 | # ===================================== 1011 | # MAIN SCRIPT 1012 | # ===================================== 1013 | # ===================================== 1014 | 1015 | case "$1" in 1016 | '') 1017 | { 1018 | InitialSetup && 1019 | InstallWine && 1020 | FullInstall 1021 | } || exit 1 1022 | ;; 1023 | 1024 | 'uninstall') 1025 | Uninstall || exit 1 1026 | ;; 1027 | 1028 | 'gosumemory') 1029 | Gosumemory || exit 1 1030 | ;; 1031 | 1032 | 'tosu') 1033 | tosu || exit 1 1034 | ;; 1035 | 1036 | 'akatsukiPatcher') 1037 | akatsukiPatcher || exit 1 1038 | ;; 1039 | 1040 | 'mappingTools') 1041 | mappingTools || exit 1 1042 | ;; 1043 | 1044 | 'discordrpc') 1045 | discordRpc || exit 1 1046 | ;; 1047 | 1048 | 'fixfolders') 1049 | folderFixSetup || exit 1 1050 | ;; 1051 | 1052 | 'fixprefix') 1053 | reconfigurePrefix fresh || exit 1 1054 | ;; 1055 | 1056 | 'winecachy-setup') 1057 | WineCachySetup || exit 1 1058 | ;; 1059 | 1060 | # Also catch "fixosuhandler" 1061 | *osu*handler) 1062 | osuHandlerSetup || exit 1 1063 | ;; 1064 | 1065 | 'handle') 1066 | # Should be called by the osu-handler desktop files (or osu-wine for backwards compatibility) 1067 | osuHandlerHandle "${@:2}" || exit 1 1068 | ;; 1069 | 1070 | 'installwinetricks') 1071 | installWinetricks || exit 1 1072 | ;; 1073 | 1074 | 'changedir') 1075 | installOrChangeDir || exit 1 1076 | ;; 1077 | 1078 | update*) 1079 | Update "${2:-}" || exit 1 # second argument is the path to the osu-wine launcher, expected to be called by `osu-wine --update` 1080 | ;; 1081 | 1082 | # "umu" kept for backwards compatibility when updating from umu-launcher based osu-wine 1083 | *umu*) 1084 | FixUmu || exit 1 1085 | ;; 1086 | 1087 | *yawl*) 1088 | FixYawl || exit 1 1089 | ;; 1090 | 1091 | *help* | '-h') 1092 | Help 1093 | ;; 1094 | 1095 | *) 1096 | Info "Unknown argument(s): ${*}" 1097 | Help 1098 | ;; 1099 | esac 1100 | 1101 | # Congrats for reading it all! Have fun playing osu! 1102 | # (and if you wanna improve the script, PRs are always open :3) 1103 | --------------------------------------------------------------------------------