![]() |
|
Openbox: List Steam Games - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Coding (https://sinister.li/Forum-Coding--71) +--- Thread: Openbox: List Steam Games (/Thread-Openbox-List-Steam-Games) |
Openbox: List Steam Games - Viomi - 01-31-2016 This is a bash script for Openbox that lists all of your installed steam games in your little openbox window thing. ![]() Code: #This script creates an Openbox pipe menu to list all currently installed steam games as well as launch them.
#To install:
#Put this script in ~./config/openbox/scripts/steam.sh (or elsewhere if you want to edit the below <menu>)
#Edit the preferences of steam.sh to allow running as a program
#Add the below line to menu.xml (without the comment of course)
#<menu execute="~/.config/openbox/scripts/steam.sh" id="steam" label="Steam"/>
#!/bin/bash
STEAMAPPS=~/.local/share/Steam/steamapps
echo '<openbox_pipe_menu>'
echo '<item label="Launch Steam"><action name="Execute"><execute>steam</execute></action></item>'
echo '<separator/>'
for file in $(ls $STEAMAPPS/*.acf -1v); do
ID=$(cat "$file" | grep '"appid"' | head -1 | sed -r 's/[^"]*"appid"[^"]*"([^"]*)"/\1/')
NAME=$(cat "$file" | grep '"name"' | head -1 | sed -r 's/[^"]*"name"[^"]*"([^"]*)"/\1/')
echo "<item label=\"$NAME\"><action name=\"Execute\"><execute>steam -applaunch $ID</execute></action></item>"
done
echo '</openbox_pipe_menu>'Pretty straightforward if I do say so myself. RE: Openbox: List Steam Games - zorrophreak - 01-31-2016 Interesting, when I get Linux re-installed, (rip-pc), I'll check this out! RE: Openbox: List Steam Games - Viomi - 02-05-2016 Code: #This script is a generally used Openbox pipe menu to list all currently installed steam games as well as launch them.
#To install:
#Put this script in ~./config/openbox/scripts/steam.sh (or elsewhere if you want to edit the below <menu>)
#Add the below line to menu.xml (without the comment of course)
#<menu execute="~/.config/openbox/scripts/steam.sh" id="steam" label="Steam"/>
#!/bin/bash
STEAMAPPS=~/.local/share/Steam/steamapps
echo '<openbox_pipe_menu>'
echo '<item label="Launch Steam"><action name="Execute"><execute>steam</execute></action></item>'
echo '<separator/>'
for file in $STEAMAPPS/*.acf ; do
ID=$(grep '"appid"' "$file" | head -1 | awk -F\" '{print $4}')
NAME=$(grep '"name"' "$file" | head -1 | awk -F\" '{print $4}')
echo "<item label=\"$NAME\"><action name=\"Execute\"><execute>steam -applaunch $ID</execute></action></item>"
done
echo '</openbox_pipe_menu>'An updated version that is a lot more efficient for less resources. |