From bc966efe0b31441b0179c48b0e55a5f976cb286d Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Tue, 13 May 2014 15:58:09 +0300 Subject: [PATCH] bashrc & zshrc: convert osx-functions to aliases. defaults has sanity checks, I belive. --- bashrc | 25 ++++--------------------- zshrc | 27 ++++----------------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/bashrc b/bashrc index bf7e54f8..db7bdeb3 100644 --- a/bashrc +++ b/bashrc @@ -530,8 +530,11 @@ fi # Homebrew alias homebrew-install="mkdir -p ~/.local/bin;cd ~/.local;git clone https://github.com/Homebrew/homebrew.git;mkdir -p $HOME/.local/share/man/man1;ln -sf $HOME/.local/homebrew/bin/brew $HOME/.local/bin/brew;ln -sf $HOME/.local/homebrew/share/man/man1/brew.1 $HOME/.local/share/man/man1/brew.1;cd" -# OS X Server +# OS X alias osx-server-caching-interface="serveradmin settings caching:Interface =" +alias osx-show-hidden-files="defaults write com.apple.finder AppleShowAllFiles" +alias osx-airdrop-listenallif="defaults write com.apple.NetworkBrowser BrowseAllInterfaces" +alias osx-set-updatecheck="defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency" # Simple HTTPd with Python. alias python2-httpd="python -m SimpleHTTPServer" @@ -743,26 +746,6 @@ fi } -# Show hidden files in OS X. - -function osx-show-hidden-files { -defaults write com.apple.finder AppleShowAllFiles $USERCHOICE -echo "defaults write com.apple.finder AppleShowAllFiles $USERCHOICE" -} - -# Enable AirDrop on unsupported Macs + Ethernet. - -function osx-airdrop-listenall { -defaults write com.apple.NetworkBrowser BrowseAllInterfaces $USERCHOICE -echo "defaults write com.apple.NetworkBrowser BrowseAllInterfaces $USERCHOICE" -} - -# Check the time how often updates are checked on OS X. -function osx-set-updatecheck { -defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency $1 -echo "defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency $1" -} - # .custom if [ -f ~/.custom ]; then source ~/.custom diff --git a/zshrc b/zshrc index ef3663b7..2586fa69 100644 --- a/zshrc +++ b/zshrc @@ -503,8 +503,11 @@ fi # Homebrew alias homebrew-install="mkdir -p ~/.local/bin;cd ~/.local;git clone https://github.com/Homebrew/homebrew.git;mkdir -p $HOME/.local/share/man/man1;ln -sf $HOME/.local/homebrew/bin/brew $HOME/.local/bin/brew;ln -sf $HOME/.local/homebrew/share/man/man1/brew.1 $HOME/.local/share/man/man1/brew.1;cd" -# OS X Server +# OS X alias osx-server-caching-interface="serveradmin settings caching:Interface =" +lias osx-show-hidden-files="defaults write com.apple.finder AppleShowAllFiles" +alias osx-airdrop-listenallif="defaults write com.apple.NetworkBrowser BrowseAllInterfaces" +alias osx-set-updatecheck="defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency" # Simple HTTPd with Python. alias python2-httpd="python -m SimpleHTTPServer" @@ -714,28 +717,6 @@ fi } -# Show hidden files in OS X. - -function osx-show-hidden-files { -defaults write com.apple.finder AppleShowAllFiles $USERCHOICE -echo "defaults write com.apple.finder AppleShowAllFiles $USERCHOICE" -} - -# Enable AirDrop on unsupported Macs + Ethernet. - -function osx-airdrop-listenall { - -defaults write com.apple.NetworkBrowser BrowseAllInterfaces $USERCHOICE -echo "defaults write com.apple.NetworkBrowser BrowseAllInterfaces $USERCHOICE" -} - -# Check the time how often updates are checked on OS X. -function osx-set-updatecheck { -defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency $1 -echo "defaults write /Library/Preferences/com.apple.SoftwareUpdate ScheduleFrequency $1" -} - - # Source files for miscannellious modifications. # .custom