From 1f6f09e4571457c7568b22c305faa862569ec115 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sat, 29 Sep 2012 18:50:23 -0500 Subject: [PATCH 1/5] Added unread mail count to tmux pane Unread mail count comes from an AppleScript that asks Mail.app --- bin/{itunes.applescript => itunes.scpt} | 0 bin/mail.scpt | 65 +++++++++++++++++++++++ bin/{rdio.applescript => rdio.scpt} | 0 bin/{spotify.applescript => spotify.scpt} | 0 tmux/tmux.conf.symlink | 26 ++++----- 5 files changed, 78 insertions(+), 13 deletions(-) rename bin/{itunes.applescript => itunes.scpt} (100%) mode change 100644 => 100755 create mode 100755 bin/mail.scpt rename bin/{rdio.applescript => rdio.scpt} (100%) mode change 100644 => 100755 rename bin/{spotify.applescript => spotify.scpt} (100%) mode change 100644 => 100755 diff --git a/bin/itunes.applescript b/bin/itunes.scpt old mode 100644 new mode 100755 similarity index 100% rename from bin/itunes.applescript rename to bin/itunes.scpt diff --git a/bin/mail.scpt b/bin/mail.scpt new file mode 100755 index 0000000..d18d753 --- /dev/null +++ b/bin/mail.scpt @@ -0,0 +1,65 @@ +#!/usr/bin/osascript +property defaultAccount : "Pollen" +property defaultMailbox : "INBOX" + +on run args + set justUnread to false + set theAccount to missing value + set theMailbox to missing value + + if defaultAccount = missing value then set defaultAccount to "-g" + if defaultMailbox = missing value then set defaultMailbox to "INBOX" + + set theCount to the count of args + + if theCount > 0 then + if item 1 of args = "-u" then + set justUnread to true + set theCount to theCount - 1 + set args to the rest of args + else if item 1 of args = "-ug" or item 1 of args = "-gu" then + set justUnread to true + set item 1 of args to "-g" + else if theCount > 1 and ¬ + item 1 of args = "-g" and item 2 of args = "-u" then + set justUnread to true + set theCount to theCount - 1 + set args to the rest of args + set item 1 of args to "-g" + end if + end if + + tell application "Mail" + if theCount = 0 then + set theAccount to defaultAccount + set theMailbox to defaultMailbox + else if theCount = 1 then + set theAccount to item 1 of args + set theMailbox to defaultMailbox + else if theCount = 2 then + set theAccount to item 1 of args + set theMailbox to item 2 of args + else + error character id 10 ¬ + & "Usage: inbox-count [-u] [[account] mailbox]" & character id 10 ¬ + & " inbox-count [-u] -g [mailbox]" + end if + + set mailboxValue to missing value + if theAccount = "-g" then + if theMailbox = "INBOX" then + set mailboxValue to inbox + else + set mailboxValue to mailbox theMailbox + end if + else + set mailboxValue to mailbox theMailbox of account theAccount + end if + + if justUnread then + return the unread count of mailboxValue + else + return the count of messages of mailboxValue + end if + end tell +end run diff --git a/bin/rdio.applescript b/bin/rdio.scpt old mode 100644 new mode 100755 similarity index 100% rename from bin/rdio.applescript rename to bin/rdio.scpt diff --git a/bin/spotify.applescript b/bin/spotify.scpt old mode 100644 new mode 100755 similarity index 100% rename from bin/spotify.applescript rename to bin/spotify.scpt diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink index 15d813d..9b9bfc6 100644 --- a/tmux/tmux.conf.symlink +++ b/tmux/tmux.conf.symlink @@ -101,7 +101,7 @@ bind -t vi-copy 'y' copy-selection #### COLOUR # default statusbar colors -set-option -g status-bg colour234 +set-option -g status-bg colour232 set-option -g status-fg colour26 set-option -g status-attr default @@ -120,7 +120,7 @@ set-option -g pane-border-fg colour245 set-option -g pane-active-border-fg colour240 # message text -set-option -g message-bg colour234 +set-option -g message-bg colour232 set-option -g message-fg colour26 # pane number display @@ -134,23 +134,23 @@ set-window-option -g clock-mode-colour colour26 #### Plugins ##### ################## -# current Spotify track -spotify_track='#[fg=colour2]#(osascript ~/.dotfiles/bin/spotify.applescript)' -# current iTunes track -itunes_track='#[fg=colour27]#(osascript ~/.dotfiles/bin/itunes.applescript)' -# current Rdio track -rdio_track='#[fg=colour127]#(osascript ~/.dotfiles/bin/rdio.applescript)' +tm_spotify_track='#[fg=colour2]#(osascript ~/.dotfiles/bin/spotify.applescript)' +tm_itunes_track='#[fg=colour27]#(osascript ~/.dotfiles/bin/itunes.applescript)' +tm_rdio_track='#[fg=colour127]#(osascript ~/.dotfiles/bin/rdio.applescript)' tm_date='#[fg=colour245] %R %d %b' -tm_host='#[fg=colour198,bg=colour234,bold]#h' +tm_host='#[fg=colour198,bg=colour232,bold]#h' +tm_session_name='#[fg=colour198,bg=colour232,bold] ❤ #S' +tm_mail='#[fg=colour196,bold]✉ #(~/.dotfiles/bin/mail.scpt -ug)' set -g status-left-length 32 set -g status-right-length 150 set -g status-interval 20 -set -g window-status-format "#[fg=colour239,bg=colour234] #I #W " +set -g window-status-format "#[fg=colour239,bg=colour232] #I #W " -set -g window-status-current-format "#[fg=colour234,bg=colour26]#[fg=colour16,bg=colour26,noreverse,bold] #I #W #[fg=colour26,bg=colour234,nobold]" -set -g status-left '#[fg=colour198,bg=colour234,bold] #S' -set -g status-right $itunes_track' '$spotify_track' '$tm_date' '$tm_host +# set -g window-status-current-format "#[fg=colour232,bg=colour26]#[fg=colour16,bg=colour26,noreverse,bold] #I #W #[fg=colour26,bg=colour232,nobold]" +set -g window-status-current-format "#[fg=colour232,bg=colour26]#[fg=colour16,bg=colour26,noreverse,bold] #I #W #[fg=colour26,bg=colour232,nobold]" +set -g status-left $tm_session_name +set -g status-right $tm_itunes_track' '$tm_spotify_track' '$tm_mail' '$tm_date' '$tm_host From eb4d1cf9f91209c3c22c4a00ef3e310fa2c0c40b Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sun, 30 Sep 2012 17:08:40 -0500 Subject: [PATCH 2/5] renaming ir_black to ir_whack and setting as theme --- vim/vim.symlink/colors/{ir_black.vim => ir_whack.vim} | 0 vim/vimrc.symlink | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename vim/vim.symlink/colors/{ir_black.vim => ir_whack.vim} (100%) diff --git a/vim/vim.symlink/colors/ir_black.vim b/vim/vim.symlink/colors/ir_whack.vim similarity index 100% rename from vim/vim.symlink/colors/ir_black.vim rename to vim/vim.symlink/colors/ir_whack.vim diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink index 11af46c..219c222 100644 --- a/vim/vimrc.symlink +++ b/vim/vimrc.symlink @@ -114,7 +114,7 @@ set tm=500 syntax on set background=dark -colorscheme smyck +colorscheme ir_whack " set number " show line numbers set relativenumber " show relative line numbers From 662576ec74f03ba4872e80dc35a7a80c30219ed8 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Sun, 30 Sep 2012 17:11:31 -0500 Subject: [PATCH 3/5] changing tmux refresh interval to 5 seconds --- tmux/tmux.conf.symlink | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink index 9b9bfc6..f73ad8f 100644 --- a/tmux/tmux.conf.symlink +++ b/tmux/tmux.conf.symlink @@ -145,7 +145,7 @@ tm_mail='#[fg=colour196,bold]✉ #(~/.dotfiles/bin/mail.scpt -ug)' set -g status-left-length 32 set -g status-right-length 150 -set -g status-interval 20 +set -g status-interval 5 set -g window-status-format "#[fg=colour239,bg=colour232] #I #W " From d889c18aee5e7a3c48e4e1149e0cc3342b62ff44 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Mon, 1 Oct 2012 11:19:53 -0500 Subject: [PATCH 4/5] Added /usr/local/sbin to PATH --- zsh/zshrc.symlink | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zsh/zshrc.symlink b/zsh/zshrc.symlink index 939f3a6..7a55f80 100644 --- a/zsh/zshrc.symlink +++ b/zsh/zshrc.symlink @@ -28,6 +28,11 @@ if [[ -d ~/.rvm ]]; then source ~/.rvm/scripts/rvm fi +# add /usr/local/sbin +if [[ -d /usr/local/sbin ]]; then + export PATH=/usr/local/sbin:$PATH +fi + # check for custom bin directory and add to path if [[ -d ~/bin ]]; then export PATH=~/bin:$PATH From 153ceef2cfc102b8f29be5abe58e8e5735a25604 Mon Sep 17 00:00:00 2001 From: Nick Nisi Date: Mon, 1 Oct 2012 13:59:40 -0500 Subject: [PATCH 5/5] Fixing naming issue applescripts were renamed with .scpt extensions. Updating tmux.conf to reflect this --- tmux/tmux.conf.symlink | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tmux/tmux.conf.symlink b/tmux/tmux.conf.symlink index f73ad8f..70650c4 100644 --- a/tmux/tmux.conf.symlink +++ b/tmux/tmux.conf.symlink @@ -134,9 +134,9 @@ set-window-option -g clock-mode-colour colour26 #### Plugins ##### ################## -tm_spotify_track='#[fg=colour2]#(osascript ~/.dotfiles/bin/spotify.applescript)' -tm_itunes_track='#[fg=colour27]#(osascript ~/.dotfiles/bin/itunes.applescript)' -tm_rdio_track='#[fg=colour127]#(osascript ~/.dotfiles/bin/rdio.applescript)' +tm_spotify_track='#[fg=colour2]#(osascript ~/.dotfiles/bin/spotify.scpt)' +tm_itunes_track='#[fg=colour27]#(osascript ~/.dotfiles/bin/itunes.scpt)' +tm_rdio_track='#[fg=colour127]#(osascript ~/.dotfiles/bin/rdio.scpt)' tm_date='#[fg=colour245] %R %d %b' tm_host='#[fg=colour198,bg=colour232,bold]#h'