To just automate this process you could use a symlink....
remove the foo directory and create the symlink to it.
ln -s -T /home/youruser/Documents/foo /usr/share/themes/foo
In this way the only thing you have to do is step 4 , because you work always on the newest build. With this the permissions should be right and also you can git push it to your account. If something should be unclear just write a comment and i will explain it more. I dont have a official source, thats just the way i would do it... and maybe the reason why you cant find anything online about this. When this is setup you can create a watch process on file changes that executes point 4 Inotify.
EDIT Working Theme Auto-Reload: This will reload all your theme settings
First of all you need some packages to check for disk changes and the unity-tweak-tool
sudo apt-get install inotify-tools unity-tweak-tool
Remove your existing theme folder, remember for all my tests i took a WinXP theme as test.
sudo mv /usr/share/themes/WinXP/ /usr/share/themes/WinXP-backup/
Link your github theme folder
sudo ln -s -T /home/snapo/Downloads/WinXP/ /usr/share/themes/WinXP/
Just for security reasons create a copy of your software-center
sudo cp -a /usr/share/software-center /usr/share/software-center-backup
Create a file with this content in your home folder like i had it in /home/snapo/autothemechange.sh
#! /bin/bash
##############################################################################################
DIRECTORY_TO_OBSERVE="/usr/share/themes/WinXP/" ###### might want to change this #########
MYTHEMENAME="WinXP" ###### your theme directory name #########
LOGFILE="/home/snapo/log-theme-change.log" ###### Logfile to see when change happen #
##############################################################################################
function detect_theme_change {
inotifywait -r \
-e modify,move,create,delete \
$DIRECTORY_TO_OBSERVE
}
while detect_theme_change; do
now="$(date)"
echo "Theme has been changed $now" >> $LOGFILE ;
/usr/bin/gtk-update-icon-cache
/usr/bin/gtk-update-icon-cache-3.0
/usr/bin/xdg-user-dirs-gtk-update
# reset GTK COLOR SCHEME (Unity, GNOME3, Cinnamon, MATE, GNOME2)
gsettings set org.gnome.desktop.interface gtk-color-scheme ""
# mateconftool-2 --type=string --set /desktop/mate/interface/gtk_color_scheme ""
gconftool-2 --type=string --set /desktop/gnome/interface/gtk_color_scheme ""
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.loadTheme();' ;
# change gtk theme (Unity, GNOME3, Cinnamon, MATE, GNOME2)
gsettings set org.gnome.desktop.interface gtk-theme "$MYTHEMENAME"
# mateconftool-2 --type=string --set /desktop/mate/interface/gtk_theme "$MYTHEMENAME"
gconftool-2 --type=string --set /desktop/gnome/interface/gtk_theme "$MYTHEMENAME"
# reset / change window theme (Unity, GNOME3, Cinnamon, MATE, GNOME2)
gsettings set org.gnome.desktop.wm.preferences theme "$MYTHEMENAME"
gconftool --type=string --set /desktop/cinnamon/windows/theme "$MYTHEMENAME"
gconftool-2 --type=string --set /apps/metacity/general/theme "$MYTHEMENAME"
# mateconftool-2 --type=string --set /apps/marco/general/theme "$MYTHEMENAME"
# change shell theme
gsettings set org.gnome.shell.extensions.user-theme name "$MYTHEMENAME"
gsettings set org.cinnamon.theme name "$MYTHEMENAME"
done
When you have done this, set it to chmod 755
chmod 755 /home/snapo/autothemechange.sh
Remember, the script will put out many errors, because i will reload the most theme engines... that means if you use gtk3 all others give out a error, if you use unity the same to the others... please ignore them.
There are 3 Variables you need to edit before you run it the first time, description for each variable is at the right side of the variable.
IF you want that the script automatically starts when you login (which i dont recommend for inotify) then you can do the following:
System > Preferences > Startup Applications:
bash /home/snapo/autothemeupdate.sh
i recommend creating a link on the desktop, so while you start developing, you doubleclick the link.