From 8530f64bc5689ea125c14408fce1e75607a54731 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 2 May 2014 14:11:27 -0700 Subject: [PATCH] using custom powerline conf for tmux. --- bootstrap.sh | 19 ------------------- .../powerline/colorschemes/tmux/default.json | 6 ------ .../config/powerline/themes/tmux/default.json | 3 +++ dotfiles/tmux.powerline | 16 ++++++++++++++++ setup.sh | 12 ++++++++++++ 5 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 dotfiles/tmux.powerline diff --git a/bootstrap.sh b/bootstrap.sh index c5f324fe..7fc3950b 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -2,24 +2,6 @@ cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles" -function make_powerline_symlinks() { - # Make a powerline link if powerline is installed - local powerline_location=$(pip show Powerline | grep Location | awk '{print $2}') - local conf_location="/powerline/bindings/tmux/powerline.conf" - local link_destination="$HOME/.tmux.powerline" - if test -z $powerline_location; - then - sudo pip install --user git+git://github.com/Lokaltog/powerline - fi - - if test -z $powerline_location; - then - rm $link_destination 2> /dev/null - touch "$link_destination" - else - ln -si "$powerline_location$conf_location" $link_destination - fi -} function symlink_dotfiles() { cd $DOTFILES_DIRECTORY @@ -35,7 +17,6 @@ function symlink_dotfiles() { ln -si $link_target $link_destination done [ -a ~/.dotfiles-backups.old ] && mv ~/.dotfiles-backups.old ~/.dotfiles-backups/.dotfiles-backups - make_powerline_symlinks } diff --git a/dotfiles/config/powerline/colorschemes/tmux/default.json b/dotfiles/config/powerline/colorschemes/tmux/default.json index c7360d1d..4d75b783 100644 --- a/dotfiles/config/powerline/colorschemes/tmux/default.json +++ b/dotfiles/config/powerline/colorschemes/tmux/default.json @@ -10,14 +10,8 @@ "email_alert_gradient": { "fg": "white", "bg": "yellow_orange_red", "attr": ["bold"] }, "hostname": { "fg": "black", "bg": "gray10", "attr": ["bold"] }, "weather": { "fg": "gray8", "bg": "gray0" }, - "weather_temp_gradient": { "fg": "blue_red", "bg": "gray0" }, - "weather_condition_hot": { "fg": "khaki1", "bg": "gray0" }, - "weather_condition_snowy": { "fg": "skyblue1", "bg": "gray0" }, - "weather_condition_rainy": { "fg": "skyblue1", "bg": "gray0" }, "uptime": { "fg": "gray8", "bg": "gray0" }, "external_ip": { "fg": "black", "bg": "gray1" }, - "network_load": { "fg": "gray8", "bg": "gray0" }, - "network_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0" }, "system_load": { "fg": "gray8", "bg": "gray0" }, "system_load_gradient": { "fg": "green_yellow_orange_red", "bg": "gray0" }, "cpu_load_percent": { "fg": "gray8", "bg": "gray0" }, diff --git a/dotfiles/config/powerline/themes/tmux/default.json b/dotfiles/config/powerline/themes/tmux/default.json index f880c9b9..d215ae84 100644 --- a/dotfiles/config/powerline/themes/tmux/default.json +++ b/dotfiles/config/powerline/themes/tmux/default.json @@ -35,6 +35,9 @@ "left": [ { "name": "external_ip" + }, + { + "name": "system_load" } ] } diff --git a/dotfiles/tmux.powerline b/dotfiles/tmux.powerline new file mode 100644 index 00000000..7c5b2ca6 --- /dev/null +++ b/dotfiles/tmux.powerline @@ -0,0 +1,16 @@ +if-shell 'test -z "$POWERLINE_COMMAND"' 'if-shell "which powerline-client" "set-environment -g POWERLINE_COMMAND powerline-client" "set-environment -g POWERLINE_COMMAND powerline"' +set -g status on +set -g status-utf8 on +set -g status-interval 2 +set -g status-fg colour231 +set -g status-bg colour234 +set -g status-left-length 150 +set -g status-left '#[fg=colour16,bg=colour254,bold] #S #[fg=colour254,bg=colour234,nobold]#(eval $POWERLINE_COMMAND tmux left)' +set -g status-right '#(eval $POWERLINE_COMMAND tmux right -R pane_id=`tmux display -p "#D"`)' +set -g status-right-length 150 +set -g window-status-format "#[fg=colour244,bg=colour234]#I #[fg=colour240] #[default]#W " +set -g window-status-current-format "#[fg=colour234,bg=colour31]#[fg=colour117,bg=colour31] #I  #[fg=colour231,bold]#W #[fg=colour31,bg=colour234,nobold]" +set-window-option -g window-status-fg colour249 +set-window-option -g window-status-activity-attr none +set-window-option -g window-status-activity-fg yellow +# vim: ft=tmux diff --git a/setup.sh b/setup.sh index 70c5f106..95329718 100755 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh source dotfiles/lib/shellrc/functions.sh + + case `uname` in 'Darwin') source resources/osx.sh @@ -11,4 +13,14 @@ case `uname` in ;; esac + +function install_powerline() { + hash pip 2>/dev/null || sudo easy_install pip + if test -z $(pip show Powerline | grep Location | awk '{print $2}'); + then + sudo pip install --user git+git://github.com/Lokaltog/powerline + fi +} + +install_powerline source bootstrap.sh