Last active
August 29, 2015 14:06
-
-
Save soutar/593a927aab9b1be6249b to your computer and use it in GitHub Desktop.
Add x spacers to your Dock in Mac OS X (./add_spacer.sh x)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function add_spacer { | |
| [[ $1 =~ ^[0-9]+$ ]] && times=$1 || times=1 | |
| echo "Adding $times spacer(s)" | |
| i=0; | |
| while [[ $i -lt $times ]]; do | |
| defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' | |
| ((i++)) | |
| done | |
| echo "Killing Dock..." | |
| sleep 2 # Wait for something or other or the spacers won't appear | |
| killall Dock | |
| } | |
| add_spacer $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation instructions:
git clone https://gist.github.com/593a927aab9b1be6249b.gitmv 593a927aab9b1be6249b/add_spacer.sh /usr/local/bin/add_spacerchmod +x /usr/local/bin/add_spacer