feat: add scripts

This commit is contained in:
2023-08-22 01:28:47 +07:00
parent 7fe79a2bdb
commit 92c0e0ee6c
19 changed files with 581 additions and 438 deletions

View File

@ -1,45 +1,64 @@
# Lutris scripts
## `preloader.sh`
Execute multiple scripts in a folder (default is `./preloader`), usually useful for Lutris Pre-launch/Post-exit script
+ Logging is enabled by default, but can be disabled by changing DEBUG to 0 in script source (`DEBUG=0`)
> This script will execute scripts in **current working directory** *(where `preloader.sh` is executed)*, so for example if a script need a file called `nightmare`, and preloader.sh is in `~`, **put the file in `~`** *instead of `~/preloader/`*
- Logging is enabled by default, but can be disabled by changing DEBUG to 0 in script source (`DEBUG=0`)
> This script will execute scripts in **current working directory** _(where `preloader.sh` is executed)_, so for example if a script need a file called `nightmare`, and preloader.sh is in `~`, **put the file in `~`** _instead of `~/preloader/`_
### Installation
+ To download `preloader.sh` itself:
- To download `preloader.sh` itself:
```sh
curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/apps/Lutris/preloader.sh
chmod +x preloader.sh
```
+ After that, copy/move this script to the game prefix you want to use, then in Lutris:
- Set pre-launch script in Lutris to where `preloader.sh` is located.
- Disable **Wait for pre-launch script completion** (optional)
+ **IMPORTANT**: Now, to add pre-launch script, instead of setting them in Lutris, add them to `./preloader` (or the folder you specified).
+ Enjoy :L
- After that, copy/move this script to the game prefix you want to use, then in Lutris:
- Set pre-launch script in Lutris to where `preloader.sh` is located.
- Disable **Wait for pre-launch script completion** (optional)
- **IMPORTANT**: Now, to add pre-launch script, instead of setting them in Lutris, add them to `./preloader` (or the folder you specified).
- Enjoy :L
### Documentation
There are environment variables to control how preloader.sh work:
+ `PRELOADER_PATH=./preloader`: Path to preload scripts.
+ `PRELOADER_DEBUG=0`: Enable debug (1) or disable it (0)
- `PRELOADER_PATH=./preloader`: Path to preload scripts.
- `PRELOADER_DEBUG=0`: Enable debug (1) or disable it (0)
## `discord_rpc.sh`
Launch `winediscordrpcbridge.exe`, to be able to get Discord Rich Presence on Wine applications on the specified prefix.
### Installation
+ To install you must have [`winediscordrpcbridge.exe`](https://github.com/0e4ef622/wine-discord-ipc-bridge/) present, if not you can download latest version by executing
- To install you must have [`winediscordrpcbridge.exe`](https://github.com/0e4ef622/wine-discord-ipc-bridge/) present, if not you can download latest version by executing
```sh
curl -OL https://github.com/0e4ef622/wine-discord-ipc-bridge/releases/latest/download/winediscordipcbridge.exe
```
or use my build (latest commit: `master/9d56418`)
```sh
curl -OL https://github.com/teppyboy/releases/releases/download/git%2B0e4ef622%2Fwine-discord-ipc-bridge%2Bmaster%2F9d56418/winediscordipcbridge.exe
```
+ Then to download `discord_rpc.sh` itself:
- Then to download `discord_rpc.sh` itself:
```sh
curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/apps/Lutris/discord_rpc.sh
chmod +x discord_rpc.sh
```
+ After that, copy/move this script to the game prefix you want to use, then in Lutris:
- Set pre-launch script in Lutris to where `discord_rpc.sh` is located.
- Disable **Wait for pre-launch script completion**
+ Enjoy :L
- After that, copy/move this script to the game prefix you want to use, then in Lutris:
- Set pre-launch script in Lutris to where `discord_rpc.sh` is located.
- Disable **Wait for pre-launch script completion**
- Enjoy :L

View File

@ -4,19 +4,19 @@
### Notes
+ **YOU NEED TO HAVE WS-SCRCPY INSTALLED, ALONG WITH ROOT ACCESS AND DEPENDENCIES**
+ ~~YOU ALSO NEED TO OPEN ADB WIRELESS IN DEVELOPER SETTINGS FOR THIS TO WORK~~ (The script can use `su` to start ADB wireless now)
+ You need to grant Termux:API full Location permission and set to "Always" (Foreground mode will not work correctly)
+ Rootless mode is available, although it **will not** work in most cases.
+ Dependencies: `root-repo` `tsu` `moreutils` `build-essential` `nodejs` `python3` `android-tools` `git` `termux-api`
- **YOU NEED TO HAVE WS-SCRCPY INSTALLED, ALONG WITH ROOT ACCESS AND DEPENDENCIES**
- ~~YOU ALSO NEED TO OPEN ADB WIRELESS IN DEVELOPER SETTINGS FOR THIS TO WORK~~ (The script can use `su` to start ADB wireless now)
- You need to grant Termux:API full Location permission and set to "Always" (Foreground mode will not work correctly)
- Rootless mode is available, although it **will not** work in most cases.
- Dependencies: `root-repo` `tsu` `moreutils` `build-essential` `nodejs` `python3` `android-tools` `git` `termux-api`
> Or execute `pkg install root-repo tsu moreutils build-essential nodejs python3 android-tools git termux-api`
+ You also need to downgrade npm to version 6 to fix Termux problem: `npm install -g npm@6`
- You also need to downgrade npm to version 6 to fix Termux problem: `npm install -g npm@6`
> Please ignore the vulnerability message, if you care about it then please don't use this script.
+ Download ws-scrcpy-launcher.py:
- Download ws-scrcpy-launcher.py:
```bash
curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/Apps/ws-scrcpy/ws-scrcpy-launcher.py
@ -25,7 +25,7 @@ chmod +x ws-scrcpy-launcher.py
> Execute `./ws-scrcpy-launcher.py` to launch ws-scrcpy with scrcpy server for local device.
+ Full script for lazy people (including install ws-scrcpy steps):
- Full script for lazy people (including install ws-scrcpy steps):
```bash
pkg update
@ -41,6 +41,6 @@ curl -OL https://gitlab.com/tretrauit/scripts/-/raw/main/Apps/ws-scrcpy/ws-scrcp
chmod +x ws-scrcpy-launcher.py
```
+ The script will tell you to wait for ws-scrcpy to start, and when it starts it'll show the started message with the ip address and the port to access using browsers
- The script will tell you to wait for ws-scrcpy to start, and when it starts it'll show the started message with the ip address and the port to access using browsers
> You need to use `adb pair` to pair termux with your device adb server, then you can launch ws-scrcpy as explained above.