Skip to content
Browse files

made ls coloring work

  • Loading branch information...
1 parent 3e75bb4 commit d978fb90bda8873244a543d804fc8ec8e014d8f4 @Soares committed Oct 14, 2012
Showing with 13 additions and 3 deletions.
  1. +13 −3 lib/solarized.zsh
View
16 lib/solarized.zsh
@@ -1,24 +1,34 @@
function light { set_theme "Solarized Light" }
function dark { set_theme "Solarized Dark" }
+
function set_theme {
if [[ $SYSTEM == "MAC" ]]; then
osascript -e "tell application \"Terminal\" to set current settings of window 1 to settings set \"$1\""
fi
if [[ $SYSTEM == "LINUX" ]]; then
- local TERMINAL_THEME=`cat $XDG_CACHE_DIR/terminal_theme`
+ TERMINAL_THEME=`cat $XDG_CACHE_HOME/terminal_theme`
if [[ $1 == $TERMINAL_THEME ]]; then; return; fi
+ # Reload the x resources only if necessary.
if [[ $1 == "Solarized Light" ]]; then
xrdb -DSOLARIZED_LIGHT -merge $XDG_CONFIG_HOME/X11/resources
- eval `dircolors $XDG_CONFIG_HOME/dircolors/ansi-light`
else
xrdb -DSOLARIZED_DARK -merge $XDG_CONFIG_HOME/X11/resources
- eval `dircolors $XDG_CONFIG_HOME/dircolors/ansi-dark`
fi
echo $1 > $XDG_CACHE_DIR/terminal_theme
killall urxvt
fi
}
+
+
+if [[ $SYSTEM == "LINUX" ]]; then
+ TERMINAL_THEME=`cat $XDG_CACHE_HOME/terminal_theme`
+ if [[ $TERMINAL_THEME == "Solarized Light" ]]; then
+ eval `dircolors $XDG_CONFIG_HOME/dircolors/ansi-light`
+ else
+ eval `dircolors $XDG_CONFIG_HOME/dircolors/256dark`
+ fi
+fi

0 comments on commit d978fb9

Please sign in to comment.
Something went wrong with that request. Please try again.