diff --git a/bootstrap.sh b/bootstrap.sh index 88d65632..b4e2d83a 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,21 @@ #!/usr/bin/env bash cd `dirname $BASH_SOURCE` && source resources/bootstrapping.sh DOTFILES_DIRECTORY="$(dotfiles_abspath)/dotfiles" -echo $DOTFILES_DIRECTORY + +function make_powerline_symlink() { + # 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" + sudo pip install --user git+git://github.com/Lokaltog/powerline + 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 @@ -18,6 +32,7 @@ function symlink_dotfiles() { ln -si $link_target $link_destination done [ -a ~/.dotfiles-backups.old ] && mv ~/.dotfiles-backups.old ~/.dotfiles-backups/.dotfiles-backups + make_powerline_symlink } diff --git a/dotfiles/lib/get_cols.awk b/dotfiles/lib/get_cols.awk index 8b1c8123..15eab57f 100644 --- a/dotfiles/lib/get_cols.awk +++ b/dotfiles/lib/get_cols.awk @@ -2,11 +2,14 @@ BEGIN{ column_count=split(cols,column_numbers," "); } - { + { for(i=1; i<=column_count; i++) if(column_numbers[i] < 0) - printf "%s%s", $(NF + 1 + column_numbers[i]), OFS + printf "%s", $(NF + 1 + column_numbers[i]) else - printf "%s%s", $column_numbers[i], OFS + printf "%s", $column_numbers[i] + if(i <= column_count) + printf "%s", OFS + printf "%s", ORS } diff --git a/dotfiles/lib/shellrc/functions.sh b/dotfiles/lib/shellrc/functions.sh index 7a80722d..cf61d4b0 100644 --- a/dotfiles/lib/shellrc/functions.sh +++ b/dotfiles/lib/shellrc/functions.sh @@ -182,3 +182,7 @@ function fix_brew_htop() { sudo chown root $(readlink -f `which htop`) sudo chmod 6555 `which htop` } + +function pip_package_location() { + pip show $1 | grep Location | get_cols 2 +} diff --git a/dotfiles/tmux.conf b/dotfiles/tmux.conf index 99e586e9..683bd8f5 100644 --- a/dotfiles/tmux.conf +++ b/dotfiles/tmux.conf @@ -11,11 +11,10 @@ set-option -g status-utf8 on set-option -g status-justify "centre" set-option -g status-left-length 60 set-option -g status-right-length 90 -set-option -g status-bg colour235 -set-option -g status-fg colour255 # Set up resize-pane keys bind-key + resize-pane -D 3 bind-key / resize-pane -L 3 bind-key - resize-pane -U 3 -bind-key * resize-pane -R 3 \ No newline at end of file +bind-key * resize-pane -R 3 +source ~/.tmux.powerline \ No newline at end of file diff --git a/resources/Monaco-Powerline.otf b/resources/Monaco-Powerline.otf index 9b181abc..58953c08 100644 Binary files a/resources/Monaco-Powerline.otf and b/resources/Monaco-Powerline.otf differ diff --git a/resources/com.googlecode.iterm2.plist b/resources/com.googlecode.iterm2.plist index 21997b49..e9191ef8 100644 --- a/resources/com.googlecode.iterm2.plist +++ b/resources/com.googlecode.iterm2.plist @@ -4707,6 +4707,8 @@ NSColorPanelMode 7 + NSFontPanelAttributes + 1, 0 NSNavLastRootDirectory ~ NSQuotedKeystrokeBinding @@ -4735,11 +4737,11 @@ NSWindow Frame NSColorPanel 427 366 214 309 0 0 1920 1080 NSWindow Frame Preferences - 432 463 924 485 0 0 1920 1080 + 917 389 924 485 0 0 1920 1058 NSWindow Frame SUStatusFrame 768 697 384 129 0 0 1920 1058 NSWindow Frame iTerm Window 0 - 301 254 585 401 0 0 1920 1058 + 219 538 490 301 0 0 1920 1058 NSWindow Frame iTerm Window 1 275 98 570 401 0 0 1920 1058 New Bookmarks @@ -4754,65 +4756,65 @@ Ansi 0 Color Blue Component - 0.0 + 0.30978870391845703 Green Component - 0.0 + 0.30978870391845703 Red Component - 0.0 + 0.30978870391845703 Ansi 1 Color Blue Component - 0.0 + 0.37647059559822083 Green Component - 0.14479698240756989 + 0.42352938652038574 Red Component - 0.66360294818878174 + 1 Ansi 10 Color Blue Component - 0.3333333432674408 + 0.67277032136917114 Green Component 1 Red Component - 0.3333333432674408 + 0.80941480398178101 Ansi 11 Color Blue Component - 0.00090433453442528844 + 0.79964911937713623 Green Component - 0.93554484844207764 + 1 Red Component 1 Ansi 12 Color Blue Component - 1 + 0.998260498046875 Green Component - 1 + 0.86277562379837036 Red Component - 0.0 + 0.7116503119468689 Ansi 13 Color Blue Component - 1 + 0.99652087688446045 Green Component - 0.3333333432674408 + 0.61330592632293701 Red Component 1 Ansi 14 Color Blue Component - 1 + 0.99703967571258545 Green Component - 1 + 0.87631028890609741 Red Component - 0.3333333432674408 + 0.87591361999511719 Ansi 15 Color @@ -4826,72 +4828,72 @@ Ansi 2 Color Blue Component - 0.0028098621405661106 + 0.37647059559822083 Green Component - 0.87563633918762207 + 1 Red Component - 0.001811038819141686 + 0.65882349014282227 Ansi 3 Color Blue Component - 0.0014849494909867644 + 0.7137255072593689 Green Component - 0.71715331077575684 + 1 Red Component - 0.7179722785949707 + 1 Ansi 4 Color Blue Component - 1 + 0.99607837200164795 Green Component - 0.40000000596046448 + 0.7960783839225769 Red Component - 0.40000000596046448 + 0.58823531866073608 Ansi 5 Color Blue Component - 0.73333334922790527 + 0.99215692281723022 Green Component - 0.0 + 0.45098039507865906 Red Component - 0.73333334922790527 + 1 Ansi 6 Color Blue Component - 0.73333334922790527 + 0.99607837200164795 Green Component - 0.73333334922790527 + 0.77254897356033325 Red Component - 0.0 + 0.7764706015586853 Ansi 7 Color Blue Component - 0.73333334922790527 + 0.93353170156478882 Green Component - 0.73333334922790527 + 0.93353170156478882 Red Component - 0.73333334922790527 + 0.93353170156478882 Ansi 8 Color Blue Component - 0.3333333432674408 + 0.48627451062202454 Green Component - 0.3333333432674408 + 0.48627451062202454 Red Component - 0.3333333432674408 + 0.48627451062202454 Ansi 9 Color Blue Component - 0.0 + 0.69019609689712524 Green Component - 0.08657381683588028 + 0.7137255072593689 Red Component 1 @@ -4902,11 +4904,11 @@ Background Color Blue Component - 0.10635251551866531 + 0.0 Green Component - 0.10635251551866531 + 0.0 Red Component - 0.10635251551866531 + 0.0 Background Image Is Tiled @@ -4942,11 +4944,11 @@ Cursor Color Blue Component - 0.73333334922790527 + 0.37647059559822083 Green Component - 0.73333334922790527 + 0.64705878496170044 Red Component - 0.73333334922790527 + 1 Cursor Text Color @@ -4976,11 +4978,11 @@ Foreground Color Blue Component - 0.90196079015731812 + 0.73333334922790527 Green Component - 0.90196079015731812 + 0.73333334922790527 Red Component - 0.90196079015731812 + 0.73333334922790527 Guid 3314520D-1E49-4605-AFCE-EA48A596636F @@ -5298,7 +5300,7 @@ Name Default Non Ascii Font - MonacoForPowerline 12 + UbuntuMonoDerivativePowerline-Regular 12 Non-ASCII Anti Aliased Normal Font @@ -5322,20 +5324,20 @@ Selected Text Color Blue Component - 0.0 + 0.94760048389434814 Green Component - 0.0 + 0.94760048389434814 Red Component - 0.0 + 0.94760048389434814 Selection Color Blue Component - 1 + 0.51530611515045166 Green Component - 1 + 0.22248570621013641 Red Component - 0.40000000596046448 + 0.20990739762783051 Semantic History @@ -5543,7 +5545,7 @@ SUHasLaunchedBefore SULastCheckTime - 2014-04-26T05:29:45Z + 2014-05-02T05:31:02Z SavePasteHistory Show Toolbelt diff --git a/resources/powerline/tmux_theme.json b/resources/powerline/tmux_theme.json new file mode 100644 index 00000000..be603a08 --- /dev/null +++ b/resources/powerline/tmux_theme.json @@ -0,0 +1,44 @@ +{ + "default_module": "powerline.segments.common", + "segment_data": { + "uptime": { + "before": "⇑ " + }, + "date": { + "before": "⌚ " + } + }, + "segments": { + "right": [ + { + "name": "system_load", + "priority": 50 + }, + { + "name": "uptime", + "priority": 50 + }, + { + "name": "date" + }, + { + "name": "date", + "args": { + "format": "%H:%M", + "istime": true + } + }, + { + "name": "hostname" + } + ], + "left": [ + { + "name": "external_ip" + }, + { + "name": "external_ip" + } + ] + } +}