Skip to content

Instantly share code, notes, and snippets.

@pishangujeniya
Last active October 18, 2024 10:06
Show Gist options
  • Save pishangujeniya/8b9267810094a9aadf4c525b35026036 to your computer and use it in GitHub Desktop.
Save pishangujeniya/8b9267810094a9aadf4c525b35026036 to your computer and use it in GitHub Desktop.
Mac OS Mojave Theme for Ubuntu
#!/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

Ubuntu To Mac OS Mojave theme

Mc OS Mojave Ubuntu Look alike


Pre-requisites

  • sudo apt update
  • sudo apt install gnome-tweaks
  • sudo apt-get install gir1.2-clutter-1.0 gir1.2-clutter-gst-3.0 gir1.2-gtkclutter-1.0
  • sudo apt install chrome-gnome-shell
  • Now try opening https://extensions.gnome.org/
  • If it is asking for browser extenion to be installed, then install the extension. chrome webstore link

Theme

  • Open Files or run command nautilus
  • Ctrl + H for showing hidden files.
  • Open Home Directory
  • Make new empty directory with name .themes in Home directory
  • Download this repository https://github.com/paullinuxthemer/Mc-OS-themes
  • Extract all directories into .themes directory
  • Now set the theme McOS-MJV from Tweaks > Appearance > Themes > Applications


Mc OS Mojave Ubuntu Look alike


Icons

Cursors

  • Download capitaine cursors from https://www.gnome-look.org/p/1148692 (source repository link)
  • Extract it to .icons directory
  • Now set the theme la-capitaine-cursors from Tweaks > Appearance > Themes > Cursor
  • Now increase the Cursor size by running this command gsettings set org.gnome.desktop.interface cursor-size 48

Extensions

Shell

  • Download XONE Catalina for XO.for.Dash.To.Dock from https://www.gnome-look.org/p/1213208 (source repository link) or link
  • Copy XO_Catalina from THEME directory from the downloaded file above to .themes directory
  • Select XO_Catalina in Tweaks > Appearance > Themes > Shell
  • Run the command gnome-shell --version to find the version of GNOME and keep in mind.

Fonts

  • Copy both the fonts file from FONT directory from the downloaded file above to ~/.local/share/fonts directory (its hidden directory in your home directory)
  • Select San Francisco Display Regular in Tweaks > Fonts > Window Title
  • Select San Francisco Display Bold in Tweaks > Fonts > Interface
  • Select San Francisco Display Regular in Tweaks > Fonts > Document

Dock

  • Dock Settings-

  • Run as, in terminal! one by one

  • Show Apps Button at Left

  • gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true

  • Disable Custom Dock Shrink

  • gsettings set org.gnome.shell.extensions.dash-to-dock custom-theme-shrink false

  • Change Dock Transparency mode

  • gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode DEFAULT

  • Disable Extend height!

  • gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false

  • Change Dock Position

  • gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM

  • NOTE-: if you have problem use this Restore to Default all settings.

  • dconf reset -f /org/gnome/shell/extensions/dash-to-dock/

Activities Configurator

  • Download logo .svg from here and copy to .icons directory.
  • Close and re-open Gnome Tweaks and enable the Activities Configurator extension from it.
  • Settings of Activities Configurator Select the logo .svg and Hide the Text

Wallpaper

  • Download Highest Resolution Wallper from here
  • Right Click > Set as Wallpaper

Minor Tweaks

  • Open Gnome Tweaks
  • Desktop > Turn on Home & Show Icons & Trash
  • Top Bar > Turn On Application Menu & Battery Percentage & Activities Overview Hot Corner & Date & Seconds
  • Windows > Titlebar Buttons > Placement > Left

Congratulations! Give a reboot...




Mc OS Mojave Ubuntu Look alike

@EngPeterShaker
Copy link

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/

@pishangujeniya
Copy link
Author

pishangujeniya commented May 6, 2021

Can anyone help me make a .sh for the above tasks? 😍

@pishangujeniya
Copy link
Author

New theme and shell for Ubuntu 22 https://www.gnome-look.org/p/1099856.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment