summaryrefslogtreecommitdiff
path: root/tools/steam-dmenu.sh
blob: 286d31259e5991adeec37dedd62607b028668bb2 (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh
# steam game launcher using dmenu
appdir="$HOME/.local/share/Steam/steamapps"
[ -d "$appdir" ] || exit 1
list=$(find "$appdir" -name '*.acf' -print0 | \
    xargs -0 -I{} awk -F '"' '/"name"/{name=$4}/"appid"/{printf "%s:%s\n",name,$4}' {} )
choice=$(printf '%s' "$list" | sort | dmenu -i -l 20)
appid=$(printf '%s' "$choice" | cut -d: -f2)
[ -n "$appid" ] && steam -applaunch "$appid" >/dev/null 2>&1 &