I got same idea as yours to run RetroArch to record Steam time while playing roms. Found a way how to do it. It's a little 'dirty' method, but this is something.
All you need to do is edit .sh configs EmuDeck uses for launching emulators. In my case I will do it for PCSX2, but it will work with other. I noticed, that imported rom via Steam ROM Manager have launch target set as .sh script (in PCSX2 case it's pcsx2-qt.sh).
So, go to Desktop Mode (Steam ▶ Power ▶ Switch to Desktop)
Next, go to /home/deck/Emulation/tools/launchers and open pcsx2-qt.sh file with Kate or KWrite.
After #!/bin/bash line add this line:
steam -applaucnh 111830
Save this file and close editor.
So, this line will tell Steam to run RetroArch app (111830 is AppID, you can check it in Steam ▶ RetroArch ▶ Properties ▶ Updates). And becuase emulator runs via script, after RetroArch will start, script will work as usualy and will run PCSX2 and your ROM.
Go back to Game Mode and run your rom.
Things to know:
- As I said, it's a 'dirty' method, means it's not perfect. You need manually switch launched apps with Steam button. So, when you see RetroArch opens, press Steam button and select your ROM game on the left. You can see we running 2 apps, one is RetroArch which will write playtime in Steam and second one is ROM in which we will be play.
- This will works for all roms for this emulator, because we set app launch in PCSX2 script, means Retroarch will run always when we run PCSX2 via this script.
For other emulators do same thing, just open .sh files in laucnhers folder (for example: rpcs3.sh for RPCS3 or ppsspp.sh for PPSSPP emulators).
Also, I recommend you install PlayTime plugin (as u/TheVisceralCanvas suggest) for non-steam games, so you always can see exact playtime for roms.
At first, my main idea was point RetroArch in rom's launch arguments by editing parsers in Steam Rom Manager, but I don't figure it out yet. Also, I don't found a way to automatically switch apps in Game Mode (and can't found a way to make a keyboard shortcut to simulate this switch), maybe someone will solve this in future.
And little tip, when you quit roms, firstly exit RetroArch, and after exit your game. In this case you will see your game first in Recent Games on main screen instead of RetroArch.
Have fun!)