mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 23:57:22 +02:00
Add "gamemoderun", a wrapper bash script like "primusrun"
This should remove a point of failure currently where users fail to set LD_PRELOAD correctly, or the path is wrong somehow. FWIW: The old method still works, and I've noted that in the README.
This commit is contained in:
parent
89263ba6fd
commit
74e26d6f63
@ -60,14 +60,18 @@ ninja uninstall
|
|||||||
|
|
||||||
After installing `libgamemodeauto.so.0` simply preload it into the game:
|
After installing `libgamemodeauto.so.0` simply preload it into the game:
|
||||||
```bash
|
```bash
|
||||||
LD_PRELOAD=/usr/\$LIB/libgamemodeauto.so.0 ./game
|
gamemoderun ./game
|
||||||
```
|
```
|
||||||
Or edit the steam launch options:
|
Or edit the steam launch options:
|
||||||
```bash
|
```bash
|
||||||
LD_PRELOAD=$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so.0 %command%
|
gamemoderun %command%
|
||||||
```
|
```
|
||||||
Please note the backslash here in `\$LIB` is required.
|
Please note the backslash here in `\$LIB` is required.
|
||||||
|
|
||||||
|
Note: for older versions of GameMode (1.2) use this string in place of `gamemoderun`:
|
||||||
|
```
|
||||||
|
LD_PRELOAD="$LD_PRELOAD:/usr/\$LIB/libgamemodeauto.so.0"
|
||||||
|
```
|
||||||
---
|
---
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -38,13 +38,19 @@ Print the version
|
|||||||
\fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so:
|
\fBlibgamemodeauto.so.0\fR can be pre-loaded into any program to request \fBgamemoded\fR begin or end the mode, like so:
|
||||||
|
|
||||||
.RS 4
|
.RS 4
|
||||||
LD_PRELOAD=/usr/\e$LIB/libgamemodeauto.so.0 \./game
|
gamemoderun \./game
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
Or by setting the steam launch options for a game:
|
Or by setting the steam launch options for a game:
|
||||||
|
|
||||||
.RS 4
|
.RS 4
|
||||||
LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 %command%
|
gamemoderun %command%
|
||||||
|
.RE
|
||||||
|
|
||||||
|
The library can be manually preloaded if needed:
|
||||||
|
|
||||||
|
.RS 4
|
||||||
|
LD_PRELOAD=$LD_PRELOAD:/usr/\e$LIB/libgamemodeauto.so.0 ./game
|
||||||
.RE
|
.RE
|
||||||
|
|
||||||
The \fBgamemode_client.h\fR header can be used by developers to build the requests into a program:
|
The \fBgamemode_client.h\fR header can be used by developers to build the requests into a program:
|
||||||
|
11
data/gamemoderun.in
Normal file
11
data/gamemoderun.in
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Helper script to launch games with gamemode
|
||||||
|
|
||||||
|
# Path to install gamemoded auto script
|
||||||
|
CONFIG_LIB_DIR="@GAMEMODE_LIB_DIR@/libgamemodeauto.so.0"
|
||||||
|
|
||||||
|
# Set the ld library path prefixed libgamemodeauto
|
||||||
|
export LD_LIBRARY_PATH=${CONFIG_LIB_DIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
||||||
|
|
||||||
|
# Launch
|
||||||
|
exec "$@"
|
@ -1,6 +1,7 @@
|
|||||||
data_conf = configuration_data()
|
data_conf = configuration_data()
|
||||||
data_conf.set('BINDIR', path_bindir)
|
data_conf.set('BINDIR', path_bindir)
|
||||||
data_conf.set('LIBEXECDIR', path_libexecdir)
|
data_conf.set('LIBEXECDIR', path_libexecdir)
|
||||||
|
data_conf.set('GAMEMODE_LIB_DIR', path_libdir)
|
||||||
|
|
||||||
if with_systemd == true
|
if with_systemd == true
|
||||||
# Install systemd user unit
|
# Install systemd user unit
|
||||||
@ -29,5 +30,14 @@ configure_file(
|
|||||||
install_dir: path_polkit_action_dir,
|
install_dir: path_polkit_action_dir,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Install the helper run script
|
||||||
|
configure_file(
|
||||||
|
input: 'gamemoderun.in',
|
||||||
|
output: 'gamemoderun',
|
||||||
|
configuration: data_conf,
|
||||||
|
install_dir: 'bin',
|
||||||
|
install_mode: 'rwxr-xr-x',
|
||||||
|
)
|
||||||
|
|
||||||
# Install the man page
|
# Install the man page
|
||||||
install_man('gamemoded.8')
|
install_man('gamemoded.8')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user