From c3c3f17770c8116e46f72b60b595cdb82673b9c1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 2 May 2014 01:26:54 -0700 Subject: [PATCH] Added some more powerline stuff. --- bootstrap.sh | 17 +++- dotfiles/lib/get_cols.awk | 9 +- dotfiles/lib/shellrc/functions.sh | 4 + dotfiles/tmux.conf | 5 +- resources/Monaco-Powerline.otf | Bin 249392 -> 247504 bytes resources/com.googlecode.iterm2.plist | 122 +++++++++++++------------- resources/powerline/tmux_theme.json | 44 ++++++++++ 7 files changed, 134 insertions(+), 67 deletions(-) create mode 100644 resources/powerline/tmux_theme.json 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 9b181abcbbb7fb268b8c4ff4766618ec71b94421..58953c08c95762044a362584af3ab3181628b658 100644 GIT binary patch delta 2525 zcmX|DdsGzn6~23Scb4Gt4z>zJd=Vo>dAU10tb-zo;$s(A5ZMSKEGo;x#0Q#Y=QL?G zMSLL=Pd(A2a(t{-$r_1@WZN1Q6*US(t*sa}mSa3kwT1}F?H!i(kGb>Bz4!a>V}5gX zkMHukUhTJKu;Y9N0Q`1JT3Yz`)75zZ0ZpLZ5t5cRZ&uHt(iNaSAIO>AG5fg9~tcXsSJb zO}S93XsM>N5lZvzg~`bgTW<~zy|e4i>_vXbFL00-M*yyUB8>Roy~bZ<)Kvq_1)x=_qpwpGiZUU+_wwWIl{u4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r2GgeW!uJW(y*wgV05IUIkaK>h7B7w{a!LfMJK`Jrm`!n>Mu=SHVD(% zqs5>S@h@XwqD@?exJs--TrE~3UM{|XxJIl&yh3~p@p^BGPe_Rn>&1F}wprZlebFa) zW1Zp>@p*Bn7%Rqz%S4Aa#V=G2cZl?ODJn2748e~M7>E!hmf-a%abDA2zc6xe3V^x= x#;RLXHoOwnt6O-h@{#Ys`|Szg0q^w_g3f#EgfPiF 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" + } + ] + } +}