Merge branch 'master' of github.com:kevinveenbirkenbach/core-system

This commit is contained in:
2021-11-12 16:30:28 +01:00
5 changed files with 38 additions and 76 deletions

View File

@@ -107,12 +107,6 @@ if [ ! "$(pacman -Qi "virtualbox")" ] ; then
info "Keep in mind to install the guest additions in the virtualized system. See https://wiki.manjaro.org/index.php?title=VirtualBox"
fi
if [ "$XDG_SESSION_TYPE" == "x11" ]; then
info "Synchronizing xserver tools..." &&
install_yay_packages_if_needed xbindkeys &&
xbindkeys --poll-rc || error
fi
install_gnome_extension(){
info "Install GNOME extension \"$1\"..."
extension_folder="$HOME/.local/share/gnome-shell/extensions/$1/"

View File

@@ -0,0 +1,30 @@
#!/bin/bash
#
# This script syncronizes home folders with the cloud
# @param $1 clouddomain.tld
#
directories=("Documents" "Pictures" "Music" "Books" "Videos");
for folder in "${directories[@]}"; do
home_directory="$HOME/$folder";
cloud_directory="$HOME/Clouds/$1/$folder";
if [ -L "$home_directory" ]
then
if [ "$(readlink -f "$home_directory")" == "$(realpath "$cloud_directory")" ]
then
"Folder $home_directory is allready symlinked with $cloud_directory. Skipped.";
else
"ERROR: Folder $home_directory links to a wrong target. Solve manually!" && exit 1;
fi
else
if [ -d "$cloud_directory" ]
then
mv --backup -v "$home_directory/"* "$cloud_directory/" &&
rmdir -v "$home_directory" &&
ln -vs "$cloud_directory" "$home_directory" &&
echo "Folder $home_directory is now syncronized with cloud." || exit 1
else
echo "Directory $home_directory skipped, because it doesn't exist here $cloud_directory." &&
echo "Please create $cloud_directory or syncronize the cloud folder!";
fi
fi
done