Created
May 4, 2014 12:37
-
-
Save kvannotten/0014369e0061c2054e05 to your computer and use it in GitHub Desktop.
Toggle OSx dock's mutability
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
#!/usr/bin/env ruby | |
# get current state | |
immutable = `defaults read com.apple.dock contents-immutable`.to_i == 1 | |
# toggle the state | |
immutable = !immutable | |
# write the state | |
`defaults write com.apple.dock contents-immutable -bool #{immutable ? "YES" : "NO"}` | |
`defaults write com.apple.dock size-immutable -bool #{immutable ? "YES" : "NO"}` | |
# kill the dock application | |
`killall Dock` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment