Skip to content

Instantly share code, notes, and snippets.

@mattpolicastro
Created August 22, 2022 00:14
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 mattpolicastro/98e526e1656c7b0ce3f0c7bda1fa3278 to your computer and use it in GitHub Desktop.
Save mattpolicastro/98e526e1656c7b0ce3f0c7bda1fa3278 to your computer and use it in GitHub Desktop.
Quick script for switching Dock orientation based on a target process running or not. (In this case, Rstudio.)
#!/bin/bash
PROCESS_NAME=RStudio
if pgrep $PROCESS_NAME; then
echo running
defaults write com.apple.dock orientation left
else
echo not running
defaults write com.apple.dock orientation bottom
fi
killall Dock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment