Advertisement
NolanSyKinsley

IconGrabber.sh

Apr 17th, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. STEAMAPPS=~/.steam/steam/steamapps/
  4. ICONS=~/.local/share/icons/hicolor/32x32/apps/
  5.  
  6.  
  7. for file in $(ls $STEAMAPPS/*.acf -1v); do
  8. ID=$(cat "$file" | grep '"appid"' | head -1 | sed -r 's/[^"]*"appid"[^"]*"([^"]*)"/\1/')
  9. NAME=$(cat "$file" | grep '"name"' | head -1 | sed -r 's/[^"]*"name"[^"]*"([^"]*)"/\1/')
  10. ICONHASH=$(steamcmd +app_info_print $ID +exit | grep -w -m 1 "icon" | sed -r 's/[^"]*"icon"[^"]*"([^"]*)"/\1/')
  11. if [ ! -f $ICONS/steam_icon_$ID.png ]; then
  12. wget http://media.steampowered.com/steamcommunity/public/images/apps/$ID/$ICONHASH.jpg -O $ICONS/steam_icon_$ID.png
  13. echo "$NAME's icon is missing, retrieving from web"
  14. else
  15. echo "$NAME's icon is present, skipping"
  16. fi
  17. done
  18. echo "done"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement