Skip to content

Instantly share code, notes, and snippets.

@seanbutnotheard
Created July 26, 2012 03:35
Show Gist options
  • Save seanbutnotheard/3180091 to your computer and use it in GitHub Desktop.
Save seanbutnotheard/3180091 to your computer and use it in GitHub Desktop.
Openbox pipemenu script to list installed Desura games.
#!/bin/bash
if [ -d $HOME/.desura ]; then
gamedir=$HOME/.desura/games
else
gamedir=/opt/desura/common
fi
desura=$(which desura 2> /dev/null || which desurium 2> /dev/null)
echo "<openbox_pipe_menu>"
echo "<item label=\"desura client\">"
echo "<action name=\"Execute\">"
echo "<execute>$desura</execute>"
echo "</action>"
echo "</item>"
echo "<separator/>"
for game in $(ls $gamedir); do
launcher=$(ls $gamedir/$game/ | grep desura_launch_Play)
if [ "$?" = "0" ]; then
echo "<item label=\"$game\">"
echo "<action name=\"Execute\">"
echo "<execute>\"$gamedir/$game/$launcher\"</execute>"
echo "</action>"
echo "</item>"
fi
done
echo "</openbox_pipe_menu>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment