Skip to content

Instantly share code, notes, and snippets.

@RockafellaJaz
Last active May 19, 2020 07:32
Show Gist options
  • Save RockafellaJaz/cd385cdcd21656d3d7c0ca91940c68fc to your computer and use it in GitHub Desktop.
Save RockafellaJaz/cd385cdcd21656d3d7c0ca91940c68fc to your computer and use it in GitHub Desktop.
Moving Steam registry.vdf file into ram for faster loading.
#!/bin/bash
### Quick script to place registry.vdf into RAM.
### Manually rename original registry.vdf file to registry.vdf.tmpfs
STEAM_HOME=~
VDF_LINK=$STEAM_HOME/.steam/registry.vdf
VDF_BACKUP=$STEAM_HOME/.steam/registry.vdf.tmpfs
VDF_TMP=/dev/shm/registry.vdf
### If registry.vdf is not in our tmpfs folder then copy it there from our backup.
if [ ! -f $VDF_TMP ]; then
echo "$VDF_TMP not found. Copying from $VDF_BACKUP"
cp $VDF_BACKUP $VDF_TMP
fi
### If registry.vdf symlink is not in steam folder, create it.
if [ ! -L $VDF_LINK ]; then
echo "$VDF_LINK symlink not found. Creating symlink to $VDF_TMP."
ln -s $VDF_TMP $VDF_LINK
fi
### Start steam.
HOME=$STEAM_HOME /usr/games/steam %U
### Backup registry.vdf out of our tmpfs when steam quits.
echo "Steam quit. Backing up VDF."
cp -f $VDF_TMP $VDF_BACKUP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment