├── README.md ├── classic_folders.command ├── example.png ├── icons.zip ├── test.command └── trash /README.md: -------------------------------------------------------------------------------- 1 | # Classic Folders 2 | This script replaces OSX folder icons with the ones from Mavericks. 3 | 4 | Submit issues [here](https://github.com/w0lfschild/classic_Yose/issues/new). 5 | 6 | ![Preview](example.png) 7 | 8 | ### Information: 9 | **Note**: I did not create the icons. 10 | **Note**: This may break in the future. 11 | 12 | Currently confirmed working on OSX: 13 | **10.10** (14A389) to **10.11** (15A178w) 14 | 15 | ### How to use: 16 | Download and run classic_folders.command then restart. 17 | 18 | 1. Download the latest release here : https://github.com/w0lfschild/classic_Yose/releases/latest 19 | 2. Unzip the download 20 | 3. Open classic_folders.command 21 | 4. Follow instructions printed to terminal window 22 | 23 | ### License: 24 | Pretty much the BSD license, just don't repackage it and call it your own please! 25 | 26 | Also if you do make some changes, feel free to make a pull request and help make things more awesome! 27 | -------------------------------------------------------------------------------- /classic_folders.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # -- Basic Information -- 4 | # 5 | # Maintained By : Wolfgang Baird 6 | # Version : 1.2 7 | # Updated : Jun / 11 / 2015 8 | # Icons : © Apple Inc. 9 | # 10 | # -- Basic Information -- 11 | 12 | my_dl() { 13 | curl -\# -L -o "$appsupport_dir"/icns.zip "https://raw.githubusercontent.com/w0lfschild/classic_Yose/master/icons.zip" 2> /tmp/updateTracker & 14 | pids="$pids $!" 15 | wait_for_process $pids 16 | } 17 | wait_for_process() { 18 | dlp="Downloading" 19 | local i=0 20 | local errors=0 21 | while :; do 22 | debug "Processes remaining: $*" 23 | for pid in "$@"; do 24 | shift 25 | if kill -0 "$pid" 2>/dev/null; then 26 | debug "$pid is still alive." 27 | set -- "$@" "$pid" 28 | if [[ $i = 3 ]]; then i=0; printf "\b\b\b \b\b\b"; fi 29 | ((i++)) 30 | output=$(tail -n 1 /tmp/updateTracker) 31 | output=${output##* } 32 | if [[ "$output" == *"%" ]]; then 33 | output=$output% 34 | fi 35 | if [[ $num = 0 ]]; then 36 | dlp=". $output" 37 | num=1 38 | elif [[ $num = 1 ]]; then 39 | dlp=".. $output" 40 | num=2 41 | else 42 | dlp="... $output" 43 | num=0 44 | fi 45 | printf "\r$key_word$dlp" 2> /dev/null 46 | elif wait "$pid"; then 47 | debug "$pid exited with zero exit status." 48 | printf "\r$key_word... 100%% \n" 49 | sleep 1 50 | else 51 | debug "$pid exited with non-zero exit status." 52 | printf "\n" 53 | ((++errors)) 54 | fi 55 | done 56 | (("$#" > 0)) || break 57 | sleep ${WAITALL_DELAY:-.1} 58 | done 59 | ((errors == 0)) 60 | rm -f /tmp/updateTracker 61 | } 62 | debug() { 63 | echo "DEBUG: $*" >/dev/null 64 | } 65 | internet_check() { 66 | echo "DO STUFF" 67 | } 68 | vercomp() { 69 | if [[ $1 == $2 ]] 70 | then 71 | return 0 72 | fi 73 | local IFS=. 74 | local i ver1=($1) ver2=($2) 75 | # fill empty fields in ver1 with zeros 76 | for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) 77 | do 78 | ver1[i]=0 79 | done 80 | for ((i=0; i<${#ver1[@]}; i++)) 81 | do 82 | if [[ -z ${ver2[i]} ]] 83 | then 84 | # fill empty fields in ver2 with zeros 85 | ver2[i]=0 86 | fi 87 | if ((10#${ver1[i]} > 10#${ver2[i]})) 88 | then 89 | return 1 90 | fi 91 | if ((10#${ver1[i]} < 10#${ver2[i]})) 92 | then 93 | return 2 94 | fi 95 | done 96 | return 0 97 | } 98 | verres() { 99 | vercomp "$1" "$2" 100 | case $? in 101 | 0) output='=';; 102 | 1) output='>';; 103 | 2) output='<';; 104 | esac 105 | echo $output 106 | } 107 | 108 | BG='\033[40m' # BLACK BACKGROUND 109 | RB='\033[0;31m\033[40m' # RED 110 | GN='\033[0;32m\033[40m' # GREEN 111 | OR='\033[1;33m\033[40m' # ORANGE 112 | WT='\033[0;37m\033[40m' # WHITE 113 | PU='\033[0;35m\033[40m' # PURPLE 114 | NC='\033[0m' # NO COLOR 115 | 116 | move_icons=1 117 | key_word="${WT}Fetching icons${GN}" 118 | appsupport_dir="$HOME"/Library/Application\ Support/ycf 119 | 120 | # OSX version & Rootless check 121 | OSX_version=$(sw_vers -productVersion) 122 | OSX_version=$(verres 10.11 $OSX_version) 123 | if [[ $OSX_version != "<" ]]; then 124 | nvram_bootargs=$(nvram boot-args) 125 | are_we_rootless=0 126 | if [[ "$nvram_bootargs" = *"rootless=0"* ]]; then are_we_rootless=1; fi 127 | fi 128 | 129 | # Clear terminal window 130 | printf "${BG}" 131 | clear && printf '\e[3J' 132 | 133 | # Print basic information 134 | printf "\ 135 | ${WT}About : ${RB}Classic Folders\n\ 136 | ${WT}Author : ${RB}Wolfgang Baird\n\ 137 | ${WT}Version : ${RB}1.2\n\ 138 | ${WT}Updated : ${RB}Jun / 11 / 2015\n\ 139 | ${WT}Changes : ${RB}El Capitan support (Rootless bypass), Misc fixes, Colored output 140 | ${WT}Icons : ${RB}© Apple Inc.\n\n\ 141 | ${OR}This script requires that you enter your ${GN}password${OR} to continue.\n\ 142 | You won't see your ${GN}password${OR} as you type it.\n\ 143 | Press return once you've finished typing your ${GN}password${OR}.\n\n" 144 | 145 | # Ask for password 146 | sudo -v 147 | 148 | if [[ $OSX_version != "<" ]]; then 149 | if [[ "$are_we_rootless" = "0" ]]; then 150 | printf "\ 151 | ${PU}Classic Folders ${WT}has determined that ${RB}Rootless ${WT}is currently enabled on your system. 152 | Unfortunately this will prevent ${PU}Classic Folders ${WT}from doing anything. 153 | You have ${GN}two${WT} options: 154 | 155 | ${GN}y${WT}: To continue and disable ${RB}Rootless ${WT}enter '${GN}y${WT}' and press return. 156 | This will cause your system to reboot. 157 | You will need to run ${PU}Classic Folders ${WT}again after your System reboots. 158 | 159 | ${GN}n${WT}: To cancel and do nothing enter '${GN}n${WT}' and press return. 160 | This will close ${PU}Classic Folders ${WT}and nothing will be changed. 161 | 162 | Disable ${RB}Rootless ${WT}(${GN}y${WT}/${GN}n${WT}): " 163 | read res_me0 164 | if [[ $res_me0 = "y" ]]; then 165 | # Add rootless=0 to nvram boot-args and reboot 166 | ba=$(nvram boot-args | sed -E "s/boot-args|rootless=.//g") 167 | sudo nvram boot-args="rootless=0$(if [[ $ba = *[!\ ]* ]];then printf " ";echo ${ba[*]};fi)" 168 | # sudo reboot 169 | else 170 | exit 171 | fi 172 | fi 173 | fi 174 | 175 | # Get trash script 176 | # curl -\# -L -o "$appsupport_dir"/trash "https://github.com/w0lfschild/classic_Yose/blob/master/trash?raw=true" 177 | # chmod 755 "$appsupport_dir"/trash 178 | # printf "\n" 179 | 180 | # Get icons 181 | if [[ ! -e "$appsupport_dir"/icons ]]; then mkdir -p "$appsupport_dir"/icons; fi 182 | if [[ ! -e "$appsupport_dir"/icns.zip ]]; then 183 | # echo -e "Fetching icons" 184 | # curl -\# -L -o "$appsupport_dir"/icns.zip "https://raw.githubusercontent.com/w0lfschild/classic_Yose/master/icons.zip" 185 | my_dl 186 | unzip "$appsupport_dir"/icns.zip -d "$appsupport_dir"/icons >/dev/null 187 | fi 188 | 189 | # Check for backup 190 | if [[ ! -e /System/Library/CoreServices/.CoreTypes.bundle.old ]]; then 191 | # Backup existing CoreTypes 192 | printf "${WT}Backing up ${RB}CoreTypes ${GN}to \"/System/Library/CoreServices/.CoreTypes.bundle.old\"\n" 193 | sudo cp -r /System/Library/CoreServices/CoreTypes.bundle /System/Library/CoreServices/.CoreTypes.bundle.old 194 | else 195 | printf "\n${OR}CoreTypes ${RB}Backup Detected!\n${WT}Would you like to ${GN}restore ${WT}from it now? (${GN}y${WT}/${GN}n${WT}): " 196 | read res_me 197 | if [[ $res_me = "y" ]]; then 198 | move_icons=0 199 | printf "${GN}Restoring ${WT}from ${OR}CoreTypes ${WT}backup${NC}\n" 200 | sudo rm -rf /System/Library/CoreServices/CoreTypes.bundle 201 | sudo mv /System/Library/CoreServices/.CoreTypes.bundle.old /System/Library/CoreServices/CoreTypes.bundle 202 | else 203 | printf "${RB}Overwrite ${WT}existing backup? ${WT}(${GN}y${WT}/${GN}n${WT}): " 204 | read res_me1 205 | if [[ $res_me1 = "y" ]]; then 206 | sudo cp -rf /System/Library/CoreServices/CoreTypes.bundle /System/Library/CoreServices/.CoreTypes.bundle.old 207 | fi 208 | fi 209 | fi 210 | 211 | # Moving icons 212 | if [[ $move_icons = 1 ]]; then 213 | printf "${WT}Moving icons ${GN}to \"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources\"\n" 214 | sudo cp -rf "$appsupport_dir"/icons/ /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ 215 | fi 216 | 217 | # Clear icon caches 218 | printf "${WT}Clearing icon ${OR}caches\n" 219 | sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; 2>/dev/null 220 | sudo find /private/var/folders/ -name com.apple.iconservices -exec rm -rf {} \; 2>/dev/null 221 | osascript -e "tell application \"Finder\"" -e "delete POSIX file \"/Library/Caches/com.apple.iconservices.store\"" -e "End Tell" &>/dev/null 222 | # sudo "$appsupport_dir"/trash /Library/Caches/com.apple.iconservices.store 223 | 224 | # Prompt for reboot 225 | printf " 226 | ${OR}Done!\n\n\ 227 | Now all you need to do is ${RB}reboot${OR} for changes to take effect.\n\ 228 | Would you like to ${RB}reboot${OR} now? ${WT}(${GN}y${WT}/${GN}n${WT}): " 229 | read rb_now 230 | printf "${NC}\n" 231 | if [[ $rb_now = "y" ]]; then sudo reboot; fi 232 | -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/ClassicFolders/9221de592915aee3eb11dc471db95645e97bc566/example.png -------------------------------------------------------------------------------- /icons.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/ClassicFolders/9221de592915aee3eb11dc471db95645e97bc566/icons.zip -------------------------------------------------------------------------------- /test.command: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Notes 4 | # 0 = standard 5 | # 1 = bold 6 | # 30 - 37 text 7 | # 40 - 47 background 8 | # 9 | # Black 0;30 10 | # Blue 0;34 11 | # Green 0;32 12 | # Cyan 0;36 13 | # Red 0;31 14 | # Purple 0;35 15 | # Brown/Orange 0;33 16 | # Light Gray 0;37 17 | # 18 | 19 | # printf "I ${RED}love${NC} Stack Overflow\n" 20 | 21 | download_wprogress() { 22 | curl -\# -L -o /tmp/"$applicationName".zip "$downloadURL" 2> /tmp/updateTracker & 23 | pids="$pids $!" 24 | wait_for_process $pids 25 | } 26 | my_dl() { 27 | curl -\# -L -o /Users/w0lf/Desktop/icns.zip "https://raw.githubusercontent.com/w0lfschild/classic_Yose/master/icons.zip" 2> /tmp/updateTracker & 28 | pids="$pids $!" 29 | wait_for_process $pids 30 | } 31 | wait_for_process() { 32 | dlp="Downloading" 33 | local i=0 34 | local errors=0 35 | while :; do 36 | debug "Processes remaining: $*" 37 | for pid in "$@"; do 38 | shift 39 | if kill -0 "$pid" 2>/dev/null; then 40 | debug "$pid is still alive." 41 | set -- "$@" "$pid" 42 | if [[ $i = 3 ]]; then i=0; printf "\b\b\b \b\b\b"; fi 43 | ((i++)) 44 | output=$(tail -n 1 /tmp/updateTracker) 45 | output=${output##* } 46 | if [[ "$output" == *"%" ]]; then 47 | output=$output% 48 | fi 49 | if [[ $num = 0 ]]; then 50 | dlp=". $output" 51 | num=1 52 | elif [[ $num = 1 ]]; then 53 | dlp=".. $output" 54 | num=2 55 | else 56 | dlp="... $output" 57 | num=0 58 | fi 59 | printf "\r$key_word$dlp" 2> /dev/null 60 | elif wait "$pid"; then 61 | debug "$pid exited with zero exit status." 62 | printf "\r$key_word... 100%% \n" 63 | sleep 1 64 | else 65 | debug "$pid exited with non-zero exit status." 66 | printf "\n" 67 | ((++errors)) 68 | fi 69 | done 70 | (("$#" > 0)) || break 71 | sleep ${WAITALL_DELAY:-.1} 72 | done 73 | ((errors == 0)) 74 | rm -f /tmp/updateTracker 75 | } 76 | debug() { 77 | echo "DEBUG: $*" >/dev/null 78 | } 79 | the_happening() { 80 | i=0 81 | printf "\r$1" 82 | while [[ $i < 4 ]] 83 | do 84 | if [[ $i = 3 ]]; then i=0; printf "\b\b\b \b\b\b"; fi 85 | ((i++)) 86 | printf "." 87 | sleep 0.5 88 | done 89 | } 90 | 91 | BG='\033[40m' 92 | RB='\033[0;31m\033[40m' 93 | GN='\033[0;32m\033[40m' 94 | OR='\033[1;33m\033[40m' 95 | WT='\033[0;37m\033[40m' 96 | PU='\033[0;35m\033[40m' 97 | NC='\033[0m' # No Color 98 | 99 | printf "${BG}" 100 | clear && printf '\e[3J' 101 | 102 | printf "\ 103 | ${WT}About : ${RB}Classic Folders\n\ 104 | ${WT}Author : ${RB}Wolfgang Baird\n\ 105 | ${WT}Version : ${RB}1.2\n\ 106 | ${WT}Updated : ${RB}Jun / 11 / 2015\n\ 107 | ${WT}Changes : ${RB}El Capitan support (Rootless bypass), Misc fixes, Colored output 108 | ${WT}Icons : ${RB}© Apple Inc.\n\n\ 109 | ${OR}This script requires that you enter your ${GN}password${OR} to continue.\n\ 110 | You won't see your ${GN}password${OR} as you type it.\n\ 111 | Press return once you've finished typing your ${GN}password${OR}.\n\n" 112 | 113 | printf "\ 114 | ${PU}Classic Folders ${WT}has determined that ${RB}Rootless ${WT}is currently enabled on your system. 115 | Unfortunately this will prevent ${PU}Classic Folders ${WT}from doing anything. 116 | You have ${GN}two${WT} options: 117 | 118 | ${GN}y${WT}: To continue and disable ${RB}Rootless ${WT}enter '${GN}y${WT}' and press return. 119 | This will cause your system to reboot. 120 | You will need to run ${PU}Classic Folders ${WT}again after your System reboots. 121 | 122 | ${GN}n${WT}: To cancel and do nothing enter '${GN}n${WT}' and press return. 123 | This will close ${PU}Classic Folders ${WT}and nothing will be changed. 124 | 125 | Disable ${RB}Rootless ${WT}(${GN}y${WT}/${GN}n${WT}): \n\n" 126 | 127 | key_word="${BG}${WT}Fetching icons${GN}" 128 | my_dl 129 | 130 | printf "${WT}Backing up ${OR}CoreTypes ${GN}to \"/System/Library/CoreServices/.CoreTypes.bundle.old\"\n" 131 | printf "${WT}Moving icons ${GN}to \"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources\"\n" 132 | printf "${WT}Clearing icon ${OR}caches\n" 133 | 134 | printf "\n${OR}CoreTypes ${RB}Backup Detected!\n\ 135 | ${WT}Would you like to ${GN}restore ${WT}from it now? (${GN}y${WT}/${GN}n${WT}): \n" 136 | printf "${GN}Restoring ${WT}from ${OR}CoreTypes ${WT}backup\n" 137 | printf "${RB}Overwrite ${WT}existing backup? ${WT}(${GN}y${WT}/${GN}n${WT}): \n" 138 | printf "${WT}Moving icons ${GN}to \"/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources\"\n" 139 | printf "${WT}Clearing icon ${OR}caches\n\n" 140 | 141 | printf "${OR}Done!\n\n\ 142 | Now all you need to do is ${RB}reboot${OR} for changes to take effect.\n\ 143 | Would you like to ${RB}reboot${OR} now? ${WT}(${GN}y${WT}/${GN}n${WT}): " 144 | 145 | printf "${NC}\n" -------------------------------------------------------------------------------- /trash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/w0lfschild/ClassicFolders/9221de592915aee3eb11dc471db95645e97bc566/trash --------------------------------------------------------------------------------