1
Emulators / Re: Need help with Linux Steam launch command.
« on: December 26, 2022, 01:56:52 AM »
I found a way to make it work for Linux, it's fairly easy but does involve a few things.
I am using shell .sh scripts with the executable command bash to launch these with.
First I get the game ID number reading from the .acf files for each game found in this directory,
/home/YOURUSERNAME/.steam/steam/steamapps/
Open the .acf files with a text editor and it will show you the ID number and name of the game.
Then I created a .sh file for each game like this example to have steam launch the game.
For this game I named the file without quotes "BlueKid2.sh" , then I added this to the file
#!/bin/bash
steam steam://run/379640
Important : Don't forget to make the .sh files executable, chomod +x FILENAME.sh in terminal.
You can name the .sh file whatever you want, the game name is probably the easiest to keep up with it.
Then I created the emulator file to launch the games like this,
# Generated by Attract-Mode v2.6.2
#
executable bash
args "[romfilename]"
workdir /home/YOURUSERNAME/Games/Windows/
rompath /home/YOURUSERNAME/Games/Windows/
romext .zip;.7z;.sh
system Windows
info_source listxml
nb_mode_wait 15
exit_hotkey Escape
pause_hotkey P
artwork boxart /home/YOURUSERNAME/.attract/artwork/Windows/boxart
artwork cartart /home/YOURUSERNAME/.attract/artwork/Windows/cartart
artwork flyer /home/YOURUSERNAME/.attract/artwork/Windows/flyer
artwork marquee /home/YOURUSERNAME/.attract/artwork/Windows/marquee
artwork snap /home/YOURUSERNAME/.attract/artwork/Windows/snap
artwork wheel /home/YOURUSERNAME/.attract/artwork/Windows/wheel
I have a dedicated Windows games folder and that's where I put the .sh files although you can change that to whatever you want. I don't play many steam games so I just combine them with my Windows games folder.
For your artwork you just name them the title of your .sh files. Example NeedForSpeed.sh you would name the artwork and snaps NeedForSpeed.png or .mp4 etc and put them in the correct folders.
Once you get a .sh file made for one game you can open a file manager such as Thunar and go to that file in the directory you put it in and select it and copy and paste to create a copy where
you can simply rename the copied .sh and open it with a text editor and edit the game launch ID number for the next game you want to add.
Some things that do not necessarily apply to the steam games, but if you have Windows games installed using .sh files launching them with wine you may run into a launch command for a .sh file
where there are spaces in it, for example the launch command for say : wine /home/YOURUSERNAME/.wine/drive_c/Program Files (x86)/YOUR GAME/Game.exe notice there is a space in between a few places, to
fix this problem add quotes to the command like this : wine "/home/YOURUSERNAME/.wine/drive_c/Program Files (x86)/YOUR GAME/Game.exe" the quotes tell it there are spaces.
I do a similar thing with launching some Epic games that I have installed with Lutris, what I do there is create a desktop shortcut with Lutris and get the launch command for the game from the shortcut and create a .sh file for each game that way using the same
settings above I did for the steam games.
Like this : SuperMeatBoy.sh I add
#!/bin/bash
env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/91
Notice I didn't have to use quotes to launch that game.
You can do that from Lutris to get the command line to launch Steam games by creating a desktop shortcut. It also might be possible to simply add .desktop to Romext in the emulator settings and just move the desktop shortcut over to your RomPath directory and launch it that way using bash for the executable, although I have not tried that yet, a lot of Linux users don't have desktop shortcuts at all depending on what they are using. So I went with using .sh instead.
Anyway, just thought I would come back and offer a solution to launching the games that worked for me using AttractMode & Linux with Steam and Windows & Epic games using Lutris. Like I said there are probably much easier ways to do it, but this worked for me.
I am using shell .sh scripts with the executable command bash to launch these with.
First I get the game ID number reading from the .acf files for each game found in this directory,
/home/YOURUSERNAME/.steam/steam/steamapps/
Open the .acf files with a text editor and it will show you the ID number and name of the game.
Then I created a .sh file for each game like this example to have steam launch the game.
For this game I named the file without quotes "BlueKid2.sh" , then I added this to the file
#!/bin/bash
steam steam://run/379640
Important : Don't forget to make the .sh files executable, chomod +x FILENAME.sh in terminal.
You can name the .sh file whatever you want, the game name is probably the easiest to keep up with it.
Then I created the emulator file to launch the games like this,
# Generated by Attract-Mode v2.6.2
#
executable bash
args "[romfilename]"
workdir /home/YOURUSERNAME/Games/Windows/
rompath /home/YOURUSERNAME/Games/Windows/
romext .zip;.7z;.sh
system Windows
info_source listxml
nb_mode_wait 15
exit_hotkey Escape
pause_hotkey P
artwork boxart /home/YOURUSERNAME/.attract/artwork/Windows/boxart
artwork cartart /home/YOURUSERNAME/.attract/artwork/Windows/cartart
artwork flyer /home/YOURUSERNAME/.attract/artwork/Windows/flyer
artwork marquee /home/YOURUSERNAME/.attract/artwork/Windows/marquee
artwork snap /home/YOURUSERNAME/.attract/artwork/Windows/snap
artwork wheel /home/YOURUSERNAME/.attract/artwork/Windows/wheel
I have a dedicated Windows games folder and that's where I put the .sh files although you can change that to whatever you want. I don't play many steam games so I just combine them with my Windows games folder.
For your artwork you just name them the title of your .sh files. Example NeedForSpeed.sh you would name the artwork and snaps NeedForSpeed.png or .mp4 etc and put them in the correct folders.
Once you get a .sh file made for one game you can open a file manager such as Thunar and go to that file in the directory you put it in and select it and copy and paste to create a copy where
you can simply rename the copied .sh and open it with a text editor and edit the game launch ID number for the next game you want to add.
Some things that do not necessarily apply to the steam games, but if you have Windows games installed using .sh files launching them with wine you may run into a launch command for a .sh file
where there are spaces in it, for example the launch command for say : wine /home/YOURUSERNAME/.wine/drive_c/Program Files (x86)/YOUR GAME/Game.exe notice there is a space in between a few places, to
fix this problem add quotes to the command like this : wine "/home/YOURUSERNAME/.wine/drive_c/Program Files (x86)/YOUR GAME/Game.exe" the quotes tell it there are spaces.
I do a similar thing with launching some Epic games that I have installed with Lutris, what I do there is create a desktop shortcut with Lutris and get the launch command for the game from the shortcut and create a .sh file for each game that way using the same
settings above I did for the steam games.
Like this : SuperMeatBoy.sh I add
#!/bin/bash
env LUTRIS_SKIP_INIT=1 lutris lutris:rungameid/91
Notice I didn't have to use quotes to launch that game.
You can do that from Lutris to get the command line to launch Steam games by creating a desktop shortcut. It also might be possible to simply add .desktop to Romext in the emulator settings and just move the desktop shortcut over to your RomPath directory and launch it that way using bash for the executable, although I have not tried that yet, a lot of Linux users don't have desktop shortcuts at all depending on what they are using. So I went with using .sh instead.
Anyway, just thought I would come back and offer a solution to launching the games that worked for me using AttractMode & Linux with Steam and Windows & Epic games using Lutris. Like I said there are probably much easier ways to do it, but this worked for me.