I wanted to have my entire Steam library (including the games not currently installed) visible in EmulationStation, so I put together this (very ugly) Bash script...

Figured some folks here might find it useful and wanted to share it since it took me the better part of a day to get it working.

It requires you to have a list of the games (one per line) from your library in a text file named "steam_library.txt" (which should be placed in the same folder as the script; the script puts the generated .desktop files in a subdirectory titled "0" -- either roll with that, or change it to whatever you like). To get mine, I pasted the list from https://store.steampowered.com/account/licenses/ into a spreadsheet, then pasted the column with the game titles into the text file, then did a lot of cleaning up manually (deleting DLCs from the list, as well as the many iterations of "Retail", etc. -- Edit -> Replace is your friend ;) ).

It utilizes ddgr (should be easily installable via your distro's package manager) to acquire the AppID for each game.

Opening an uninstalled game from EmulationStation will launch the installation dialog for it in Steam.

Like I said, I know it's ugly, but I haven't worked on anything like this in a long time, and hey, it works. ¯\_(ツ)_/¯ Feel free to share any suggestions for improvement.

#!/bin/bash

INPUT_FILE="steam_library.txt"

if [[ ! -f "$INPUT_FILE" ]]; then
    echo "Input file '$INPUT_FILE' not found."
    exit 1
fi

while IFS= read -r line; do
    # Skip empty lines
    if [[ -n "$line" ]]; then
        touch -- 0/"$line".desktop
        echo '[Desktop Entry]' >> 0/"$line".desktop
        echo 'Name='"$line" >> 0/"$line".desktop
        echo 'Exec=steam steam://rungameid/'`ddgr --noua --np -x -n 1 steam "$line" | grep http | cut -d/ -f5` >> 0/"$line".desktop
        echo 'Type=Application' >> 0/"$line".desktop
        chmod 755 0/"$line".desktop
        sleep 3
    fi
done < "$INPUT_FILE"

echo "Files created successfully using raw line content as names."

Posted Jun 30, 2025, 3:18 AM UTC

61
Loading comments…