|
#!/bin/bash |
|
logNewLine="\n" |
|
logPrefix="${logNewLine} >> " |
|
logDoubleNewLines="\n\n" |
|
temporaryFolderName="UbuntuMojaveTemp" |
|
themeGitLink="https://github.com/paullinuxthemer/Mc-OS-themes.git" |
|
themeSelectedGitFolderName="McOS-MJV" |
|
iconLaCapitaineGitLink="https://github.com/keeferrourke/la-capitaine-icon-theme/archive/refs/tags/v0.6.2.zip" |
|
cursorsGitLink="https://github.com/keeferrourke/capitaine-cursors.git" |
|
shellGitLink="https://github.com/unc926/XO_MacOS_Gnome_Shell.git" |
|
osThemeDirName=".themes" |
|
cursorDirName="capitaine-cursors" |
|
osFontsDirNamePath=".local/share/fonts" |
|
osIconsDirName=".icons" |
|
|
|
printf "${logPrefix} Ubuntu To Mac OS Mojave theme - Script ${logDoubleNewLines}" |
|
|
|
printf "${logPrefix} Enter username: ${logDoubleNewLines}" |
|
read targetUsername |
|
|
|
if getent passwd ${targetUsername} >/dev/null 2>&1; then |
|
# Username is valid |
|
echo "Username is valid" |
|
else |
|
# Username is NOT valid |
|
echo "Username is not valid" >/dev/stderr |
|
exit 1 |
|
fi |
|
|
|
printf "${logPrefix} Theme will be only installed for user : ${targetUsername} ${logDoubleNewLines}" |
|
|
|
targetUserHomeDirPath=$(sudo grep ${targetUsername} /etc/passwd | cut -d ":" -f6) |
|
|
|
create_dir_in_user_home() { |
|
printf "${logPrefix} Creating directory at ${targetUserHomeDirPath}/$1 \n\n" |
|
sudo -u ${targetUsername} mkdir -p "${targetUserHomeDirPath}/$1" |
|
} |
|
|
|
install_dependencies() { |
|
printf "${logPrefix} Updating packages ${logDoubleNewLines}" |
|
apt update |
|
|
|
printf "${logPrefix} Installing Gnome Tweaks ${logDoubleNewLines}" |
|
apt install --yes gnome-tweaks |
|
apt-get --yes install gir1.2-clutter-1.0 gir1.2-clutter-gst-3.0 gir1.2-gtkclutter-1.0 |
|
apt install --yes gnome-shell-extensions |
|
|
|
printf "${logPrefix} Installing Git ${logDoubleNewLines}" |
|
apt install --yes git |
|
|
|
printf "${logPrefix} Installing Unzip ${logDoubleNewLines}" |
|
apt-get --yes install unzip |
|
|
|
printf "${logPrefix} Installing Inkscape ${logDoubleNewLines}" |
|
apt install --yes inkscape x11-apps |
|
apt install --yes libcanberra-gtk-module |
|
|
|
# printf "${logPrefix} Installing XZ-Utils ${logDoubleNewLines}" # Already Ubuntu has inbuilt |
|
# apt-get --yes install xz-utils |
|
} |
|
|
|
setup_theme_and_shell_and_fonts() { |
|
# For Theme and Shell and Fonts |
|
create_dir_in_user_home ${osThemeDirName} |
|
create_dir_in_user_home ${osFontsDirNamePath} |
|
osThemeDestinationPath="${targetUserHomeDirPath}/${osThemeDirName}/" |
|
osFontsDestinationPath="${targetUserHomeDirPath}/.local/share/fonts" |
|
|
|
# For Theme |
|
themeClonePath="${targetUserHomeDirPath}/${temporaryFolderName}/themes" |
|
|
|
printf "${logPrefix} Removing Older Theme ${logDoubleNewLines}" |
|
rm -r -f ${themeClonePath} |
|
|
|
printf "${logPrefix} Downloading Theme ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} git clone ${themeGitLink} ${themeClonePath} |
|
|
|
printf "${logPrefix} Copying Theme ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} cp -a ${themeClonePath}/${themeSelectedGitFolderName} ${osThemeDestinationPath} |
|
|
|
printf "${logPrefix} Setting Theme ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface gtk-theme ${themeSelectedGitFolderName} |
|
|
|
# For Shell And Fonts |
|
shellClonePath="${targetUserHomeDirPath}/${temporaryFolderName}/shell_and_fonts" |
|
shellZipFileName="XO.for.Dash.to.DOCK.tar.xz" |
|
shellXOCatalinaDirPath="${shellClonePath}/XO.for.Dash.to.DOCK/GNOME 3.30 - 3.32/XO_Catalina" |
|
fontDownloadedDirPath="${shellClonePath}/XO.for.Dash.to.DOCK/FONT" |
|
|
|
printf "${logPrefix} Removing Older Shell and Fonts ${logDoubleNewLines}" |
|
rm -r -f ${shellClonePath} |
|
|
|
printf "${logPrefix} Downloading Shell and Fonts ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} git clone ${shellGitLink} ${shellClonePath} |
|
|
|
printf "${logPrefix} Extracting Shell and fonts ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} tar -xvf ${shellClonePath}/${shellZipFileName} --directory ${shellClonePath} |
|
|
|
printf "${logPrefix} Copying Fonts ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} cp -a "${fontDownloadedDirPath}/San Francisco.ttf" "${osFontsDestinationPath}" |
|
sudo -u ${targetUsername} cp -a "${fontDownloadedDirPath}/SanFranciscoDisplay-Regular.otf" "${osFontsDestinationPath}" |
|
|
|
printf "${logPrefix} Setting Fonts ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface font-name 'San Francisco Display Bold 11' |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface document-font-name 'San Francisco Display Regular 11' |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface text-scaling-factor '1.2' |
|
|
|
printf "${logPrefix} Copying Shell ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} cp -a "${shellXOCatalinaDirPath}" "${osThemeDestinationPath}" |
|
|
|
printf "${logPrefix} Setting Shell ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.shell.extensions.user-theme name 'XO_Catalina' |
|
|
|
sudo -u ${targetUsername} wget https://media.idownloadblog.com/wp-content/uploads/2018/06/macOS-Mojave-Day-wallpaper.jpg -P "${targetUserHomeDirPath}/${osThemeDirName}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.background picture-uri "file://${targetUserHomeDirPath}/${osThemeDirName}/macOS-Mojave-Day-wallpaper.jpg" |
|
|
|
} |
|
|
|
setup_dock(){ |
|
printf "${logPrefix} Setting Dock ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true |
|
sudo -u ${targetUsername} gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-shrink false |
|
sudo -u ${targetUsername} gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode DEFAULT |
|
sudo -u ${targetUsername} gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false |
|
sudo -u ${targetUsername} gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM |
|
} |
|
|
|
setup_icons_and_cursors() { |
|
# For Icons and Cursors |
|
create_dir_in_user_home ${osIconsDirName} |
|
osIconsDestinationPath="${targetUserHomeDirPath}/${osIconsDirName}/" |
|
|
|
# For Icons - START |
|
iconsClonePath="${targetUserHomeDirPath}/${temporaryFolderName}/icons" |
|
|
|
printf "${logPrefix} Removing Older Icons ${logDoubleNewLines}" |
|
rm -r -f ${iconsClonePath} |
|
|
|
printf "${logPrefix} Downloading Icons ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} wget ${iconLaCapitaineGitLink} -P ${iconsClonePath} |
|
iconsZipPath=$(find ${iconsClonePath} -mindepth 1 -print) |
|
|
|
printf "${logPrefix} Copying Icons ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} unzip ${iconsZipPath} -d ${osIconsDestinationPath} |
|
|
|
printf "${logPrefix} Setting Icons ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface icon-theme 'la-capitaine-icon-theme-0.6.2' |
|
|
|
printf "${logPrefix} Icons completed ${logDoubleNewLines}" |
|
# For Icons - END |
|
|
|
# For cursors - START |
|
cursorsClonePath="${targetUserHomeDirPath}/${temporaryFolderName}/cursors" |
|
|
|
printf "${logPrefix} Removing Older Cursors ${logDoubleNewLines}" |
|
sudo rm -r -f ${cursorsClonePath} |
|
|
|
printf "${logPrefix} Downloading Cursors ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} git clone ${cursorsGitLink} ${cursorsClonePath} |
|
|
|
printf "${logPrefix} Building Cursors ${logDoubleNewLines}" |
|
mode="light" #dark #light |
|
dpi="hd" #lo #tv #hd #xhd #xxhd #xxxhd |
|
cd ${cursorsClonePath} |
|
./build.sh -p unix -t ${mode} -d ${dpi} |
|
cursorsBuildedPath=${cursorsClonePath}/dist/${mode} |
|
|
|
printf "${logPrefix} Copying Cursors ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} cp -a ${cursorsBuildedPath} ${osIconsDestinationPath} |
|
sudo -u ${targetUsername} mv ${osIconsDestinationPath}/${mode} ${osIconsDestinationPath}/${cursorDirName} |
|
|
|
printf "${logPrefix} Setting cursors ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface cursor-theme ${cursorDirName} |
|
|
|
printf "${logPrefix} Increasing cursors size ${logDoubleNewLines}" |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface cursor-size 48 |
|
|
|
printf "${logPrefix} Cursors completed ${logDoubleNewLines}" |
|
# For cursors - END |
|
} |
|
|
|
setup_minor_tweaks(){ |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.interface show-battery-percentage true |
|
sudo -u ${targetUsername} gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:' |
|
} |
|
|
|
install_dependencies |
|
create_dir_in_user_home ${temporaryFolderName} |
|
setup_theme_and_shell_and_fonts |
|
setup_dock |
|
setup_icons_and_cursors |
|
setup_minor_tweaks |
|
|
|
echo "${logPrefix} Run following commands manually in terminal ${logDoubleNewLines}" |
|
echo "gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true" |
|
echo "gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-shrink false" |
|
echo "gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode DEFAULT" |
|
echo "gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false" |
|
echo "gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM" |
|
echo "gsettings set org.gnome.desktop.interface gtk-theme ${themeSelectedGitFolderName}" |
|
echo "gsettings set org.gnome.desktop.interface font-name 'San Francisco Display Bold 11'" |
|
echo "gsettings set org.gnome.desktop.interface document-font-name 'San Francisco Display Regular 11'" |
|
echo "gsettings set org.gnome.desktop.interface text-scaling-factor '1.2'" |
|
echo "gsettings set org.gnome.shell.extensions.user-theme name 'XO_Catalina'" |
|
echo "gsettings set org.gnome.desktop.interface icon-theme 'la-capitaine-icon-theme-0.6.2'" |
|
echo "gsettings set org.gnome.desktop.interface cursor-theme ${cursorDirName}" |
|
echo "gsettings set org.gnome.desktop.interface cursor-size 48" |
|
echo "gsettings set org.gnome.desktop.interface show-battery-percentage true" |
|
echo "gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'" |
|
echo "gsettings set org.gnome.desktop.background picture-uri 'file://${targetUserHomeDirPath}/${osThemeDirName}/macOS-Mojave-Day-wallpaper.jpg'" |
|
exit 0 |
Awesome gist , thanks a lot for sharing
I'd like to leave this here as an extra step for the dock transparency
https://www.maketecheasier.com/enable-dynamic-transparency-ubuntu/