diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-11-29 17:21:07 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-11-29 17:21:07 +0100 |
commit | 1c632029d7a02742b0cc740b6984ce139429b88b (patch) | |
tree | c3ff42411f67d57ef86249723f38a726414ecd8a /bin/menuscripts/mgame | |
parent | 5464c097a44165473b352c463805a39799888c52 (diff) |
checkpoint
Diffstat (limited to 'bin/menuscripts/mgame')
-rwxr-xr-x | bin/menuscripts/mgame | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/menuscripts/mgame b/bin/menuscripts/mgame new file mode 100755 index 0000000..7c90a2b --- /dev/null +++ b/bin/menuscripts/mgame @@ -0,0 +1,20 @@ +#!/bin/sh + +steam_games() +{ + # List every manifest file and get the id of the games from the file names and the name of the + # game from the file. + find $HOME/.local/share/Steam/steamapps \ + -maxdepth 1 -type f -iname 'appmanifest_*.acf' | + while read -r File; do + Name="$(grep '"name"' "$File" | cut -f 4 -d '"')" + FileBaseName="${File%.acf}" + SteamID="${FileBaseName##*appmanifest_}" + printf '%s %s\n' "$SteamID" "$Name" + done +} + +Choice="$(steam_games | cut -f 2- -d' ' | dmenu -c -i -x)" +ID="$(steam_games | grep "[0-9]\+ $Choice" | cut -f 1 -d ' ')" + +setsid steam steam://rungameid/"$ID" |