Skip to content

Instantly share code, notes, and snippets.

@loranger
Created May 16, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loranger/2fbcb9f9cc88ec64aaa1d7646a05b2c7 to your computer and use it in GitHub Desktop.
Save loranger/2fbcb9f9cc88ec64aaa1d7646a05b2c7 to your computer and use it in GitHub Desktop.
Script d'install
#!/bin/sh
## Homebrew
if test ! $(which brew)
then
echo 'Installation de Homebrew'
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
brew update
echo 'Installation de Cask'
brew tap caskroom/cask
if [ ! -d ~/Dropbox ]; then
echo "Dropbox doit être installé ET synchronisé";
echo 'Installation de Dropbox'
brew cask install dropbox
open -a /Applications/Dropbox.app/
exit;
fi
echo 'Installation de mas (Mac App Store)'
brew install mas
echo "Saisir le mail du compte iTunes :"
read COMPTE
echo "Saisir le mot de passe du compte : $COMPTE"
read -s PASSWORD
mas signin $COMPTE "$PASSWORD"
# Installation d'apps avec mas (source : https://github.com/argon/mas/issues/41#issuecomment-245846651)
function install () {
mas list | grep -i "$1" > /dev/null
if [ "$?" == 0 ]; then
echo "==> $1 est déjà installé(e)"
else
echo "==> Installation de $1..."
mas search "$1" | { read app_ident app_name ; mas install $app_ident ; }
fi
}
echo 'Installation de Homebrew-bundle'
brew tap Homebrew/bundle
# brew install bundle
echo 'Installation de Mackup'
brew install mackup
cp ~/Dropbox/OSX/mackup/.mackup.cfg ~/.mackup.cfg
cp -R ~/Dropbox/OSX/mackup/.mackup ~/.mackup
echo 'Restauration des applications sauvegardées'
cp ~/Dropbox/OSX/mackup/.Brewfile ~/.Brewfile
brew bundle --global
echo 'Restauration des préférences sauvegardées'
mackup restore --force
## ************************* CONFIGURATION ********************************
echo "Configuration de quelques paramètres par défaut…"
## FINDER
# Affichage de la bibliothèque
# chflags nohidden ~/Library
# Finder : affichage de la barre latérale / affichage par défaut en mode liste (ou colonne) / affichage chemin accès / extensions toujours affichées
defaults write com.apple.finder ShowStatusBar -bool true
# defaults write com.apple.finder FXPreferredViewStyle -string “Nlsv” # Liste
defaults write com.apple.finder FXPreferredViewStyle -string “clmv” # Colonne
defaults write com.apple.finder ShowPathbar -bool true
# sudo defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Afficher le dossier maison par défaut
# defaults write com.apple.finder NewWindowTarget -string "PfHm"
# defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
# Recherche dans le dossier en cours par défaut
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
# Coup d'œîl : sélection de texte
defaults write com.apple.finder QLEnableTextSelection -bool true
# Pas de création de fichiers .DS_STORE
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
## RÉGLAGES DOCK
# Taille du texte au minimum
defaults write com.apple.dock tilesize -int 15
# Agrandissement actif
defaults write com.apple.dock magnification -bool true
# Taille maximale pour l'agrandissement
defaults write com.apple.dock largesize -float 128
## MISSION CONTROL
# Pas d'organisation des bureaux en fonction des apps ouvertes
# defaults write com.apple.dock mru-spaces -bool false
# Mot de passe demandé immédiatement quand l'économiseur d'écran s'active
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
## COINS ACTIFS
# En haut à gauche : bureau
# defaults write com.apple.dock wvous-tl-corner -int 4
# defaults write com.apple.dock wvous-tl-modifier -int 0
# En haut à droite : bureau
# defaults write com.apple.dock wvous-tr-corner -int 4
# defaults write com.apple.dock wvous-tr-modifier -int 0
# En bas à gauche : fenêtres de l'application
# defaults write com.apple.dock wvous-bl-corner -int 3
# defaults write com.apple.dock wvous-bl-modifier -int 0
# En bas à droite : Mission Control
# defaults write com.apple.dock wvous-br-corner -int 2
# defaults write com.apple.dock wvous-br-modifier -int 0
## CLAVIER ET TRACKPAD
# Accès au clavier complet (tabulation dans les boîtes de dialogue)
# defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Arrêt pop-up clavier façon iOS
sudo defaults write -g ApplePressAndHoldEnabled -bool false
# Répétition touches plus rapide (defaut 12)
# sudo defaults write NSGlobalDomain KeyRepeat -int 1
# Délai avant répétition des touches
# sudo defaults write NSGlobalDomain InitialKeyRepeat -int 10
# Alertes sonores quand on modifie le volume
# sudo defaults write com.apple.systemsound com.apple.sound.beep.volume -float 1
# Réglages Trackpad : toucher pour cliquer
# sudo defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
# sudo defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
## APPS
# Safari : menu développeur / URL en bas à gauche / URL complète en haut / Do Not Track / affichage barre favoris
defaults write com.apple.safari IncludeDevelopMenu -int 1
defaults write com.apple.safari ShowOverlayStatusBar -int 1
defaults write com.apple.safari ShowFullURLInSmartSearchField -int 1
defaults write com.apple.safari SendDoNotTrackHTTPHeader -int 1
defaults write com.apple.Safari ShowFavoritesBar -bool true
# Photos : pas d'affichage pour les iPhone
# defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool YES
# TextEdit : .txt par défaut
defaults write com.apple.TextEdit RichText -int 0
# Raccourci pour exporter
# sudo defaults write -g NSUserKeyEquivalents '{"Export…"="@$e";"Exporter…"="@$e";}'
## ************ Fin de l'installation *********
echo "Finder et Dock relancés… redémarrage nécessaire pour terminer."
killall Dock
killall Finder
echo "Derniers nettoyages…"
brew cleanup
rm -f -r /Library/Caches/Homebrew/*
echo "INSTALLATION TERMINÉE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment