Skip to content

Instantly share code, notes, and snippets.

@moshidev
Last active March 31, 2024 14:30
Show Gist options
  • Save moshidev/cb77d45e46d01278bcd593ae12b754dd to your computer and use it in GitHub Desktop.
Save moshidev/cb77d45e46d01278bcd593ae12b754dd to your computer and use it in GitHub Desktop.
script de instalación para mis macs
#!/bin/bash
# Based on https://github.com/naborisk/installers/blob/main/setup-macos.sh
HOSTNAME=m1
PACKAGES="mas wget tree gcc git cmake ninja rust nmap python3 binutils pandoc ansible cowsay vim gh vagrant ruby texlive yt-dlp imagemagick openjdk"
CASK_PACKAGES="slack font-fira-code-nerd-font obs visual-studio-code discord telegram firefox virtualbox affinity-photo affinity-designer affinity-publisher docker anki whatsapp steam gcc-arm-embedded vlc intel-power-gadget github vmware-fusion vagrant-vmware-utility wireshark"
#App list: Outlook Word Excel PowerPoint OneDrive Goodnotes MS-remote-desktop Ookla-speedtest Trello prime-video
MAS_APPS="985367838 462054704 462058435 462062816 823766827 1444383602 1295203466 1153157709 1278508951 545519333"
# install homebrew
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/daniel/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
else
brew update
fi
brew install $PACKAGES
brew tap homebrew/cask-fonts
# avoid cask quitting if application already installed
for P in $CASK_PACKAGES; do
brew install --cask $P
done
brew cleanup -s
# install Mac App Store apps
mas install $MAS_APPS
# set host-name if .zshrc does not have a PS1 asignment
grep PS1 .zshrc > /dev/null
if [[ $? != 0 ]] ; then
sudo scutil --set HostName $HOSTNAME
echo "PS1=\$""'"'%{\e[1m%}%{\e[38;5;202m%}%n%{\e[0m%}@%m %1~ %#' "'" >> .zshrc
fi
echo "set motd"
sudo bash -c "echo 今日も一日がんばるぞい! > /etc/motd"
echo "set default screenshot location"
mkdir $HOME/Desktop/Screenshots
defaults write com.apple.screencapture location $HOME/Desktop/Screenshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment