Mining on the Steam Deck with Agent
JRPG and VN mining¶
With Agent, we can extract text from popular JRPGs and visual novels and add them to Anki all on the Steam deck.
This works for games such as Persona (3-5), Yakuza, Steins Gate, Danganronpa and more. You can find the full list here.
Getting Started¶
We'll use the following applications. Switch to Steam Deck's desktop mode for the following steps.
Applications¶
- Anki on Flathub
- AnkiConnect Anki addon
- Agent Text Extractor (Windows version)
- Steam Tinker Launch
- Chrome on Flathub
- Yomitan Chrome extension
- Clipboard Inserter Chrome extension
Info
To switch to desktop mode, press the bottom right Steam
button, select Power
, then Switch to Desktop
. If Switch to Desktop
is unavailable, look for Exit Big Picture Mode
.
Even though the Steam Deck uses Linux, we are using the Windows version of Agent. It will run alongside our game through a compatibility layer provided by Steam Tinker Launch.
If you're having trouble installing the tools, you can follow along with this video tutorial.
Steam Deck Mining Tutorial¶
Adding Agent to your game¶
Once you have everything installed, launch Steam, select Library, right click on your game and select Properties. Select Compatibility
, enable Force the use of a specific Steam Play compatibility tool
and select Steam Tinker Launch
from the dropdown menu.
Launch the game, and Steam Tinker Launch's menu will pop up. Select Main Menu
on the bottom right, and Game Menu
in the following popup. Under Misc options
, enable Use custom command
and select the agent.exe
file inside the Agent application folder. Select Save
. The next time the game is launched, Agent
will be launched at the same time.
Extracting text to Chrome¶
On Agent, hold down the target icon on the top right and drag it to the game window. This will fill in the game title for you. Type in the Script
input and search for your game. If this is the first time you are using Agent, click on the button next to the Script input and select Update scripts
to fetch the scripts online. Finally, select Attach
.
On Chrome, pin the Clipboard Inserter
extension and toggle to enable it. Go to this Texthooker page, and text from the game will be pasted on Chrome as you play.
For information on setting up Yomitan and Anki, visit this site.
Adding the window toggle script¶
Launch the pre-installed text editor Kate
. Paste the following script and change the name of your game window. We only need to type in its prefix for our cli tool to locate the game window. For example, if your game window's name is SG 線形拘束のフェノグラム
, you can just put in SG
.
game_name=SG # change this line to the name of your game window
game_window=$(xdotool search -name --desktop 0 $game_name)
active_window=$(xdotool getactivewindow)
chrome_window=$(xdotool search -name --desktop 0 Chrome)
if [ $active_window -eq $chrome_window ]; then
xdotool windowactivate $game_window
else
xdotool windowactivate $chrome_window
fi
Info
To quickly open apps, use the shortcut alt+space or command+space, type in the name of the application, and press enter.
Click Save As
and save the file as toggle_window.sh
to your Desktop.
Info
Here's a quick way to test the script. While a Chrome window is open, launch Konsole
, type in sh Desktop/toggle_window.sh
and see if your Chrome window is brought to focus. If not, check to see if you accidentally removed xdotool or renamed Chrome.
Adding a system shortcut to invoke the script¶
Click System Settings
on the bottom left status bar. Under Workspace
, select Shortcuts
> Custom Shortcuts
. On the bottom, select Edit
> New
> Global Shortcut
> Command/URL
. Name it as Toggle browser
.
On the top right, select Trigger
and click on the input box, and hit the CapsLock
key on your keyboard. Select the Action
tab and type in sh /home/deck/Desktop/toggle_window.sh
. Finally, select Apply
on the bottom right.
Warning
Not every key or shortcut can be used during game mode. We recommend CapsLock
, as it is rarely used.
Mapping the Steam Deck controller to the system shortcut¶
We need to map the controller twice, one for Desktop, and one for our game.
Mapping on desktop¶
On Steam, select Steam
on top and select Settings
. Select Controller
, and under Non-game Controller Layouts
, select Edit
for the Desktop Layout
.
Select Edit Layout
, click for the X key, and select Remove command
. Select Add command
, Keyboard
, and click on the CapsLock
button on the keyboard layout. Click Back
several times on the bottom right until the window closes.
Mapping in-game¶
On Steam, select Library
, right click on your game, and select Properties
, Select Controller
, and select Controller Configurator
.
Similarly, select Edit Layout
, click for the X key, and select Remove command
. Select Add command
, Keyboard
, and click on the CapsLoc
button on the keyboard layout.
Info
For visual novels like Steins Gate that do not support controllers on desktop mode, we could also map the A, B keys to Enter
and Right Mouse Click
. For DPad
, we could map the directional keys to the Desktop arrow keys.
With Chrome and the game window open, push the X key on your Steam Deck to test if it successfully toggles focus bewteen your game and Chrome.
Hiding bottom taskbar¶
You may want to hide the bottom taskbar while playing on desktop mode. Right click on the taskbar, enter edit mode, More options
, and select Windows Can Cover
or Auto Hide
.