Add some more xdg-wrappers and dep: annotations to existing ones
This commit is contained in:
parent
40e434d6b9
commit
c86e99d073
10 changed files with 50 additions and 0 deletions
32
xdg-wrappers/steam
Executable file
32
xdg-wrappers/steam
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
#dep:steam
|
||||
|
||||
FAKEHOME=${XDG_DATA_HOME:-$HOME/.local/share}/steam
|
||||
echo "Starting Steam in faked home $FAKEHOME" >&2
|
||||
|
||||
# Symlink a file to the fake home
|
||||
link_dir() {
|
||||
# Replace HOME with FAKEHOME in the link name
|
||||
link_name=$(echo $1 | sed "s|^$HOME|$FAKEHOME|")
|
||||
|
||||
# Creates the link's parent directory and symlinks it
|
||||
mkdir -p $(dirname $link_name)
|
||||
if [ ! -d $link_name ]; then
|
||||
echo "Linking $link_name" >&2
|
||||
ln -s $1 $link_name
|
||||
fi
|
||||
}
|
||||
|
||||
mkdir -p $FAKEHOME
|
||||
|
||||
link_dir $XDG_DATA_HOME # ~/.local/share
|
||||
link_dir $XDG_CACHE_HOME # ~/.cache
|
||||
link_dir $XDG_CONFIG_HOME # ~/.config
|
||||
|
||||
# If .steam exists in ~/ and not in the fake home, move it to the fake home
|
||||
if [ -d $HOME/.steam ] && [ ! -d $FAKEHOME/.steam ]; then
|
||||
echo "migrating $HOME/.steam to $FAKEHOME" >&2
|
||||
mv $HOME/.steam $FAKEHOME/
|
||||
fi
|
||||
export HOME=$FAKEHOME
|
||||
exec /usr/bin/steam $@
|
Loading…
Add table
Add a link
Reference in a new issue