aboutsummaryrefslogtreecommitdiffstats
path: root/.osx
diff options
context:
space:
mode:
authorMarkus Amalthea Magnuson <markus.magnuson@gmail.com>2014-02-11 16:05:56 +0100
committerMathias Bynens <mathias@qiwi.be>2014-06-07 16:47:31 +0200
commit3ece8acdedb752c0def4c66fcf6c7c6f903f324c (patch)
tree4d355fcae884f55ae410fe5fb304a534fb67d015 /.osx
parent3b364cf01856642d17c4c99173d355c18dc34878 (diff)
downloaddotfiles-3ece8acdedb752c0def4c66fcf6c7c6f903f324c.tar.gz
dotfiles-3ece8acdedb752c0def4c66fcf6c7c6f903f324c.tar.bz2
dotfiles-3ece8acdedb752c0def4c66fcf6c7c6f903f324c.zip
.osx: Only install custom Terminal profile once
Closes #336 and #337.
Diffstat (limited to '.osx')
-rwxr-xr-x.osx12
1 files changed, 8 insertions, 4 deletions
diff --git a/.osx b/.osx
index 53416bf..27a5111 100755
--- a/.osx
+++ b/.osx
@@ -543,10 +543,14 @@ sudo mdutil -E / > /dev/null
defaults write com.apple.terminal StringEncodings -array 4
# Use a modified version of the Pro theme by default in Terminal.app
-open "${HOME}/init/Mathias.terminal"
-sleep 1 # Wait a bit to make sure the theme is loaded
-defaults write com.apple.terminal "Default Window Settings" -string "Mathias"
-defaults write com.apple.terminal "Startup Window Settings" -string "Mathias"
+TERM_PROFILE='Mathias';
+CURRENT_PROFILE="$(defaults read com.apple.terminal 'Default Window Settings')";
+if [ "${CURRENT_PROFILE}" != "${TERM_PROFILE}" ]; then
+ open "${HOME}/init/${TERM_PROFILE}.terminal";
+ sleep 1; # Wait a bit to make sure the theme is loaded
+ defaults write com.apple.terminal 'Default Window Settings' -string "${TERM_PROFILE}";
+ defaults write com.apple.terminal 'Startup Window Settings' -string "${TERM_PROFILE}";
+fi;
# Enable “focus follows mouse” for Terminal.app and all X11 apps
# i.e. hover over a window and start typing in it without clicking first