Skip to content

Instantly share code, notes, and snippets.

@sgtnasty
Created May 26, 2022 13:08
Show Gist options
  • Save sgtnasty/391c6a0ddff6e92009a69d9df1e0253d to your computer and use it in GitHub Desktop.
Save sgtnasty/391c6a0ddff6e92009a69d9df1e0253d to your computer and use it in GitHub Desktop.
Update XDG vars to the Zone share
#!/bin/bash
declare -a FOLDERS=("Documents"
"Pictures"
"Music"
"Videos"
"Templates"
"Games"
"Applications")
delete_folder () {
echo "CHECK $1"
if [[ -d "$1" ]]
then
rmdir -v "$1"
fi
}
for i in "${FOLDERS[@]}"
do
upperstr=$(echo $i | tr '[:lower:]' '[:upper:]')
delete_folder "$HOME/$i"
xdg-user-dirs-update --set "$upperstr" "$HOME/zzone/$i"
ln -v -s "$HOME/zzone/$i" "$HOME"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment