Skip to content

Companion for Discord to auto-launch dummy programs in order to make discord show wine games

License

Notifications You must be signed in to change notification settings

null-von-sushi/Discordcomp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discordcomp

NOTE:

I take no responsibility, but it shouldn't set your computer on fire.

A Companion to launch native dummy programs

This was made to launch empty dummy programs that do absolutely nothing, for the sole purpose of having them be selectable when playing windows games using WINE or Java in Discord. For example, if you play Vampire the Masquerade: Bloodlines using wine, the .exe file is called Vampire.exe. Discord on Linux will not show that as a game. What this does is copy a dummy program written in C, renames it Vampire.exe.dummy and launches it while you play. After you are done playing it should automatically kill the dummy program and remove it from the temporary folder. This allows you to add a custom game called "Vampire.exe.dummy" to discord, and then rename it to "Vampire the Masquerade: Bloodlines", allowing you to show everyone that you have great taste in games.

How to use

Step 1 git clone https://github.com/Null-Senpai/Discord-for-Linux-Wine-helper

Step 2a You trust me: delete dummy.c if you want, it's not needed.

Step 2b You don't trust me: check the script and the C source code for anythig 🐟-y, delete the dummy binary and then compile the dummy file from scratch (that would be gcc -o dummy dummy.c).

Step 3 Edit the processes.txt to match the names of the process of your games. For windows games running using wine this would be game.exe, not wineserver or wine. Each process should look have the name, with proper capitalization, seperated by new lines. Note: Due to the weird ass way pgrep behaves, you should only write the first 15 characters. E.g. LeagueClient.exe becomes LeagueClient.ex and pokemmo-launcher becomes pokemmo-launche!

Step 4 Run discordcomp.sh

You do not need to launch it with every game or something. It is essentially intended as background service.

Possible Bugs / Known issues

  • I have only tested .exe names which contain no spaces. I guess if you are adding .exe names with spaces, you might want to escape them? (e.g. Name\ of\ executable\ with\ spaces.exe). I am not sure yet, I will adress this once I notice it misbehave Processes with spaces in it are now supported. Be aware that a space is also a caracter, so "My Great Videogame" becomes "My Great Videog" since we can only add the first 15 characters.
  • If you wanna stop the script, make sure any wine programs are closed before. Or just manually kill all the name-of-exefile.exe.dummy programs later. Not really a big deal, but I thought I'd mention it.
  • This thing technically does a lot of polling, so theoretically there is an impact on battery life on laptops. Really, I cannot imagine it taking more battery power then having Task Manager on Windows open in the background would. Essentially it asks the OS "is game.exe running?" every 10 seconds...
  • Again, you should only write the first 15 characters of the game process name since pgrep will otherwise not find your process.
  • It might match processes with the same name. It's unlikely that your file manager or web browser will be called Vampire.exe, but if it is discord will think you're playing the game.

To-do / Wishlist

  • Would be nice if we could not poll, but instead somehow only run when wineserver is started or something?
  • Would be nice if we could add extended discord info (Discord's "Rich Presence") to the dummy files. It would not be game-specific, at least not without also keeping a database of 'special' games, but it might say things like "In game: League of Legends. Currently running using WINE on Linux" or something. I am not sure if this would work however, since you have to manually set the game name anyways (the executables are just called exe-name.exe.dummy after all)...
  • Maybe I should look into how to write PKGBUILD files? That way I could write an AUR package. Technically I think something could be done with RPM too (maybe?), but that just looks confusing af, and I do not use it. As for .deb packages, I do not think that they can be used to install random files from github. AFAIK they always have to be buit in advance to contain a certain version of a file. Technically flatpak might also be an option. Maybe I'll look into packaging once I have implemented exe-names with spaces and can have ~5-7 games run reliably without having to edit the script.

Put together from info found here:

About

Companion for Discord to auto-launch dummy programs in order to make discord show wine games

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published