GithubHelp home page GithubHelp logo

justtemmie / steam-presence Goto Github PK

View Code? Open in Web Editor NEW
219.0 5.0 15.0 978 KB

A script that takes the game you're playing on steam and displays it on discord

License: MIT License

Python 91.20% Shell 8.80%
discord discord-rich-presence linux python rich-presence steam steam-deck steamdeck games syncronization

steam-presence's Introduction

Hi ๐Ÿ‘‹

I tend to go by Twig or Temmie - I'm a norwegian highschool student, and a developer in my free time. I create games, discord bots, websites, and other nifty scripts; i have a tendency to play bad apple on anything i can get my hands on, ranging from minecraft to a lego EV microcontroller

I have a secondary github page for anything i don't want to clutter my main profile with, you might find something nifty on it!

๐Ÿ“Š GitHub Stats

steam-presence's People

Contributors

ahmed-kaid avatar akkornel avatar alba4k avatar ash2x3zb9cy avatar confuzled avatar justtemmie avatar miermontoto avatar noplagiarism avatar patrickszela avatar radiicall avatar spaceykasey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

steam-presence's Issues

Installation & Slight problem

Am I suppose to install on both my steam deck and my PC windows? Because I currently have it on the steam deck and whenever I try to load the /bin/python and /main.py it says "everything is ready" except it denies my steam API although its correct.

Index Out Of Range

Latest Version 1.10.2 breaks with a list index out of range error when playing non steam games

IMG_6908

Additional Rich Presence data from games doesn't work

I did a normal install and followed all steps correctly, but it doesn't seem to show additional data from games that support it. I tested on ULTRAKILL and Bloons TD6, both of which behaved like other games and not like in screenshots. Code is unmodified (aside from a simple string change I did but that shouldn't affect anything) and the config looks totally fine.

my_config.json

Adding custom games

In the old version (which was great, it's the only thing of it's kind that worked for me!), I didn't manage to get this working.

immagine

In the new version (which is even greater! thanks a lot for your work!) I'm even more confused on how the CUSTOM_GAME_OVERWRITE section is supposed to work. I'm not sure if I understood that correctly, how am I supposed to get a custom "game" (code-oss) or any process at all to show up with a name-icon pair (VSCode and ideally the image found here)?

Again, thanks A LOT for your efforts on this process!

Also, I would suggest recreating an install.sh script that installs the systemd service, since that would make everything much easier and automatically set the correct file paths. I can write this if you'd like it :)

No longer detects non steam games

Apon running any non steam game the presense manager will not detect its use, even if it is ran through steam, and appears on the steam user profile.

Author's name coverImageText?

Im little confused, what library are you using to get author's name to put it on the cover image text? I wanted to change it to game's name but can't find the source. Thanks

Suddenly stopped working

It worked just fine for a while, but now when I check the status with systemctl I get this error:


maj 21 15:16:33 HomeOfHatsuneMiku python[1203]:     import requests
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]: ModuleNotFoundError: No module named 'requests'
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]: During handling of the above exception, another exception occurred:
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]: Traceback (most recent call last):
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]:   File "/home/saki/steam-presence/main.py", line 38, in <module>
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]:     answer = input("looks like either requests, pypresence, steamgrid, psutil, or beautifulSoup is not installed, do you want to install them? (y/n) ")
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
maj 21 15:16:33 HomeOfHatsuneMiku python[1203]: EOFError: EOF when reading a line
maj 21 15:16:33 HomeOfHatsuneMiku systemd[1187]: steam-presence.service: Main process exited, code=exited, status=1/FAILURE
maj 21 15:16:33 HomeOfHatsuneMiku systemd[1187]: steam-presence.service: Failed with result 'exit-code'.

Requests is installed and importing it with the terminal works, so I have no idea why this could be happening. When I run main.py to install it, it tries to use pip which I can't use because it's an externally managed environment (so I have to use pacman). Any idea what could be happening here?

potential improvement to enhanced rich presence

,, I have zero clue how technically inclined this small thing may be but on the offhand that it is quite simple, would it be possible to pull Discord's default assets for the enhanced rich presence of select games like ULTRAKILL? it came to mind after reading how you could pull the default icon that Discord used for every game (on main branch). below is the first image which displays steam-presence, the second is native rich presence (albeit a stitched together image) but it shows the blue colored ULTRAKILL level preview icon (which I assume could be pulled from Discord but I have zero clue)
image
image

Discord shows up the normal RPC, but doesn't shows up the steam-presence RPC

This is a question and also a problem i'm having with the script, i run the script but... im not sure what it's supposed to do next...
I have a config.json already set up with my steam id, user id, everything but... Is not showing up in my profile?

I have made sure that the script is running, changed the configs as i needed but nothing is working.

Icons.txt error

Your code references path to /icons.txt but the file itself is in data/icons.txt. The scripts throws an error because of it.

Unsupported os (opensuse tumbleweed)

when running the installer.sh it will spit out that opensuse isnt supported even tho its linux
no other errors appear

This script is for Linux and macOS, and it's still in testing phases. If you encounter any bugs, please open an issue.
Press the enter key to continue...

Setting up virtual environment
mkdir: cannot create directory โ€˜venvโ€™: File exists
Requirement already satisfied: pip in ./lib64/python3.11/site-packages (23.3.1)
Requirement already satisfied: wheel in ./lib64/python3.11/site-packages (0.42.0)
Requirement already satisfied: python-steamgriddb in ./lib64/python3.11/site-packages (from -r ../requirements.txt (line 1)) (1.0.5)
Requirement already satisfied: pypresence in ./lib64/python3.11/site-packages (from -r ../requirements.txt (line 2)) (4.3.0)
Requirement already satisfied: beautifulsoup4 in ./lib64/python3.11/site-packages (from -r ../requirements.txt (line 3)) (4.12.2)
Requirement already satisfied: requests in ./lib64/python3.11/site-packages (from -r ../requirements.txt (line 4)) (2.31.0)
Requirement already satisfied: psutil in ./lib64/python3.11/site-packages (from -r ../requirements.txt (line 5)) (5.9.6)
Requirement already satisfied: soupsieve>1.2 in ./lib64/python3.11/site-packages (from beautifulsoup4->-r ../requirements.txt (line 3)) (2.5)
Requirement already satisfied: charset-normalizer<4,>=2 in ./lib64/python3.11/site-packages (from requests->-r ../requirements.txt (line 4)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in ./lib64/python3.11/site-packages (from requests->-r ../requirements.txt (line 4)) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./lib64/python3.11/site-packages (from requests->-r ../requirements.txt (line 4)) (2.1.0)
Requirement already satisfied: certifi>=2017.4.17 in ./lib64/python3.11/site-packages (from requests->-r ../requirements.txt (line 4)) (2023.11.17)

Testing if the script works


[Dec 02 2023 - 22:52:41] progam's current folder structure version is up to date...

[Dec 02 2023 - 22:52:41] loading config file
[Dec 02 2023 - 22:52:41] everything is ready!

[Dec 02 2023 - 22:52:42] found game NARAKA: BLADEPOINT played by Pollux
Test might've worked, did it spit out any errors?
Commands executed.
Unsupported OS. This script is designed for Linux and macOS only.

Add support for multiple accounts

Hey, this would be a really useful feature for me as I have multiple Steam accounts and I sometimes switch between them.

The endpoint http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/ mentions support for this:

steamids
    A comma-separated list of 64 bit IDs to retrieve profiles for.

Rich Prescence updates very slowly

I don't know if this is a bug, or just something to do with the way steam-presence interacts with the Steam API, but I've been seeing very slow updates for the Steam Rich Presence feature.

Here's a screenshot from the console, I am using Windows 11, with Python 3.12.3 installed.
It takes about 30 mins for it to realize I'm in the menus, even though I was in the menu long before.
image

Am wondering if there is a way to manually update the time it takes to update the presence.

Running without Discord client

Is the Discord client running side by side with steam-presence a hard requirement?

You mentioned we can run steam-presence on a server (which I intended to do with Docker), but that would mean having a GUI running with Discord.

Can you please clarify how would such a setup be viable?
Are there tools that can send RPC data to Discord's servers other than the official client?

Errors while running "installer.sh" on Linux Mint 21.2 Xfce

After i run the installer file in the terminal i get these errors when testing if the script works

ERROR: [Sep 29 2023 - 16:37:11] error encountered whilst trying to update the config-version to version 1, exiting
Error encountered: [Errno 2] No such file or directory: '/home/alex_rainbowman/steam-presence/icons.txt'
/home/alex_rainbowman/steam-presence/installer.sh: line 48: kill: (10908) - No such process
Test might've worked, did it spit out any errors?
Commands executed.
Setting up service file for Linux
sed: can't read /home/alex_rainbowman/steam-presence.service: No such file or directory
Starting service
Failed to enable unit: Unit file /home/alex_rainbowman/.config/systemd/user/steam-presence.service is masked.

Any idea what is happening? (I'm kinda new to Linux)

Potential Improvements

Hi, I really like this service you put together. I was initially tempted to fork it and make my own modifications for my own needs, but wanted to check if you were interested in me adding the following features:

  • Make the systemd service listen for new processes rather than polling every cycle. While this might not seem as much of a big deal with computers these days, I'd rather want programs to only execute when they are needed. I was thinking of adding something like pyinotification, or even linux's inotification to watch for new processes spawned under /proc
  • rather than scrape everything online, some information can be obtained from a processes env if its a steam game. The app id for example can be obtained from it. If you are already listening for processes spawning, you can check to see what environment variables the process has set, grab the steam id, and whatever else.
  • build up a cache of previously launched games, why go up online every single time? though the argument could be made against caching if you're running low on storage. Could be something that is configurable.
  • Make a GUI for the configuration file, maybe with Qt, and bundle it with flatpak?

Each of these bullet points could be a separate PR to this repo

Errors running main.py and installer.sh

When I try to run main.py, it says:
Forbidden, Access to the steam API has been denied, please verify your steam API key

I tried resetting my API key a couple times, and I tried using the domains localhost and 127.0.0.1.

I am not sure what to make of this error, as I have used my API key in the past for Steam Idler, and it worked successfully.

As for installer.sh, when I try to run it, it says:
Error: config.json file not found. Please make sure it exists in the current directory

This is simply not the case, because I set up the config.json file in the directory in my Home/steam-presence directory.
I was not sure if this was because I have VSCodium open, but closing Codium still yields the same results.

Thank you in advance for any support you can provide!

[Feature request]

NON_STEAM_GAMES
I actually used this feature, and the cookies expiring wasn't a problem - I could always fire up Firefox again and quickly re-export them.

Delay in the webpage steam miniprofile

userID type 3. = - 76561197960265728

    URL = f"https://steamcommunity.com/miniprofile/{int(i) - 76561197960265728}"

Now there will be a delay in the URL of this user's Steam community profile page. There will be a delay of about 5 minutes. The user's rich Presence can no longer be updated in real time.
However, I found through testing that the user status obtained using the Steam Web API is still updated in real time, but only part of the rich status information is displayed. For example, in cs2, the map and score data provided by this API will not be updated. You just can know if the user is in the game.so this API has no effect.
In addition, I also found that only the rich status data of the steam profile page on the web side is delayed. The rich status data in the steam client friend panel are all real-time, but it seems very useless if you can only see the rich status of your friends. Of course, in order to obtain the personal rich status of any user we specify.
So I would like to ask the author, is there any way to solve the problem of the delay of the url miniprofile page on the web page?

RPC randomly disappears, not sure why?

This video should sum things up quite well. No errors locally at all. Tried rebooting and reinstalling steam-presence. I am using the latest Discord from the AUR. I have sanity checked my json file multiple times, and it's accurate.

Changing the RP title to the game name

I've noticed that with some games the title of the rich presence is the actual name of the game I'm playing, and for others it just says 'a game on steam' and shows the name in the description. Is there a way to set the title to always be the game name?

image

image

(also i just wanted to thank you for making this, my games not appearing properly has been unreasonably bugging me for quite a while now)

Permission Denied on RPC.connect() trying to update Rich Presence

On Ubuntu 24.04 running Discord in a flatpak, using a symlink as documented here: https://github.com/flathub/com.discordapp.Discord/wiki/Rich-Precense-(discord-rpc) and running Steam (unsandboxed), I'm getting this error when steam-presence is trying to update Rich Presence:

Jun 12 12:51:51 midgaard.home.ld python[407813]: [Jun 12 2024 - 12:51:51] creating new rich presence object for LEGOยฎ 2K Drive
Jun 12 12:51:51 midgaard.home.ld python[407813]: Traceback (most recent call last):
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/home/psi-jack/.local/bin/steam-presence/main.py", line 1201, in
Jun 12 12:51:51 midgaard.home.ld python[407813]: main()
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/home/psi-jack/.local/bin/steam-presence/main.py", line 1182, in main
Jun 12 12:51:51 midgaard.home.ld python[407813]: RPC.connect()
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/home/psi-jack/.local/bin/steam-presence/venv/lib/python3.12/site-packages/pypresence/presence.py", line 43, in connect
Jun 12 12:51:51 midgaard.home.ld python[407813]: self.loop.run_until_complete(self.handshake())
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
Jun 12 12:51:51 midgaard.home.ld python[407813]: return future.result()
Jun 12 12:51:51 midgaard.home.ld python[407813]: ^^^^^^^^^^^^^^^
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/home/psi-jack/.local/bin/steam-presence/venv/lib/python3.12/site-packages/pypresence/baseclient.py", line 112, in handshake
Jun 12 12:51:51 midgaard.home.ld python[407813]: self.sock_reader, self.sock_writer = await asyncio.wait_for(asyncio.open_unix_connection(ipc_path), self.connection_timeout)
Jun 12 12:51:51 midgaard.home.ld python[407813]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/usr/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
Jun 12 12:51:51 midgaard.home.ld python[407813]: return await fut
Jun 12 12:51:51 midgaard.home.ld python[407813]: ^^^^^^^^^
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/usr/lib/python3.12/asyncio/streams.py", line 97, in open_unix_connection
Jun 12 12:51:51 midgaard.home.ld python[407813]: transport, _ = await loop.create_unix_connection(
Jun 12 12:51:51 midgaard.home.ld python[407813]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/usr/lib/python3.12/asyncio/unix_events.py", line 261, in create_unix_connection
Jun 12 12:51:51 midgaard.home.ld python[407813]: await self.sock_connect(sock, path)
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/usr/lib/python3.12/asyncio/selector_events.py", line 651, in sock_connect
Jun 12 12:51:51 midgaard.home.ld python[407813]: return await fut
Jun 12 12:51:51 midgaard.home.ld python[407813]: ^^^^^^^^^
Jun 12 12:51:51 midgaard.home.ld python[407813]: File "/usr/lib/python3.12/asyncio/selector_events.py", line 659, in _sock_connect
Jun 12 12:51:51 midgaard.home.ld python[407813]: sock.connect(address)
Jun 12 12:51:51 midgaard.home.ld python[407813]: PermissionError: [Errno 13] Permission denied
Jun 12 12:51:51 midgaard.home.ld systemd[2572]: steam-presence.service: Main process exited, code=exited, status=1/FAILURE
Jun 12 12:51:51 midgaard.home.ld systemd[2572]: steam-presence.service: Failed with result 'exit-code'.

No module named 'pypresence'

Traceback (most recent call last):
File "/home/xxxtrashcion/steam-presence/./main.py", line 23, in
from pypresence import Presence
ModuleNotFoundError: No module named 'pypresence'

Running the 'main.py' from the same folder as the 'installer.sh.' What am I doing wrong? Doesn't seem like it's running at startup on my arch setup.

To specific python version in installer.sh

Hey,

in the file installer.sh I had problems, because in line 65 the command is python3.10 -m venv .
This created errors on my machine as I have Python 3.11.3 installe, so python3.10 isn't working.

Changing the line to python3 -m venv . solved the problem and should be future proof (as long as 3 is the main version).

Enhanced Rich Presence not working

Hi, thank you so much for your work on this, it's really cool.

I am not sure if this is an issue with the code, my Steam/Discord or something unique to Paradox games where the rich presence can vary wildly, but it's not showing up for me. I can supply you with more detailed info, but this is what it looks like:
image
image

I did read your issue from March where you were trying to figure this out. I assume that maybe Paradox games, with their many countries and variables such as the year the game is at, might not work the same way. However, something like Baldur's Gate 3, which only has about 4-5 different presence descriptions, also doesn't work. The review and store button do work though (cool features too).

This is what my config file looks like, with the personal stuff removed:

  {
      "STEAM_API_KEY": "key",
      "USER_IDS": "id",
  
      "DISCORD_APPLICATION_ID": "id",
  
      "FETCH_STEAM_RICH_PRESENCE": true,
      "FETCH_STEAM_REVIEWS": false,
      "ADD_STEAM_STORE_BUTTON": false,
  
      "WEB_SCRAPE": false,
      
      "COVER_ART": {
          "STEAM_GRID_DB": {
              "ENABLED": true,
              "STEAM_GRID_API_KEY": "key"
          },
          "USE_STEAM_STORE_FALLBACK": true
      },
  
      "LOCAL_GAMES": {
          "ENABLED": false,
          "LOCAL_DISCORD_APPLICATION_ID": "",
          "GAMES": [
              "processName1",
              "processName2",
              "processName3",
              "so on"
          ]
      },
  
      "GAME_OVERWRITE": {
          "ENABLED": false,
          "NAME": "Breath of the wild, now on Steam!",
          "SECONDS_SINCE_START": 0
      },
  
      "CUSTOM_ICON": {
          "ENABLED": false,
          "URL": "https://raw.githubusercontent.com/JustTemmie/steam-presence/main/readmeimages/defaulticon.png",
          "TEXT": "Steam Presence on Discord"
      }
  }

And here is the log:

[Nov 22 2023 - 21:20:51] found game Stellaris played by -
[Nov 22 2023 - 21:20:52] steam app ID 281990 found for Stellaris
[Nov 22 2023 - 21:20:52] game changed, updating to 'Stellaris'
[Nov 22 2023 - 21:20:52] fetching the Discord game ID for Stellaris
[Nov 22 2023 - 21:20:53] found the discord game ID for stellaris
[Nov 22 2023 - 21:20:53] fetching icon for Stellaris
[Nov 22 2023 - 21:20:53] found icon for Stellaris in cache
[Nov 22 2023 - 21:20:53] creating new rich presence object for Stellaris
[Nov 22 2023 - 21:20:53] pushing presence to Discord

I noticed that it doesn't log the
log(f"setting the details for {gameName} to {gameRichPresence}")
under the setPresenceDetails() function so I'm assuming it satisfying the if check there for some reason?

I can confirm that neither Discord nor Steam are running as admin. I'm not sure if anything obvious is wrong but I will keep trying. Otherwise, would love your help on this. Once again, thanks for the cool script! Awesome work. Sorry if there is an obvious answer or solution to this somewhere and I missed it.

Discord needs to run in the background (?)

In the README it says:

in addition to this, there's the Steam Deck, a handheld linux game "console".

having discord constantly run in the background is a terrible idea considering how that's gonna lose you at least half an hour of battery life, in addition to the previous issues with linux.

Which is a valid point, but Discord still needs to run in the background if I understand it correctly, or at least when I launch the project on Deck it says that it needs to.

Am I missing something?

Script Error Upon running /installer.sh

Trying to get this to work on my arch linux system. Any idea?

Testing if the script works


[Aug 23 2023 - 09:51:25] progam's current folder structure version is up to date...

[Aug 23 2023 - 09:51:25] loading config file
Traceback (most recent call last):
File "/home/phantom/steam-presence/./main.py", line 1058, in
main()
File "/home/phantom/steam-presence/./main.py", line 869, in main
config = getConfigFile()
^^^^^^^^^^^^^^^
File "/home/phantom/steam-presence/./main.py", line 138, in getConfigFile
userSettings = json.load(f)
^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ':' delimiter: line 5 column 6 (char 141)

Here is my config file:
image

Unable to launch main.py

When I try to launch Main.py through the terminal (Python3 main.py), I get the following error.
Traceback (most recent call last):
File "/home/kiki/steam-presence/main.py", line 1147, in
main()
File "/home/kiki/steam-presence/main.py", line 920, in main
checkForUpdate()
File "/home/kiki/steam-presence/main.py", line 902, in checkForUpdate
if int(new) > int(old):
^^^^^^^^

I have tried to delete and git clone the folder to maybe fix it, but it ended not working
Screenshot_20240103_224047

Detecting the "enhanced rich presence" information of steam games

Certain games on steam support "enhanced rich presence" I.E the same thing discord rich presence does, but thru steam
example:
image
steam's own documentation:
enhanced rich presence

It would be great to be able to detect this as it could be directly forwarded into the discord rich presence, but...

I've spent an unbelievable amount of time trying to find a way to fetch this information, as it's not actually returned by the steam API in any capacity.
The only possible way i can think of making this supported is by getting the user's login token, meaning having the user either writing in their account name, password, and the 2FA seed, or by having the user download the cookies from steam in their browser. then using web scraping to load the chat tab, then scraping the data from there. This is very scuffed and i really don't want to implement it in this way.

If you know any other way of getting this data, please create a comment informing me how so i can add this as a feature

changing rich presence title?

Is there any way we can change "a game on steam" to "on Steam Deck" so that it says

Playing on Steam Deck
Control Ultimate Edition
The Foundation
04:26 elapsed

instead of "Playing a game on steam, etc"
If that's possible I think it would look a lot better. I know this rich presence isn't intended solely for the Steam Deck but that's what I and many others are using it for, so the ability to customize the RPC title would be great

non-steam game whitelist?

,, was curious about this with Minecraft in specific since it has native rich presence to begin with - and I assume if I launched through something like Prism for ex. I could simply leave the name as "Minecraft" and discord's native icons could be pulled
-though I'm not sure if there are more complexities to it more than that

Installation doesn't work

Here's the error I got when running install.sh.

Testing if the script works

[Apr 16 2024 - 17:55:28] couldn't find the the meta file, creating new one

[Apr 16 2024 - 17:55:28] updating meta.json's structure-version to 1
[Apr 16 2024 - 17:55:28] importing libraries for meta update
[Apr 16 2024 - 17:55:28] creating /home/user1/Documents/scripts/steam-presence/./data/
[Apr 16 2024 - 17:55:28] moving /home/user1/Documents/scripts/steam-presence/./icons.txt
[Apr 16 2024 - 17:55:28] moving /home/user1/Documents/scripts/steam-presence/./games.txt
[Apr 16 2024 - 17:55:28] moving /home/user1/Documents/scripts/steam-presence/./customGameIDs.json
[Apr 16 2024 - 17:55:28] moving /home/user1/Documents/scripts/steam-presence/./meta.json

[Apr 16 2024 - 17:55:28] loading config file
Traceback (most recent call last):
File "/home/user1/Documents/scripts/steam-presence/./main.py", line 1168, in
main()
File "/home/user1/Documents/scripts/steam-presence/./main.py", line 977, in main
config = getConfigFile()
^^^^^^^^^^^^^^^
File "/home/user1/Documents/scripts/steam-presence/./main.py", line 162, in getConfigFile
userSettings = json.load(f)
^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 5 column 1 (char 97)
./installer.sh: line 48: kill: (31841) - No such process
Test might've worked, did it spit out any errors?
Commands executed.
Setting up service file for Linux
Starting service
If you encountered any errors with this script, please create an issue on the GitHub page

Script completed.

Any help is appreciated!

Non-Steam game detection does not work consistently

Not sure what causes this.

May 19 16:50:39 dot-desktop python[184193]: [May 19 2024 - 16:50:39] game changed, updating to 'No Rest For The Wicked'
May 19 16:50:39 dot-desktop python[184193]: [May 19 2024 - 16:50:39] fetching the Discord game ID for No Rest For The Wicked
May 19 16:50:40 dot-desktop python[184193]: [May 19 2024 - 16:50:40] found the discord game ID for no rest for the wicked
May 19 16:50:40 dot-desktop python[184193]: [May 19 2024 - 16:50:40] fetching icon for No Rest For The Wicked
May 19 16:50:40 dot-desktop python[184193]: [May 19 2024 - 16:50:40] found icon for No Rest For The Wicked in cache
May 19 16:50:40 dot-desktop python[184193]: [May 19 2024 - 16:50:40] creating new rich presence object for No Rest For The Wi>
May 19 16:50:40 dot-desktop python[184193]: [May 19 2024 - 16:50:40] pushing presence to Discord
May 19 16:50:40 dot-desktop python[184193]: ----------------------------------------------------------
May 19 18:18:14 dot-desktop python[184193]: [May 19 2024 - 18:18:14] closing previous rich presence object, no longer playing>
May 19 18:18:14 dot-desktop python[184193]: ----------------------------------------------------------

image

It decided I was "no longer playing" when I was still playing and now will not detect the game again. cookies.txt was set up yesterday so unless I need to get a new file every 24 hours I don't think that's the issue here.

Restarting the service had no effect. It just sits doing nothing now.

 โ•ฐโ”€ฮป systemctl --user status steam-presence
โ— steam-presence.service - Discord rich presence from Steam on Linux
     Loaded: loaded (/home/dot/.config/systemd/user/steam-presence.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-05-19 18:36:58 MDT; 16min ago
       Docs: https://github.com/JustTemmie/steam-presence
   Main PID: 2464508 (python)
      Tasks: 1 (limit: 57657)
     Memory: 34.2M (peak: 34.7M)
        CPU: 1.877s
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/steam-presence.service
             โ””โ”€2464508 /home/dot/.startupscripts/steam-presence/venv/bin/python -u /home/dot/.startupscripts/steam-presence/m>

May 19 18:36:58 dot-desktop systemd[2335]: Started Discord rich presence from Steam on Linux.
May 19 18:36:58 dot-desktop python[2464508]: ----------------------------------------------------------
May 19 18:36:58 dot-desktop python[2464508]: [May 19 2024 - 18:36:58] progam's current folder structure version is up to date>
May 19 18:36:58 dot-desktop python[2464508]: ----------------------------------------------------------
May 19 18:36:58 dot-desktop python[2464508]: [May 19 2024 - 18:36:58] loading config file
May 19 18:36:58 dot-desktop python[2464508]: [May 19 2024 - 18:36:58] intializing the SteamGrid database...
May 19 18:36:58 dot-desktop python[2464508]: [May 19 2024 - 18:36:58] everything is ready!
May 19 18:36:58 dot-desktop python[2464508]: ----------------------------------------------------------

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.