using custom powerline conf for tmux.
This commit is contained in:
parent
cb06479d25
commit
8530f64bc5
19
bootstrap.sh
19
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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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" },
|
||||
|
@ -35,6 +35,9 @@
|
||||
"left": [
|
||||
{
|
||||
"name": "external_ip"
|
||||
},
|
||||
{
|
||||
"name": "system_load"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
16
dotfiles/tmux.powerline
Normal file
16
dotfiles/tmux.powerline
Normal file
@ -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
|
12
setup.sh
12
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
|
||||
|
Loading…
Reference in New Issue
Block a user