Support Flatpak and Snap Discord; keep the timer when a game changes process
Look for discord-ipc sockets in the Flatpak and Snap runtime folders too. When a game moves to another process (e.g. at Steam launch), keep its first start time and don't resend the activity. Bump version to 0.2.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# discord-game-presence
|
||||
|
||||
Shows the game you're playing in Discord ("Playing Genshin Impact", with the game's icon and a timer) when Discord
|
||||
can't detect it by itself, for example because Discord runs in a firejail sandbox.
|
||||
can't detect it by itself because it runs in a sandbox: Flatpak, Snap or firejail.
|
||||
|
||||
Discord normally detects games by looking at running processes. In a sandbox with its own PID namespace it sees only
|
||||
its own processes, so it never notices a game. discord-game-presence runs outside the sandbox, watches `/proc`, and
|
||||
@@ -26,8 +26,10 @@ Discord then shows it the same way as a game it detected itself.
|
||||
## Requirements
|
||||
|
||||
- `python` (3.11 or newer; standard library only)
|
||||
- Discord's IPC socket (`$XDG_RUNTIME_DIR/discord-ipc-0`) reachable from outside the sandbox. With firejail's
|
||||
`discord` profile, add this to `/etc/firejail/discord.local` (the blacklists keep the keyring private):
|
||||
- Discord's IPC socket reachable from outside the sandbox. Flatpak (`$XDG_RUNTIME_DIR/app/com.discordapp.Discord/`)
|
||||
and Snap (`$XDG_RUNTIME_DIR/snap.discord/`) sockets are found as they are. firejail's `discord` profile hides
|
||||
`$XDG_RUNTIME_DIR/discord-ipc-0`; add this to `/etc/firejail/discord.local` (the blacklists keep the keyring
|
||||
private):
|
||||
|
||||
```
|
||||
ignore include whitelist-runuser-common.inc
|
||||
|
||||
Reference in New Issue
Block a user