diff options
author | Mathias Bynens <mathias@qiwi.be> | 2011-09-17 08:40:11 +0200 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2011-09-17 08:40:11 +0200 |
commit | a4767da6801f91aae118662ef7d651d4baca40b5 (patch) | |
tree | 7db4a9c9e205027c6753327bb69e15c09913f8c0 | |
parent | 730c7f7084b0b09c18c018132abb90ec56c45579 (diff) | |
download | dotfiles-a4767da6801f91aae118662ef7d651d4baca40b5.tar.gz dotfiles-a4767da6801f91aae118662ef7d651d4baca40b5.tar.bz2 dotfiles-a4767da6801f91aae118662ef7d651d4baca40b5.zip |
Add aliases to show/hide hidden files in Finder. Closes #15.
-rw-r--r-- | .aliases | 4 | ||||
-rw-r--r-- | .bash_prompt | 51 |
2 files changed, 30 insertions, 25 deletions
@@ -44,6 +44,10 @@ alias fs="stat -f \"%z bytes\"" # ROT13-encode text. Works for decoding, too! ;) alias rot13='tr a-zA-Z n-za-mN-ZA-M' +# Show/hide hidden files in Finder +alias show="defaults write com.apple.Finder AppleShowAllFiles -bool true && killall Finder" +alias hide="defaults write com.apple.Finder AppleShowAllFiles -bool false && killall Finder" + # Disable Spotlight alias spotoff="sudo mdutil -a -i off" # Enable Spotlight diff --git a/.bash_prompt b/.bash_prompt index 764fdfc..639808d 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -6,36 +6,37 @@ elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color fi if tput setaf 1 &> /dev/null; then - tput sgr0 - if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then - MAGENTA=$(tput setaf 9) - ORANGE=$(tput setaf 172) - GREEN=$(tput setaf 190) - PURPLE=$(tput setaf 141) - WHITE=$(tput setaf 256) - else - MAGENTA=$(tput setaf 5) - ORANGE=$(tput setaf 4) - GREEN=$(tput setaf 2) - PURPLE=$(tput setaf 1) - WHITE=$(tput setaf 7) - fi - BOLD=$(tput bold) - RESET=$(tput sgr0) + tput sgr0 + if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then + MAGENTA=$(tput setaf 9) + ORANGE=$(tput setaf 172) + GREEN=$(tput setaf 190) + PURPLE=$(tput setaf 141) + WHITE=$(tput setaf 256) + else + MAGENTA=$(tput setaf 5) + ORANGE=$(tput setaf 4) + GREEN=$(tput setaf 2) + PURPLE=$(tput setaf 1) + WHITE=$(tput setaf 7) + fi + BOLD=$(tput bold) + RESET=$(tput sgr0) else - MAGENTA="\033[1;31m" - ORANGE="\033[1;33m" - GREEN="\033[1;32m" - PURPLE="\033[1;35m" - WHITE="\033[1;37m" - BOLD="" - RESET="\033[m" + MAGENTA="\033[1;31m" + ORANGE="\033[1;33m" + GREEN="\033[1;32m" + PURPLE="\033[1;35m" + WHITE="\033[1;37m" + BOLD="" + RESET="\033[m" fi -parse_git_dirty () { +function parse_git_dirty() { [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" } -parse_git_branch () { + +function parse_git_branch() { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" } |