Created
December 30, 2022 15:44
-
-
Save KasRoudra/06c1efd0e89cb383fbc9ebc4eda120ed to your computer and use it in GitHub Desktop.
Make your linux look like macos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Color snippets | |
black="\033[0;30m" | |
red="\033[0;31m" | |
bred="\033[1;31m" | |
green="\033[0;32m" | |
bgreen="\033[1;32m" | |
yellow="\033[0;33m" | |
byellow="\033[1;33m" | |
blue="\033[0;34m" | |
bblue="\033[1;34m" | |
purple="\033[0;35m" | |
bpurple="\033[1;35m" | |
cyan="\033[0;36m" | |
bcyan="\033[1;36m" | |
white="\033[0;37m" | |
nc="\033[00m" | |
cwd=$(pwd) | |
version="1.0" | |
logo=" | |
__ __ _ __ | |
| \/ | __ _ ___(_)/ _|_ _ | |
| |\/| |/ _' |/ __| | |_| | | | | |
| | | | (_| | (__| | _| |_| | | |
|_| |_|\__,_|\___|_|_| \__, | | |
|___/ | |
[v${version}] | |
[By KasRoudra] | |
" | |
declare -A tweaks=( | |
["gtk-theme"]="-m -l --normal --round -t all -N stable" | |
["icon-theme"]="-t all" | |
["cursors"]="" | |
["kde"]="" | |
["firefox-theme"]="-a" | |
) | |
declare -A tweak_settings=( | |
["gtk-theme"]="gsettings set org.gnome.desktop.interface gtk-theme 'WhiteSur-Light'" | |
["icon-theme"]="gsettings set org.gnome.desktop.interface icon-theme 'WhiteSur'" | |
["cursors"]="gsettings set org.gnome.desktop.interface cursor-theme 'WhiteSur-cursors'" | |
["kde"]="lookandfeeltool -a 'com.github.vinceliuice.WhiteSur-alt'" | |
["firefox-theme"]="", | |
) | |
declare -a extensions=( | |
"[email protected]" | |
"[email protected]" | |
"[email protected]" | |
"[email protected]" | |
"[email protected]" | |
"quick-settings-tweaks@qwreey" | |
) | |
info() { | |
echo -e "${yellow}[${white}+${yellow}] ${cyan}${1}${nc}" | |
sleep 1 | |
} | |
info2() { | |
echo -e "${green}[${white}+${green}] ${purple}${1}${nc}" | |
sleep 1 | |
} | |
success() { | |
echo -e "${cyan}[${white}✔${cyan}] ${green}${1}${nc}" | |
sleep 1 | |
} | |
error() { | |
echo -e "${blue}[${white}✘${blue}] ${red}${1}${nc}" | |
sleep 1 | |
} | |
isInstalled() { | |
package="$1" | |
if command -v "$package" &> /dev/null; then | |
echo true | |
else | |
echo false | |
fi | |
} | |
banner() { | |
clear | |
if $(isInstalled lolcat); then | |
echo -e "$logo" | lolcat | |
else | |
echo -e "$logo" | |
fi | |
} | |
tweaker() { | |
repo="$1" | |
options="$2" | |
mkdir -p "${cwd}/WhiteSur" | |
if [[ ! -z "$repo" && ! -d "${cwd}/WhiteSur/WhiteSur-${repo}" ]]; then | |
info "Downloading WhiteSur-${repo}..." | |
git clone "https://github.com/vinceliuice/WhiteSur-${repo}" "${cwd}/WhiteSur/WhiteSur-${repo}" | |
fi | |
cd "${cwd}/WhiteSur/WhiteSur-${repo}" | |
./install.sh $options | |
settings="${tweak_settings[$repo]}" | |
if ! [ -z "$settings" ]; then | |
bash -c "${tweak_settings[$repo]}" | |
fi | |
} | |
extensioner() { | |
uuid="$1" | |
mkdir -p "${cwd}/extensions" | |
if ! [ -d "$HOME/.local/share/gnome-shell/extensions/${uuid}" ] && ! echo "$uuid" | grep -q "gnome-shell-extensions."; then | |
name=$(echo "$uuid" | cut -d "@" -f1) | |
info "Downloading ${name} extension..." | |
ext_version=$(curl -Lfs "https://extensions.gnome.org/extension-query/?search=$uuid" | jq '.extensions[0] | .shell_version_map | map(.pk) | max' | head -n1) | |
wget -q --show-progress "https://extensions.gnome.org/download-extension/${uuid}.shell-extension.zip?version_tag=$ext_version" -O "${cwd}/extensions/${uuid}.zip" | |
gnome-extensions install --force "${cwd}/extensions/${uuid}.zip" | |
fi | |
if ! gnome-extensions list | grep -q "${uuid}"; then | |
busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s "${uuid}" | |
fi | |
gnome-extensions enable "${uuid}" | |
} | |
extensioner2() { | |
uuid="$1" | |
repo="$2" | |
installed=$(gsettings get org.gnome.shell enabled-extensions) | |
if [[ ! -z "$repo" && ! -d "$HOME/.local/share/gnome-shell/extensions/${uuid}" ]]; then | |
name=$(echo "$uuid" | cut -d "@" -f1) | |
info "Downloading ${name} extension..." | |
git clone "https://github.com/${repo}" "$HOME/.local/share/gnome-shell/extensions/${uuid}" | |
fi | |
if echo "$installed" | grep -q "$uuid"; then | |
return | |
fi | |
if echo "$installed" | grep -Eq "^@as"; then | |
array="['$uuid']" | |
else | |
array=$(echo "$installed" | sed s/"]"/", '$uuid']"/) | |
fi | |
gsettings set org.gnome.shell enabled-extensions "$array" | |
} | |
wallpaper() { | |
if [[ ! -z "$repo" && ! -d "${cwd}/WhiteSur/WhiteSur-wallpapers" ]]; then | |
info "Downloading WhiteSur-Wallpapers..." | |
git clone "https://github.com/vinceliuice/WhiteSur-wallpapers" "${cwd}/WhiteSur/WhiteSur-wallpapers" | |
fi | |
cd "${cwd}/WhiteSur/WhiteSur-wallpapers" | |
./install-wallpapers.sh | |
gsettings set org.gnome.desktop.background picture-uri "file://$HOME/.local/share/backgrounds/WhiteSur-light.png" | |
gsettings set org.gnome.desktop.screensaver picture-uri "file://$HOME/.local/share/backgrounds/WhiteSur-light.png" | |
info "You'll find other wallpapers in ${green} '$HOME/.local/share/backgrounds'..." | |
} | |
additional() { | |
gsettings set org.gnome.shell.extensions.user-theme name "WhiteSur-Light" | |
gsettings set org.gtk.Settings.FileChooser sidebar-width 178 | |
gsettings set org.gtk.Settings.FileChooser window-position "(174, 28)" | |
gsettings set org.gtk.gtk4.Settings.FileChooser show-hidden true | |
gsettings set org.gnome.nautilus.preferences migrated-gtk-settings true | |
gsettings set org.gnome.desktop.wm.preferences button-layout "close,minimize,maximize:icon" | |
gsettings set org.gnome.desktop.notifications application-children "['gnome-network-panel', 'org-gnome-nautilus', 'org-manjaro-pamac-manager', 'firefox', 'org-gnome-console', 'org-gnome-shell-extensions', 'org-gnome-tweaks']" | |
} | |
usage() { | |
echo -e " | |
Usage: | |
./$0 [-s,--exclude gtk-theme|icon-theme|cursors|kde|firefox-theme|wallpaper|additional|cupertino] | |
Example: | |
./$0 | |
./$0 --exclude cursors | |
./$0 -x kde -x firefox-theme | |
" | |
} | |
main () { | |
exclude="" | |
script="$0" | |
while [[ "$#" -gt 0 ]]; do | |
case $1 in | |
--exclude|-x) | |
exclude="$2 $exclude" | |
shift | |
;; | |
--help|-h) | |
usage $script | |
exit 0 | |
;; | |
--version|-v) | |
info "${version}" | |
exit 0 | |
;; | |
*) | |
error "Unknown command $1!" | |
usage $script | |
exit 1 | |
;; | |
esac | |
shift | |
done | |
banner | |
for tweak in "${!tweaks[@]}"; do | |
if echo "$exclude" | grep -q "$tweak"; then | |
continue | |
fi | |
tweaker "$tweak" "${tweaks[$tweak]}" | |
done | |
for extension in "${extensions[@]}"; do | |
if echo "$exclude" | grep -q "$extension"; then | |
continue | |
fi | |
extensioner "$extension" | |
done | |
if ! echo "$exclude" | grep -q "wallpaper"; then | |
info "Setting up wallpaper..." | |
wallpaper | |
fi | |
if ! echo "$exclude" | grep -q "cupertino"; then | |
mkdir -p $HOME/.icons | |
info "Downloading Cupertino-iCons..." | |
git clone https://github.com/USBA/Cupertino-iCons $HOME/.icons/Cupertino-iCons | |
gsettings set org.gnome.desktop.interface icon-theme 'Cupertino-iCons' | |
fi | |
if ! echo "$exclude" | grep -q "additional"; then | |
additional | |
fi | |
} | |
main $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment