improve next-in-path handling, fix line endings
This commit is contained in:
parent
f546b49599
commit
31a59f0207
14 changed files with 62 additions and 48 deletions
|
|
@ -1,32 +1,13 @@
|
|||
#!/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
|
||||
#FAKEHOME=${XDG_DATA_HOME:-$HOME/.local/share}/steam
|
||||
#echo "Starting Steam in faked home $FAKEHOME" >&2
|
||||
#
|
||||
## 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