1  macOS full setup for Intel machines

1.1 Check and Update Apple ID

This helps with warranty repair and sharing among multiple Apple devices. It should be the first item in the list under  > System Settings…

1.2 Open Finder

Go to Settings > Advanced > Show all file extensions

1.3 Open System Settings

This is the first menu item on the Apple () menu.

  • keyboard > keyboard shortcuts > modifier keys > change caps-lock to ctrl
  • desktop and dock > automatically hide and show the dock
  • desktop and dock > automatically hide and show menubar on desktop (if no notch)
  • desktop and dock > change Magnification to Large
  • trackpad > More gestures > Swipe between pages > three fingers

1.4 Install XCode

Do this from the macOS app store, which is the third menu item under the Apple () menu.

Installation takes a million years! Make sure you have some time or can leave the computer running.

Be sure to open XCode after install to initialize and possibly to install command line utilities. (It used to make you install command line utilities but I already did that so I can’t tell if the current version is not making me do it because I have it installed or because it’s no longer required.)

1.5 Figure out your processor

Open  > About this Mac, and look under processor—if it says M1 or M2, you’re in the wrong file! Use the file macSetupM1Full for all the remaining instructions. To use this file, the processor entry should include the word Intel.

1.6 Install Homebrew

For this you will use the terminal. You can find the macOS default terminal by opening the Finder and navigating to /Applications/Utilities. There are many useful programs in that folder, arranged alphabetically. Navigate to Terminal.app and double click it.

Enter the following commands in the terminal. You should be able to copy and paste them from this list to avoid transcription errors.

Note that everything from a hashmark (#) to the end of the line is regarded as a comment and is not processed. I just include those comments for your information.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval $(/usr/local/bin/brew shellenv)
brew install bash # the shell that will process all your cli commands
sudo pico /etc/shells # add /usr/local/bin/bash to the list in that file
chsh -s /usr/local/bin/bash # makes bash the default shell
brew install quicksilver # simplifies opening programs
brew install iterm2 # terminal replacement; when our setup is complete we will use it instead of terminal
brew install hammerspoon # controls window placement on screen

1.7 Transfer dotfiles

If you are switching to a new machine, you may want to keep your old dotfiles, so that you get expected behaviors. If you don’t know what a dotfile is, you can skip this step and later look at the dotfiles module.

1.7.1 step 1 of 2 to transfer dotfiles:

Attach usb drive to old machine. Note that you must substitute the name of your usb drive below where it says <name of usb drive>. When you attach the usb drive to the machine, the usb drive’s name will appear in Finder under the Locations section.

/usr/local/bin/rsync -PUpavh ~/.??* /Volumes/<name of usb drive>

1.7.2 step 2 of 2 to transfer dotfiles:

attach usb drive to new machine

cd /Volumes/<name of usb drive>
/usr/local/bin/rsync -PUpavh ~/.??* ~/

1.8 Install Firefox

Then add tree style tabs under Tools > Add-ons and Themes.

1.9 Configure Firefox

Notice that in the following list of instructions, you have to substitute your current profile where it says <current profile>. This isn’t always easy since Firefox (in my experience) installs two profiles and you have to figure out which is actually yours. In my case, it is the one with the suffix .default-release. It has a vast number of files in it, as opposed to the single file in the other one.

  • Get userChrome.css from Canvas > Files > misc
  • Add userChrome.css to ~/Library/Application\ Support/Firefox/Profiles/<current profile>/chrome/
  • go to about:config and toggle the following setting to true: toolkit.legacyUserProfileCustomizations.stylesheets

The point of all this is to maximize vertical space available in Firefox windows. It puts the tabs into a tree on the left side of the window and takes away a bunch of the stuff at the top of the window.

1.10 Configure hammerspoon

Hammerspoon is a general purpose tool, but I just use it to control window placement. The window positions are as follows.

I hold down the Option and Command keys with my left thumb and the control key (formerly the caps-lock key) with my left pinky. Then, with my right forefinger, I press any of the following keys to move the current window into the desired position:

  • j — lower half of the display
  • k — upper half of the display
  • h — left half of the display
  • l — right half of the display
  • m — maximize the window
  • 1 — upper left quadrant
  • 2 — upper right quadrant
  • 3 — lower left quadrant
  • 4 — lower right quadrant
ls ~/.hammerspoon
#. if you get an error message, say:
mkdir ~/.hammerspoon
#. get the init.lua file from Canvas > Files > misc
cp -p init.lua ~/.hammerspoon/

1.11 Open quicksilver and configure

I use Quicksilver to open programs. Note that I never use the Apple Spotlight function, so I steal its key combination for Quicksilver, control-space. You can configure Quicksilver as you go along if it is not making the right suggestions for programs after you type a few characters. (Like Hammerspoon, Quicksilver is a general purpose tool and you can make much more of it than a program manager.)

  • Quicksilver > settings > Command, change to control-space
  • Quicksilver > settings > Appearance > Select interface > Bezel (built-in)
  • Quicksilver > settings > Appearance > check the box Superfluous visual effects

1.12 Install basic brew packages

This installation process is tedious but informative. If you prefer, there is a utility file in Canvas > Files > misc > basicBrewPackages.sh that does all of these at once. Beware, though, that you may miss important messages that way.

brew install python # keeps Python more up-to-date than native macOS python
pip3 install powerline-status # gives a better command prompt
brew install coreutils # replaces basic cli utilities with enhanced versions
brew install findutils # enhancements for the Unix find utility
brew install ruby # installs a more recent version of ruby than the native macOS version
gem install colorls # gives color-coded filenames when invoking ls
gem install github-pages # utilities for website building
brew install tmux # a terminal multiplexer
brew install rename # simplifies pattern renaming of files
brew install macvim # both gui and cli version of the vim editor
brew install pandoc # converts documents between platforms such as qmd, pdf, html, docx, epub, and more
pip3 install pandoc-include # enables including markdown documents in other markdown documents (not for Quarto, just plain markdown)
brew install pandoc-include-code # enables including program files in markdown documents (not for Quarto, just plain markdown)
brew install quarto # scientific document and presentation system
brew install trash # enables a command line trash function
brew install clipy # improves clipboard management
brew install saulpw/vd/visidata # cli csv file manager
brew install gnu-tar # improved archive management
brew install grep # improved regular expression search
brew install bib-tool # manages bibliography files created with bibtex or biblatex
brew install font-tex-gyre-schola # font used by quarto
brew install font-tex-gyre-schola-math # font used by quarto
brew install font-jetbrains-mono-nerd-font # font used by quarto

Most of these installations also install a man page or at least a help file. For example, you can say

man trash

to get information about the trash utility. The man pages have a specialized, hard-to-grasp format if you’re new to them, so you may want to check out the man module before making extensive use of them.

For those programs that have no man page, you can usually say <name of command> --help to get a help page. For instance, you can say

quarto --help

to get some brief help for using the cli version of Quarto. Of course, Quarto also has a web page at https://quarto.org/ that gives much more information about it.

1.13 Install optional brew packages

brew install exiftool # manages exif tags in image files
brew install cmus # cli music player
brew install poppler # required by some pdf tools
brew install imagemagick # command line image file management
brew install lynx # command line web browser, good at saving text of web pages
brew install buku # cli bookmark manager
brew install gfortran # required by many numerical manipulation programs
brew install libjpeg # required by man image manipulation programs
brew install ffmpeg # video file swiss army knife
brew install dict # access to online (mostly) English dictionaries
brew install bat # improved cli file viewing, aliased to cat in my .bash_profile
brew install distribution # provides a command line histogram
brew install gcal # a terminal calendar
brew install gcalcli # gives access to google calendar utilities from the command line
brew install bitwarden # password manager
brew install qlmarkdown # for viewing markdown files---must initialize by opening the app installed in /Applications/QLMarkdown.app
brew install automake # for configuring software
brew install --cask --no-quarantine syntax-highlight
brew install yt-dlp # to download youtube videos
brew install transmission-cli # to download torrents
brew install rar # to uncompress rar archives
brew install vldmrkl/formulae/airdrop-cli # to transfer files between apple devices
brew install postgresql@14 # database
brew install rsync # better file copying
brew install ranger # file manager
brew install gpg # to manage private / public key pairs
brew install xquartz # enables the X window system
brew install sc-im # a command-line spreadsheet program that can read excel files
brew install fzf # a fuzzy finder

1.14 Install texlive (takes hours!)

Use the instructions at https://tug.org/texlive/acquire-netinstall.html and the file called install-tl-unx.tar.gz.

The instructions at the time of this writing include the following. Note that the string 20230723 will differ based on the date of the version you’ve downloaded.

cd ~/Downloads
tar xvzf install-tl-unx.tar.gz
cd install-tl-20230723
./install-tl

After you are finished (hours later), if you are moving from an old machine that had texlive installed, use rsync to get texmf-local from your old machine to your new machine, e.g., for my machine on a local network, I say:

rsync -PUpavh /usr/local/texlive/texmf-local/ mcq@technicals-mbp.lan:"/usr/local/texlive/texmf-local/"

1.15 Fix ssh keys

This is basically a reminder for people switching machines. If you don’t have a github or gitlab account or some other account for which you use ssh keys, you can ignore this.

eval $(ssh-agent)
ssh-add

1.16 Install R and RStudio

  • Google the letter R. Usually, the first hit is the R project: https://www.r-project.org/

  • You have to choose a mirror to download from. I usually choose USA: National Institute for Computational Sciences, Oak Ridge, TN

  • Be sure to choose Intel X86 when given a choice

  • You will download a package installer. Double-click it in Finder and follow the instructions

  • Google RStudio. Usually, the first hit is Posit’s RStudio download site: https://posit.co/products/open-source/rstudio/

  • After clicking various links to download RStudio Desktop, you should eventually get to a page with the .dmg file to download. That page is https://posit.co/download/rstudio-desktop/ so you can visit it directly if you prefer. (I don’t know why they make you click through so many pages if you don’t have that URL!)

  • Download the .dmg file.

  • Double-click the .dmg file in the Finder. You should see a window with an Applications folder and the RStudio.app.

  • Drag the RStudio.app icon to the Applications folder. This is very important. If you try to open the RStudio.app icon from this window, you will not be able to save your work!

  • Eject the disk image that will appear in Finder that generates this window after RStudio.app is successfully added to your Applications folder.

1.17 Weekly maintenance

I usually put the following commands in a file called ~/weeklyMaintenance and sometimes run them as a group if I don’t want to look at the output of each one. More often, I run them individually and examine the output for items of interest, such as error messages or special package instructions.

brew update # updates brew's concept of what's available
brew upgrade # actually upgrades whatever brew now knows to be available
tlmgr update --all # updates TeXlive
pip-upgrade # upgrades Python packages
Rscript -e 'update.packages()' # upgrades R packages

Note that pip-upgrade is actually a shell function. Its definition is in my .bash_profile file, which can be found in Canvas > Files > misc. This command will not work without that definition.