Commits

Woojong Koh committed 7316598

Sync (huge!)

Comments (0)

Files changed (26)

 	ui = true
 [credential]
 	helper = osxkeychain
+[difftool "Kaleidoscope"]
+	cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
+[diff]
+	tool = Kaleidoscope
+[difftool]
+	prompt = false
+[mergetool "Kaleidoscope"]
+	cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
+	trustExitCode = true
+[mergetool]
+	prompt = false
+[merge]
+	tool = Kaleidoscope
 .weechat/irc.conf
 .weechat/logs/
 .weechat/weechat.log
+.virtualenvs/
 
 [extensions]
 hgext.mercurial_keyring = ~/.hgext/mercurial_keyring/mercurial_keyring.py
+
+[hooks]
+commit = hg_commithook.sh
+
+[extdiff]
+cmd.ksdiff = /usr/local/bin/ksdiff
+opts.ksdiff = --changeset --wait --filelist
+
+[ui]
+merge = Kaleidoscope
+
+[merge-tools]
+Kaleidoscope.executable = /usr/local/bin/ksdiff
+Kaleidoscope.args = --merge --output $output --base $base -- $local $other
 .vim/bundle/vim-colors-solarized = [git]https://github.com/altercation/vim-colors-solarized.git
 .vim/bundle/vim-commentary = [git]https://github.com/tpope/vim-commentary.git
 .vim/bundle/vim-easymotion = [git]https://github.com/Lokaltog/vim-easymotion.git
+.vim/bundle/vim-eunuch = [git]https://github.com/tpope/vim-eunuch.git
 .vim/bundle/vim-indent-object = [git]https://github.com/michaeljsmith/vim-indent-object.git
 .vim/bundle/vim-pathogen = [git]https://github.com/tpope/vim-pathogen.git
 .vim/bundle/vim-powerline = [git]https://github.com/Lokaltog/vim-powerline.git
+.vim/bundle/vim-repeat = [git]https://github.com/tpope/vim-repeat.git
+.vim/bundle/vim-unimpaired = [git]https://github.com/tpope/vim-unimpaired.git
 .oh-my-zsh = [git]https://github.com/robbyrussell/oh-my-zsh.git
+tmux-powerline = [git]https://github.com/erikw/tmux-powerline.git
 
 .hgext/hgbb = https://bitbucket.org/birkenfeld/hgbb
 .hgext/mercurial_keyring = https://bitbucket.org/Mekk/mercurial_keyring
 528a59f26d12278698bb946f8fb82a63711eec21 .vim/bundle/vim-colors-solarized
 dc349bb7d30f713d770fc1fa0fe209e6aab82dc8 .vim/bundle/vim-commentary
 667a668e114e9ec0e5d4cbcb0962d835b23614c4 .vim/bundle/vim-easymotion
+6a4d1933ad61ad94f2fa06905337a51cb0304ac1 .vim/bundle/vim-eunuch
 78fffa609b3e6b84ef01ee4c9aba6d7435d7b18e .vim/bundle/vim-indent-object
 96b5726ef3135effd54993e52c773718fb69a95d .vim/bundle/vim-pathogen
 20ab08c9a8fe6cdfb7c303aa3063f211d72f8b2f .vim/bundle/vim-powerline
+a81bef76031ca1c71766b516417480caeb01c932 .vim/bundle/vim-repeat
+48d1cb6bf0000159291014226d8d8d3330ad875e .vim/bundle/vim-unimpaired
+808e2dd079f8a922a21b6311a33a4cb358106eef tmux-powerline
 # YOU NEED TO INSTALL "reattach-to-user-namespace" FIRST.
-# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/
+# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/ or sudo port install tmux-pasteboard
 
 set-option -g prefix C-a
 unbind-key C-b
 bind - split-window -v
 
 set -g default-terminal "screen-256color"
-set -g lock-after-time 1800
+#set -g lock-after-time 1800
 set -g mouse-resize-pane on
 set -g mouse-select-pane on
 set -g mouse-select-window on
 set -s escape-time 0
 
 # Set status bar
-set -g status-bg black
-set -g status-fg white
+#set -g status-bg black
+#set -g status-fg white
 #set -g status-left ""
-set -g status-right "#[fg=green]#H#[default]"
+#set -g status-right "#[fg=green]#H#[default]"
 
 # Rather than constraining window size to the maximum size of any client 
 # connected to the *session*, constrain window size to the maximum size of any 
 #set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"
 
 # Highlight active window
-set-window-option -g window-status-current-bg red
+#set-window-option -g window-status-current-bg red
 #####################################################################
 
 set -g history-limit 10000
+
+
+# tmux-powerline
+set-option -g status on
+set-option -g status-interval 2
+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-left "#(~/tmux-powerline/powerline.sh left)"
+set-option -g status-right "#(~/tmux-powerline/powerline.sh right)"
+set-window-option -g window-status-current-format "#[fg=colour235, bg=colour27]⮀#[fg=colour255, bg=colour27] #I ⮁ #W #[fg=colour27, bg=colour235]⮀"
+
+bind C-c run "tmux show-buffer | reattach-to-user-namespace pbcopy"
 set autowrite
 set backup
 set undofile
-set noswapfile
+"set noswapfile
 set backupdir=~/.vim/tmp/backup//   " include full path
 set undodir=~/.vim/tmp/undo//
 
 autocmd CursorMovedI,InsertLeave * if pumvisible() == 0 | pclose | endif
 
 
+" Python-mode
 let g:pymode_breakpoint_key = '<leader>pb'
 let g:pymode_rope = 0
 let g:pymode_rope_guess_project = 0
 let g:pymode_lint_cwindow = 1
 let g:pymode_folding = 0
+
+
+" Powerline
+let g:Powerline_symbols = 'fancy'
+
+
+" Marked & DayOne
+command! Marked :silent !open -a Marked "%:p"
+command! DayOne execute ':w !dayone new' | set buftype=nowrite

.weechat/alias.conf

 #
-# alias.conf -- WeeChat v0.3.9
+# alias.conf -- weechat v0.4.0
 #
 
 [cmd]

.weechat/aspell.conf

 #
-# aspell.conf -- WeeChat v0.3.9
+# aspell.conf -- weechat v0.4.0
 #
 
 [look]
 during_search = off
 enabled = off
 real_time = off
+suggestions = -1
 word_min_length = 2
 
 [dict]

.weechat/buffers.conf

 #
-# buffers.conf -- WeeChat v0.3.9
+# buffers.conf -- weechat v0.4.0
 #
 
 [color]
 [look]
 core_to_front = off
 detach = 0
+detach_free_content = off
+detach_query = off
 hide_merged_buffers = none
+hotlist_counter = off
 immune_detach_buffers = ""
 indenting = off
 indenting_number = on
 jump_prev_next_visited_buffer = off
+mark_inactive = off
 name_crop_suffix = "+"
 name_size_max = 0
 number_char = "."

.weechat/charset.conf

 #
-# charset.conf -- WeeChat v0.3.9
+# charset.conf -- weechat v0.4.0
 #
 
 [default]

.weechat/logger.conf

 #
-# logger.conf -- WeeChat v0.3.9
+# logger.conf -- weechat v0.4.0
 #
 
 [look]

.weechat/perl/buffers.pl

 #
 # History:
 #
+# 2012-10-18, nils_2@freenode.#weechat:
+#     v3.8: add option "mark_inactive", to mark buffers you are not in (idea by xrdodrx)
+#         : add wildcard "*" for immune_detach_buffers (idea by StarWeaver)
+#         : add new options "detach_query" and "detach_free_content" (idea by StarWeaver)
+# 2012-10-06, Nei <anti.teamidiot.de>:
+#     v3.7: call menu on right mouse if menu script is loaded.
+# 2012-10-06, nils_2 <weechatter@arcor.de>:
+#     v3.6: add new option "hotlist_counter" (idea by torque).
 # 2012-06-02, nils_2 <weechatter@arcor.de>:
 #     v3.5: add values "server|channel|private|all|keepserver|none" to option "hide_merged_buffers" (suggested by dominikh).
 # 2012-05-25, nils_2 <weechatter@arcor.de>:
 use strict;
 use Encode qw( decode encode );
 # -------------------------------[ internal ]-------------------------------------
-my $version = "3.5";
+my $version = "3.8";
 
 my $BUFFERS_CONFIG_FILE_NAME = "buffers";
 my $buffers_config_file;
 my $cmd_buffers_detach   = "buffers_detach";
 
 my %mouse_keys          = ("\@item(buffers):button1*"    => "hsignal:buffers_mouse",     # catch all left mouse button gestures
-                           "\@item(buffers):button2"     => "hsignal:buffers_mouse");    # catch right mouse button
+                           "\@item(buffers):button2*"     => "hsignal:buffers_mouse");    # catch all right mouse button gestures
 my %options;
 my %hotlist_level       = (0 => "low", 1 => "message", 2 => "private", 3 => "highlight");
 my @whitelist_buffers   = ();
 weechat::hook_signal("buffer_*", "buffers_signal_buffer", "");
 weechat::hook_signal("window_switch", "buffers_signal_buffer", "");
 weechat::hook_signal("hotlist_*", "buffers_signal_hotlist", "");
+weechat::hook_signal("window_switch", "buffers_signal_buffer", "");
+#weechat::hook_command_run("/input switch_active_*", "buffers_signal_buffer", "");
 weechat::bar_item_update("buffers");
 if ($weechat_version >= 0x00030600)
 {
                         "del %-||".
                         "reset %-",
                         "buffers_cmd_whitelist", "");
-
 weechat::hook_command(  $cmd_buffers_detach,
                         "add/del current buffer to/from buffers detach",
                         "[add] || [del] || [reset]",
 
 my %default_options_look =
 (
+ "hotlist_counter"      =>      ["hotlist_counter","boolean","show number of message for the buffer (this option needs WeeChat >= 0.3.5). The relevant option for notification is \"weechat.look.buffer_notify_default\"","",0,0,"off","off",0,"","","buffers_signal_config","","",""],
  "show_lag"             =>      ["show_lag","boolean","show lag behind servername. This option is using \"irc.color.item_lag_finished\", \"irc.network.lag_min_show\" and \"irc.network.lag_refresh_interval\"","",0,0,"off","off",0,"","","buffers_signal_config","","",""],
  "look_whitelist_buffers" =>    ["whitelist_buffers", "string", "comma separated list of buffers for using a differnt color scheme (for example: freenode.#weechat,freenode.#weechat-fr)", "", 0, 0,"", "", 0, "", "", "buffers_signal_config_whitelist", "", "", ""],
  "hide_merged_buffers"  =>      ["hide_merged_buffers", "integer", "hide merged buffers. The value determines which merged buffers should be hidden, keepserver meaning 'all except server buffers'. Other values correspondent to the buffer type.", "server|channel|private|keepserver|all|none", 0, 0,"none", "none", 0, "", "", "buffers_signal_config", "", "", ""],
  "name_size_max"        =>      ["name_size_max","integer","maximum size of buffer name. 0 means no limitation","",0,256,0,0,0, "", "", "buffers_signal_config", "", "", ""],
  "name_crop_suffix"     =>      ["name_crop_suffix","string","contains an optional char(s) that is appended when buffer name is shortened","",0,0,"+","+",0,"","","buffers_signal_config", "", "", ""],
  "detach"               =>      ["detach", "integer","detach channel from buffers list after a specific period of time (in seconds) without action (weechat ≥ 0.3.8 required)", "", 0, 31536000,0, "number", 0, "", "", "buffers_signal_config", "", "", ""],
- "immune_detach_buffers" =>     ["immune_detach_buffers", "string", "comma separated list of buffers which will not get detached automatically. Good with e.g. BitlBee", "", 0, 0,"", "", 0, "", "", "buffers_signal_config_immune_detach_buffers", "", "", ""],
+ "immune_detach_buffers"=>      ["immune_detach_buffers", "string", "Comma seperated list of buffers to NOT automatically detatch. Allows \"*\" wildcard. Ex: \"BitlBee,freenode.*\"", "", 0, 0,"", "", 0, "", "", "buffers_signal_config_immune_detach_buffers", "", "", ""],
+ "detach_query"         =>      ["detach_query", "boolean", "query buffer will be detachted", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "detach_free_content"  =>      ["detach_free_content", "boolean", "buffers with free content will be detached (Ex: iset, chanmon)", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
+ "mark_inactive"        =>      ["mark_inactive", "boolean", "if option is \"on\", inactive buffers (those you are not in) will have parentesis around them. An inactive buffer will not be detached.", "", 0, 0,"off", "off", 0, "", "", "buffers_signal_config", "", "", ""],
 );
     # section "color"
     my $section_color = weechat::config_new_section($buffers_config_file,"color", 0, 0, "", "", "", "", "", "", "", "", "", "");
     {
         $hotlist{weechat::infolist_pointer($infolist, "buffer_pointer")} =
             weechat::infolist_integer($infolist, "priority");
+        if ( weechat::config_boolean( $options{"hotlist_counter"} ) eq 1 and $weechat_version >= 0x00030500)
+        {
+            $hotlist{weechat::infolist_pointer($infolist, "buffer_pointer")."_count_00"} =
+                weechat::infolist_integer($infolist, "count_00");   # low message
+            $hotlist{weechat::infolist_pointer($infolist, "buffer_pointer")."_count_01"} =
+                weechat::infolist_integer($infolist, "count_01");   # channel message
+            $hotlist{weechat::infolist_pointer($infolist, "buffer_pointer")."_count_02"} =
+                weechat::infolist_integer($infolist, "count_02");   # private message
+            $hotlist{weechat::infolist_pointer($infolist, "buffer_pointer")."_count_03"} =
+                weechat::infolist_integer($infolist, "count_03");   # highlight message
+        }
     }
     weechat::infolist_free($infolist);
 
         $buffer->{"type"} = weechat::buffer_get_string($buffer->{"pointer"},"localvar_type");
 #        weechat::print("",$buffer->{"type"});
 
-        unless( grep {$_ eq $buffer->{"name"}} @immune_detach_buffers )
+        # check if buffer is active (or maybe a /part, /kick channel)
+        if ($buffer->{"type"} eq "channel" and weechat::config_boolean( $options{"mark_inactive"} ) eq 1)
+        {
+            my $server = weechat::buffer_get_string($buffer->{"pointer"},"localvar_server");
+            my $channel = weechat::buffer_get_string($buffer->{"pointer"},"localvar_channel");
+            my $infolist_channel = weechat::infolist_get("irc_channel","",$server.",".$channel);
+            if ($infolist_channel)
+            {
+                weechat::infolist_next($infolist_channel);
+                $buffer->{"nicks_count"} = weechat::infolist_integer($infolist_channel,"nicks_count");
+            }else
+            {
+                $buffer->{"nicks_count"} = 0;
+            }
+            weechat::infolist_free($infolist_channel);
+        }
+
+        my $result = check_immune_detached_buffers($buffer->{"name"});          # checking for wildcard 
+        unless ($result)
         {
             my $detach_time = weechat::config_integer( $options{"detach"});
             my $current_time = time();
              and not exists $buffers_timer{$buffer->{"pointer"}}
              and $detach_time > 0);
 
+            $buffers_timer{$buffer->{"pointer"}} = $current_time
+            if (weechat::config_boolean($options{"detach_query"}) eq 1
+            and not exists $hotlist{$buffer->{"pointer"}}
+            and $buffer->{"type"} eq "private"
+            and not exists $buffers_timer{$buffer->{"pointer"}}
+            and $detach_time > 0);
+
+            $detach_time = 0
+            if (weechat::config_boolean($options{"detach_query"}) eq 0
+            and $buffer->{"type"} eq "private");
+
+            # free content buffer
+            $buffers_timer{$buffer->{"pointer"}} = $current_time
+            if (weechat::config_boolean($options{"detach_free_content"}) eq 1
+            and not exists $hotlist{$buffer->{"pointer"}}
+            and $buffer->{"type"} eq ""
+            and not exists $buffers_timer{$buffer->{"pointer"}}
+            and $detach_time > 0);
+            $detach_time = 0
+            if (weechat::config_boolean($options{"detach_free_content"}) eq 0
+            and $buffer->{"type"} eq "");
+
+            $detach_time = 0 if (weechat::config_boolean($options{"mark_inactive"}) eq 1 and defined $buffer->{"nicks_count"} and $buffer->{"nicks_count"} == 0);
+
             # check for detach
             unless ( $buffer->{"current_buffer"} eq 0
             and not exists $hotlist{$buffer->{"pointer"}}
-            and $buffer->{"type"} eq "channel"
+#            and $buffer->{"type"} eq "channel"
             and exists $buffers_timer{$buffer->{"pointer"}}
             and $detach_time > 0
             and $weechat_version >= 0x00030800
-            and $current_time - $buffers_timer{$buffer->{"pointer"}} >= $detach_time )
+            and $current_time - $buffers_timer{$buffer->{"pointer"}} >= $detach_time)
             {
                 if ($active_seen)
                 {
                 }
             }
         }
-        else
+        else    # buffer in "immune_detach_buffers"
         {
                 if ($active_seen)
                 {
                     push(@current1, $buffer);
                 }
         }
-
     }   # while end
 
 
                 }
             }
         }
+        if ($buffer->{"type"} eq "channel" and weechat::config_boolean( $options{"mark_inactive"} ) eq 1 and $buffer->{"nicks_count"} == 0)
+        {
+            $str .= "(";
+        }
+
         $str .= weechat::color($color) . weechat::color(",".$bg);
 
         if (weechat::config_boolean( $options{"short_names"} ) eq 1)
             {
                 $str .= encode("UTF-8", substr(decode("UTF-8", $buffer->{"short_name"}), 0, weechat::config_integer($options{"name_size_max"})));
                 $str .= weechat::color(weechat::config_color( $options{"color_number_char"})).weechat::config_string($options{"name_crop_suffix"}) if (length($buffer->{"short_name"}) > weechat::config_integer($options{"name_size_max"}));
+                $str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
+                $str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
             }
             else
             {
                 $str .= $buffer->{"short_name"};
+                $str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
+                $str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
             }
         }
         else
             {
                 $str .= encode("UTF-8", substr(decode("UTF-8", $buffer->{"name"},), 0, weechat::config_integer($options{"name_size_max"})));
                 $str .= weechat::color(weechat::config_color( $options{"color_number_char"})).weechat::config_string($options{"name_crop_suffix"}) if (length($buffer->{"name"}) > weechat::config_integer($options{"name_size_max"}));
+                $str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
+                $str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
             }
             else
             {
                 $str .= $buffer->{"name"};
+                $str .= add_inactive_parentless($buffer->{"type"},$buffer->{"nicks_count"});
+                $str .= add_hotlist_count($buffer->{"pointer"},%hotlist);
             }
         }
         if ( weechat::buffer_get_string($buffer->{"pointer"}, "localvar_type") eq "server" and weechat::config_boolean($options{"show_lag"}) eq 1)
     return $str;
 }
 
+sub add_inactive_parentless
+{
+my ($buf_type, $buf_nicks_count) = @_;
+my $str = "";
+    if ($buf_type eq "channel" and weechat::config_boolean( $options{"mark_inactive"} ) eq 1 and $buf_nicks_count == 0)
+    {
+        $str .= weechat::color(weechat::config_color( $options{"color_number_char"}));
+        $str .= ")";
+    }
+return $str;
+}
+
+sub add_hotlist_count
+{
+my ($bufpointer,%hotlist) = @_;
+
+return "" if ( weechat::config_boolean( $options{"hotlist_counter"} ) eq 0 or ($weechat_version < 0x00030500));   # off
+my $col_number_char = weechat::color(weechat::config_color( $options{"color_number_char"}) );
+my $str = " ".$col_number_char."(";
+
+# 0 = low level
+if (defined $hotlist{$bufpointer."_count_00"})
+{
+    my $bg = weechat::config_color( $options{"color_hotlist_low_bg"} );
+    my $color = weechat::config_color( $options{"color_hotlist_low_fg"} );
+    $str .= weechat::color($bg).
+            weechat::color($color).
+            $hotlist{$bufpointer."_count_00"} if ($hotlist{$bufpointer."_count_00"} ne "0");
+}
+
+# 1 = message
+if (defined $hotlist{$bufpointer."_count_01"})
+{
+    my $bg = weechat::config_color( $options{"color_hotlist_message_bg"} );
+    my $color = weechat::config_color( $options{"color_hotlist_message_fg"} );
+    if ($str =~ /[0-9]$/)
+    {
+        $str .= ",".
+                weechat::color($bg).
+                weechat::color($color).
+                $hotlist{$bufpointer."_count_01"} if ($hotlist{$bufpointer."_count_01"} ne "0");
+    }else
+    {
+        $str .= weechat::color($bg).
+                weechat::color($color).
+                $hotlist{$bufpointer."_count_01"} if ($hotlist{$bufpointer."_count_01"} ne "0");
+    }
+}
+# 2 = private
+if (defined $hotlist{$bufpointer."_count_02"})
+{
+    my $bg = weechat::config_color( $options{"color_hotlist_private_bg"} );
+    my $color = weechat::config_color( $options{"color_hotlist_private_fg"} );
+    if ($str =~ /[0-9]$/)
+    {
+        $str .= ",".
+                weechat::color($bg).
+                weechat::color($color).
+                $hotlist{$bufpointer."_count_02"} if ($hotlist{$bufpointer."_count_02"} ne "0");
+    }else
+    {
+        $str .= weechat::color($bg).
+                weechat::color($color).
+                $hotlist{$bufpointer."_count_02"} if ($hotlist{$bufpointer."_count_02"} ne "0");
+    }
+}
+# 3 = highlight
+if (defined $hotlist{$bufpointer."_count_03"})
+{
+    my $bg = weechat::config_color( $options{"color_hotlist_highlight_bg"} );
+    my $color = weechat::config_color( $options{"color_hotlist_highlight_fg"} );
+    if ($str =~ /[0-9]$/)
+    {
+        $str .= ",".
+                weechat::color($bg).
+                weechat::color($color).
+                $hotlist{$bufpointer."_count_03"} if ($hotlist{$bufpointer."_count_03"} ne "0");
+    }else
+    {
+        $str .= weechat::color($bg).
+                weechat::color($color).
+                $hotlist{$bufpointer."_count_03"} if ($hotlist{$bufpointer."_count_03"} ne "0");
+    }
+}
+$str .= $col_number_char. ")";
+
+$str = "" if (weechat::string_remove_color($str, "") eq " ()");         # remove color and check for buffer with no messages
+return $str;
+}
+
 sub buffers_signal_buffer
 {
 my ($data, $signal, $signal_data) = @_;
-    # check for buffer_switch and set the detach time or remove detach time
+    # check for buffer_switch and set or remove detach time
     if ($weechat_version >= 0x00030800)
     {
         if ($signal eq "buffer_switch")
     }
     else
     {
+        my $infolist = weechat::infolist_get("hook", "", "command,menu");
+        my $has_menu_command = weechat::infolist_next($infolist);
+        weechat::infolist_free($infolist);
+
+        if ( $has_menu_command && $hash{"_key"} =~ /button2/ )
+        {
+            if ($hash{"number"} eq $hash{"number2"})
+            {
+                weechat::command($hash{"pointer"}, "/menu buffer1 $hash{short_name} $hash{number}");
+            }
+            else
+            {
+                weechat::command($hash{"pointer"}, "/menu buffer2 $hash{short_name}/$hash{short_name2} $hash{number} $hash{number2}")
+            }
+        }
+        else
+        {
             move_buffer(%hash);
+        }
     }
 }
+
 sub move_buffer
 {
   my %hash = @_;
   my $ptrbuf = weechat::current_buffer();
   weechat::command($hash{"pointer"}, "/buffer move ".$number2);
 }
+
+sub check_immune_detached_buffers
+{
+    my ($buffername) = @_;
+    foreach ( @immune_detach_buffers ){
+        my $immune_buffer = weechat::string_mask_to_regex($_);
+        if ($buffername =~ /^$immune_buffer$/i)
+        {
+            return 1;
+        }
+    }
+    return 0;
+}

.weechat/perl/colorize_lines.pl

 # for settings see help page
 #
 # history:
+# 1.7: fix: broken lines in dcc chat (reported by equatorping)
+# 1.6: improved: wildcard "*" can be used for server and/or nick. (requested by ldvx)
+#    : add: new value, "only", for option "own_lines" (read help!)
 # 1.5: sync: option weechat.look.nickmode changed in 0.3.9 to "irc.look.nick_mode"
 # 1.4: fix: whole ctcp message was display in prefix (reported by : Mkaysi)
 # 1.3: fix: now using weechat::buffer_get_string() instead of regex to prevent problems with dots inside server-/channelnames (reported by surfhai)
 
 use strict;
 my $prgname	= "colorize_lines";
-my $version	= "1.5";
+my $version	= "1.7";
 my $description	= "colors text in chat area with according nick color. Highlight messages will be fully highlighted in chat area";
 
 # default values
 );
 
 my %help_desc = ( "avail_buffer"         => "messages will be colored in buffer (all = all buffers, channel = channel buffers, query = query buffers (default: all ",
-                  "blacklist_channels"   => "comma separated list with channelname. Channels in this list will be ignored. (e.g.: freenode.#weechat,freenode.#weechat-fr)",
-                  "shuffle"              => "toggle shuffle color mode for chats area (default: off)",
+                  "blacklist_channels"   => "comma separated list with channelname. Channels in this list will be completely ignored. (e.g.: freenode.#weechat,freenode.#weechat-fr). This option has highest priority!",
+                  "shuffle"              => "toggle shuffle color mode for chat area (you don't want this, believe me!) (default: off)",
                   "chat"                 => "colors text in chat area with according nick color (default: on)",
-                  "highlight"            => "highlight messages will be fully highlighted in chat area (on = whole line will be highlighted (using whitelist, only messages from your buddies will be fully highlighted), off = only nick will be highlighted, always = a highlight will always color the whole message (highlight messages from nicks not in your whitelist will be fully highlighted)) (default: on)",
+                  "highlight"            => "highlight message will be fully highlighted in chat area (\"on\" = only messages from your buddies will be mind (using \"plugins.var.perl.".$prgname.".nicks\); \"off\" = message will not be highlighted; \"always\" = a highlight will always color the whole message (default: on)",
                   "hotlist_max_level_nicks_add"         => "toggle highlight for hotlist (default: off)",
-                  "buffer_autoset"       => "toggle highlight color in chat area for buffer_autoset (default: off)",
-                  "look_highlight"       => "toggle highlight color in chat area for option weechat.look.highlight (default: off)",
-                  "look_highlight_regex" => "toggle highlight color in chat area for option weechat.look.highlight_regex (default: off)",
-                  "nicks"                => "comma separated list with nicknames. Only messages from nicks in this list will be colorized. (e.g.: freenode.nils_2,freenode.flashcode,freenode.weebot). You can also give a filename with nicks. The filename has to start with \"/\" (e.g.: /buddylist.txt). The format has to be: one nick each line with <servername>.<nickname>",
-                  "own_lines"            => "colors own written messages (default: off)",
+                  "buffer_autoset"       => "toggle highlight color in chat area for value in \"buffer_autoset.*.highlight_words_add\" (default: off)",
+                  "look_highlight"       => "toggle highlight color in chat area for value in option \"weechat.look.highlight\" (default: off)",
+                  "look_highlight_regex" => "toggle highlight color in chat area for value in option \"weechat.look.highlight_regex\" (default: off)",
+                  "nicks"                => "comma separated list with nicknames. Only messages from nicks in this list will be colorized. (e.g.: freenode.nils_2,freenode.flashcode,freenode.weebot). You can use \"*\" as a wildcard (e.g.: *.nils_* to match all \"nils_\" on all servers). Also a file with nicks is allowed. The filename in option has to start with \"/\" (e.g.: /buddylist.txt). The format has to be, one nick each line with <servername>.<nickname>",
+                  "own_lines"            => "messages written by your own will be colored. color from \"weechat.color.chat_nick_self\" will be used. If you only want to color your lines, use value \"only\" (default: off)",
 );
 
 my $weechat_version;
   return $string;
 }
 
-# get servername and channelname. Do not use regex to extract server- and channelname out of $modifier_data. You will FAIL!
-# some possible names: freenode.#weechat, freenode.#weechat.de, freenode.query, chat.freenode.net.#weechat, chat.freenode.net.#weechat.de
 $modifier_data =~ (m/(.*);(.*);/);
 my $plugin = $1;
 my $name = $2;
 my $buf_pointer = weechat::buffer_search($plugin,$name);
-return $string if ($buf_pointer eq "");
+return $string if ($buf_pointer eq "");                                                         # something went wrong!
+
+# get servername and channelname. Do not use regex to extract server- and channelname out of $modifier_data. You will FAIL!
+# some possible names: freenode.#weechat, freenode.#weechat.de, freenode.query, chat.freenode.net.#weechat, chat.freenode.net.#weechat.de
 my $servername = weechat::buffer_get_string($buf_pointer, "localvar_server");
 my $channel_name = weechat::buffer_get_string($buf_pointer, "localvar_channel");
-
-my $my_nick = weechat::info_get( 'irc_nick', $servername );                                     # get nick with servername (;freenode.)
+my $my_nick = weechat::buffer_get_string($buf_pointer, "localvar_nick");
 
 if ( grep /^$servername.$channel_name$/, @var_blacklist_channels ) {                            # check for blacklist_channels
   return $string;
 my $line = $2;                                                                                  # get written text
 
 $line = weechat::string_remove_color($line,"");                                                 # remove color-codes from line, first
-# get the nick name from modifier_data (without nick_mode and color codes! Take care of tag "prefix_nick_ccc")
-$modifier_data =~ m/(^|,)nick_(.*),/;
-my $nick_wo_suffix = $2;                                                                        # nickname without nick_suffix
+
+my $nick_wo_suffix = "";
+# check if modifier tag "nick_" exists in message.
+if ($modifier_data =~ m/(^|,)nick_/)
+{
+    # get the nick name from modifier_data (without "nick_mode" and color codes! Take care of tag "prefix_nick_ccc")
+    # and check for "nick_name" as last modifier_data
+    $modifier_data =~ m/(^|,)nick_([^,]*)/;
+    $nick_wo_suffix = $2;                                                                       # nickname without nick_suffix
+}else
+{
+    # This is a fallback solution!
+    $nick_wo_suffix = weechat::string_remove_color($nick,"");                                   # remove colour-codes from nick
+}
+return $string if ($nick_wo_suffix eq "");
+
 
 if ( lc($nick_wo_suffix) eq lc($my_nick) ){                                                     # this one checks for own messages
   if ( $default_options{var_avail_buffer} ne "all" ){                                           # check for option avail_buffer
 }
 
 # i wrote the message
-#weechat::print("","nick_wo: $nick_wo_suffix");
-#weechat::print("","my_nick: $my_nick");
     if ($nick_wo_suffix eq $my_nick ){                                                                  # i wrote the message
       return $string if check_whitelist_nicks($servername, $my_nick, $nick_wo_suffix);                  # check for whitelist
       if ($default_options{var_chat} eq "on"){
     if ( $default_options{var_highlight} eq "on" or $default_options{var_highlight} eq "always" ){# highlight_mode on?
 # this one check for other nick!!
 
-      unless ( $default_options{var_highlight} eq "always" ){                                   # option is not "always"
+      if ( $default_options{var_highlight} eq "on" ){
         return $string if check_whitelist_nicks($servername, $my_nick, $nick_wo_suffix);        # check for whitelist
       }
 
 
 	    chomp($highlight_words);
 
-#            weechat::print("",$highlight_words);
 	      foreach ( split( /,+/, $highlight_words ) ) {                                     # check for highlight_words
 		  if ($_ eq ""){next;}                                                          # ignore empty string
 		    my $search_string = shell2regex($_);
 	if ( $var_hl_max_level_nicks_add eq 0 ){
 	      $line = colorize_nicks($high_color,$modifier_data,$line);
 	      $line = $nick_prefix_with_color . $nick_mode . $high_color . $nick . $nick_suffix_with_color . "\t" . $high_color . $line . weechat::color('reset');
+
+# TODO use of weechat_print_date_tags() to add "notify_highlight" to messages.
+#	      $modifier_data =~ s/,notify_message,/,notify_highlight,/gio;
+#	      weechat::print_date_tags($buf_pointer,0,$modifier_data,$line);
+#	      return "";
 	      return $line;
 	}
 	}
 		return $line;
 	    }
 	  }
-	}
-          if (index($modifier_data,"irc_action") >= 0){
+        }
+        if (index($modifier_data,"irc_action") >= 0)
+        {
 #	  if ($default_options{prefix_action} eq $nick){
                 my $nick_color = weechat::info_get('irc_nick_color', $nick_wo_suffix);          # get nick-color
-		$line = colorize_nicks($nick_color,$modifier_data,$line);
+                $line = colorize_nicks($nick_color,$modifier_data,$line);
                 $nick = $prefix_action_with_color;
-		$line = $nick . "\t" . $nick_color . $line . weechat::color('reset');
-		return $line;
-	  }
+                $line = $nick . "\t" . $nick_color . $line . weechat::color('reset');
+                return $line;
+        }
 
       $line = colorize_nicks($nick_color,$modifier_data,$line);
       $line = $nick_prefix_with_color . $nick_mode . $nick_color . $nick . $nick_suffix_with_color .  "\t" . $nick_color . $line . weechat::color('reset');  # create new line nick_color+nick+separator+text
       return $line;
     }else{
-      return $string;										# return original string
+      return $string;                                                                           # return original string
     }
 } # end of sub colorize_cb{}
 
-# whitelist nicks
+# whitelist nicks : 0 = color, 1 = no color
 sub check_whitelist_nicks{
 my ( $servername, $my_nick, $nick_wo_suffix ) = @_;
-  if ( $default_options{var_nicks} ne "" and $default_options{var_own_lines} eq "off" ){          # nicks in option and own_lines = off
-        return 1 unless (grep /^\Q$servername.$nick_wo_suffix\E$/i, @nick_list)                   # check other nicks
-  }elsif ( $default_options{var_nicks} ne "" and $default_options{var_own_lines} eq "on" ){       # nicks in option and own_lines = on
-      if ( $nick_wo_suffix ne $my_nick){                                                          # not my nick!
-        return 1 unless (grep /^\Q$servername.$nick_wo_suffix\E$/i, @nick_list)                   # check other nicks
-      }
-  }elsif( $default_options{var_nicks} eq "" and $default_options{var_own_lines} eq "off" ){       # no nicks and do not color my line?
-      if ( $nick_wo_suffix eq $my_nick){                                                          # my nick?
-        return 1;                                                                                 # yes
-      }
-  }
+    if ( $default_options{var_own_lines} eq "only" ){                                           # color only my lines
+        if ( $nick_wo_suffix eq $my_nick){                                                      # my nick?
+            return 0;                                                                           # yes
+        }else{
+            return 1;                                                                           # another nick!
+        }
+    }elsif ( $default_options{var_nicks} ne "" and $default_options{var_own_lines} eq "off" ){   # nicks in option and own_lines = off
+        my $result = loop_whitelist_nicks($servername,$nick_wo_suffix);                         # check nicks in list
+        return 1 if ($result == 1);
+    }elsif ( $default_options{var_nicks} ne "" and $default_options{var_own_lines} eq "on" ){   # nicks in option and own_lines = on
+        if ( $nick_wo_suffix ne $my_nick){                                                      # not my nick!
+            my $result = loop_whitelist_nicks($servername,$nick_wo_suffix);                     # check nicks in list
+            return 1 if ($result == 1);
+        }
+    }elsif( $default_options{var_nicks} eq "" and $default_options{var_own_lines} eq "off" ){   # no nicks and do not color my line?
+        if ( $nick_wo_suffix eq $my_nick){                                                      # my nick?
+            return 1;                                                                           # yes
+        }
+    }
 return 0;
 }
-
+sub loop_whitelist_nicks{
+    my ($servername, $nick) = @_;
+    foreach ( @nick_list ){
+        my ($server,$buddy) = split(/\./,$_);
+        $server = weechat::string_mask_to_regex($server);
+        $buddy = weechat::string_mask_to_regex($buddy);
+        if ($servername =~ /^$server$/i and $nick =~ /^$buddy$/i) {
+            return 0;
+        }
+    }
+    return 1;
+}
 # converts shell wildcard characters to regex
 sub shell2regex {
     my $globstr = shift;

.weechat/plugins.conf

 #
-# plugins.conf -- WeeChat v0.3.9
+# plugins.conf -- weechat v0.4.0
 #
 
 [var]
 python.screen_away.away_suffix = ""
 python.screen_away.command_on_attach = ""
 python.screen_away.command_on_detach = ""
+python.screen_away.ignore = ""
 python.screen_away.interval = "5"
 python.screen_away.message = "Detached from screen"
 tcl.check_license = "on"
 
 [desc]
 perl.colorize_lines.avail_buffer = "messages will be colored in buffer (all = all buffers, channel = channel buffers, query = query buffers (default: all "
-perl.colorize_lines.blacklist_channels = "comma separated list with channelname. Channels in this list will be ignored. (e.g.: freenode.#weechat,freenode.#weechat-fr)"
-perl.colorize_lines.buffer_autoset = "toggle highlight color in chat area for buffer_autoset (default: off)"
+perl.colorize_lines.blacklist_channels = "comma separated list with channelname. Channels in this list will be completely ignored. (e.g.: freenode.#weechat,freenode.#weechat-fr). This option has highest priority!"
+perl.colorize_lines.buffer_autoset = "toggle highlight color in chat area for value in "buffer_autoset.*.highlight_words_add" (default: off)"
 perl.colorize_lines.chat = "colors text in chat area with according nick color (default: on)"
-perl.colorize_lines.highlight = "highlight messages will be fully highlighted in chat area (on = whole line will be highlighted (using whitelist, only messages from your buddies will be fully highlighted), off = only nick will be highlighted, always = a highlight will always color the whole message (highlight messages from nicks not in your whitelist will be fully highlighted)) (default: on)"
+perl.colorize_lines.highlight = "highlight message will be fully highlighted in chat area ("on" = only messages from your buddies will be mind (using "plugins.var.perl.colorize_lines.nicks); "off" = message will not be highlighted; "always" = a highlight will always color the whole message (default: on)"
 perl.colorize_lines.hotlist_max_level_nicks_add = "toggle highlight for hotlist (default: off)"
-perl.colorize_lines.look_highlight = "toggle highlight color in chat area for option weechat.look.highlight (default: off)"
-perl.colorize_lines.look_highlight_regex = "toggle highlight color in chat area for option weechat.look.highlight_regex (default: off)"
-perl.colorize_lines.nicks = "comma separated list with nicknames. Only messages from nicks in this list will be colorized. (e.g.: freenode.nils_2,freenode.flashcode,freenode.weebot). You can also give a filename with nicks. The filename has to start with "/" (e.g.: /buddylist.txt). The format has to be: one nick each line with <servername>.<nickname>"
-perl.colorize_lines.own_lines = "colors own written messages (default: off)"
-perl.colorize_lines.shuffle = "toggle shuffle color mode for chats area (default: off)"
+perl.colorize_lines.look_highlight = "toggle highlight color in chat area for value in option "weechat.look.highlight" (default: off)"
+perl.colorize_lines.look_highlight_regex = "toggle highlight color in chat area for value in option "weechat.look.highlight_regex" (default: off)"
+perl.colorize_lines.nicks = "comma separated list with nicknames. Only messages from nicks in this list will be colorized. (e.g.: freenode.nils_2,freenode.flashcode,freenode.weebot). You can use "*" as a wildcard (e.g.: *.nils_* to match all "nils_" on all servers). Also a file with nicks is allowed. The filename in option has to start with "/" (e.g.: /buddylist.txt). The format has to be, one nick each line with <servername>.<nickname>"
+perl.colorize_lines.own_lines = "messages written by your own will be colored. color from "weechat.color.chat_nick_self" will be used. If you only want to color your lines, use value "only" (default: off)"
+perl.colorize_lines.shuffle = "toggle shuffle color mode for chat area (you don't want this, believe me!) (default: off)"
+python.screen_away.away_suffix = "What to append to your nick when you're away."
+python.screen_away.command_on_attach = "Command to execute on attach"
+python.screen_away.command_on_detach = "Command to execute on detach"
+python.screen_away.ignore = "Comma-separated list of servers to ignore."
+python.screen_away.interval = "How often in seconds to check screen status"
+python.screen_away.message = "Away mesage"

.weechat/python/screen_away.py

 # (this script requires WeeChat 0.3.0 or newer)
 #
 # History:
+# 2012-12-29, David Flatz <david@upcs.at>
+#  version 0.9: add option to ignore servers and don't set away status for them
+#               add descriptions to config options
 # 2010-08-07, Filip H.F. "FiXato" Slagter <fixato@gmail.com>
 #  version 0.8: add command on attach feature
 # 2010-05-07, Jani Kesänen <jani.kesanen@gmail.com>
 
 SCRIPT_NAME    = "screen_away"
 SCRIPT_AUTHOR  = "xt <xt@bash.no>"
-SCRIPT_VERSION = "0.8"
+SCRIPT_VERSION = "0.9"
 SCRIPT_LICENSE = "GPL3"
 SCRIPT_DESC    = "Set away status on screen detach"
 
 settings = {
-        'message': 'Detached from screen',
-        'interval': '5',        # How often in seconds to check screen status
-        'away_suffix': '',      # What to append to your nick when you're away.
-        'command_on_attach': '', # Command to execute on attach
-        'command_on_detach': '' # Command to execute on detach
+        'message': ('Detached from screen', 'Away mesage'),
+        'interval': ('5', 'How often in seconds to check screen status'),
+        'away_suffix': ('', 'What to append to your nick when you\'re away.'),
+        'command_on_attach': ('', 'Command to execute on attach'),
+        'command_on_detach': ('', 'Command to execute on detach'),
+        'ignore': ('', 'Comma-separated list of servers to ignore.'),
 }
 
 TIMER = None
 
     global TIMER
     if TIMER:
-        w.unhook(TIMER);
+        w.unhook(TIMER)
     TIMER = w.hook_timer(int(w.config_get_plugin('interval')) * 1000,
             0, 0, "screen_away_timer_cb", '')
 
 def get_servers():
     '''Get the servers that are not away, or were set away by this script'''
 
+    ignores = w.config_get_plugin('ignore').split(',')
     infolist = w.infolist_get('irc_server','','')
     buffers = []
     while w.infolist_next(infolist):
-        if not w.infolist_integer(infolist, 'is_connected') == 1:
+        if not w.infolist_integer(infolist, 'is_connected') == 1 or \
+               w.infolist_string(infolist, 'name') in ignores:
             continue
         if not w.infolist_integer(infolist, 'is_away') or \
                w.infolist_string(infolist, 'away_message') == \
 
 if w.register(SCRIPT_NAME, SCRIPT_AUTHOR, SCRIPT_VERSION, SCRIPT_LICENSE,
                     SCRIPT_DESC, "", ""):
-    for option, default_value in settings.iteritems():
+    version = w.info_get('version_number', '') or 0
+    for option, default_desc in settings.iteritems():
         if not w.config_is_set_plugin(option):
-            w.config_set_plugin(option, default_value)
+            w.config_set_plugin(option, default_desc[0])
+        if int(version) >= 0x00030500:
+            w.config_set_desc_plugin(option, default_desc[1])
 
     if 'STY' in os.environ.keys():
         # We are running under screen

.weechat/relay.conf

 #
-# relay.conf -- WeeChat v0.3.9
+# relay.conf -- weechat v0.4.0
 #
 
 [look]
 allowed_ips = ""
 bind_address = ""
 compression_level = 6
+ipv6 = on
 max_clients = 5
 password = ""
 ssl_cert_key = "%h/ssl/relay.pem"
 
+[irc]
+backlog_max_minutes = 1440
+backlog_max_number = 256
+backlog_since_last_disconnect = on
+backlog_tags = "irc_privmsg"
+backlog_time_format = "[%H:%M] "
+
 [port]

.weechat/rmodifier.conf

 #
-# rmodifier.conf -- WeeChat v0.3.9
+# rmodifier.conf -- weechat v0.4.0
 #
 
 [look]

.weechat/script.conf

 #
-# script.conf -- WeeChat v0.3.9
+# script.conf -- weechat v0.4.0
 #
 
 [look]

.weechat/weechat.conf

 #
-# weechat.conf -- WeeChat v0.3.9
+# weechat.conf -- weechat v0.4.0
 #
 
 [debug]
 @item(buffer_nicklist):button2-gesture-left = "/window ${_window_number};/ban ${nick}"
 @item(buffers):button1* = "hsignal:buffers_mouse"
 @item(buffers):button2 = "hsignal:buffers_mouse"
+@item(buffers):button2* = "hsignal:buffers_mouse"
 @bar:wheeldown = "/bar scroll ${_bar_name} ${_window_number} +20%"
 @bar:wheelup = "/bar scroll ${_bar_name} ${_window_number} -20%"
 @chat:button1 = "/window ${_window_number}"

.weechat/xfer.conf

 #
-# xfer.conf -- WeeChat v0.3.9
+# xfer.conf -- weechat v0.4.0
 #
 
 [look]
 typeset -U path
+path=(/Applications/MacVim.app/Contents/MacOS $HOME/bin /opt/local/bin /opt/local/sbin $path /Applications/MATLAB_R2011b.app/bin /Applications/MATLAB_R2011b.app/bin/maci64)
 
-path=(/Applications/MacVim.app/Contents/MacOS $HOME/bin /opt/local/bin /opt/local/sbin $path /Applications/kdiff3.app/Contents/MacOS /Applications/MATLAB_R2011b.app/bin /Applications/MATLAB_R2011b.app/bin/maci64)
+export EDITOR=vim
+export VISUAL=vim
+export MAC_SYNC="$HOME/Dropbox/Mac Sync/"
+#export PYTHONPATH=/Library/Python/2.7/site-packages:~/wjkoh-research/koh:$PYTHONPATH
 
-EDITOR=vim
-VISUAL=vim
-MAC_SYNC="$HOME/Dropbox/Mac Sync/"
+export PYOPENCL_CTX=1
+export PYOPENCL_COMPILER_OUTPUT=1
 
 # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
 # Example format: plugins=(rails git textmate ruby lighthouse)
-plugins=(git mercurial autojump brew cloudapp debian macports osx python pip svn vi-mode dircycle cp dirpersisti rsync)
+#plugins=(git mercurial autojump brew cloudapp debian macports osx python pip svn vi-mode dircycle cp dirpersist rsync)
 
 source $ZSH/oh-my-zsh.sh
 
 # MATLAB
 alias matlab="matlab -nodesktop -nosplash"
 alias ssh_i="ssh doyubkim@ssh.intel-research.net -t ssh "
-alias python='python -i'
+#alias python='python -i'
+
+alias -s tex=vim
+alias -s md=vim
+alias -s cpp=vim
+alias -s h=vim
+alias -s html=safari
+
+# if you are using vi-mode plugin or bindkey -v.
+bindkey '^R' history-incremental-search-backward
 
 export REPORTTIME=1
 
+# http://stackoverflow.com/questions/9810327/git-tab-autocompletion-is-useless-can-i-turn-it-off-or-optimize-it/9810485#9810485
+__git_files () { 
+    _wanted files expl 'local files' _files
+}
+
 # tmux
 if hash tmux &> /dev/null && [ -z "$TMUX" ]; then
 	SESSION=$USER

bin/bootstrap_mac.sh

 sudo port install weechat +aspell +perl +python +tls
 sudo port install wget
 sudo port install sshfs
+sudo port install tmux tmux-pasteboard libmpdclient
+sudo port install htop
 sudo /usr/bin/cpan App::Ack
 
 # tmux
 
 # Install libraries
 sudo port install glew
-#sudo port install jpeg
-#sudo port install freetype
-#sudo port install libpng
+sudo port install glm
+sudo port install jpeg
+sudo port install freetype
+sudo port install libpng
 
 # Install MacVim
+
+sudo tmutil disablelocal
+
+sudo port install nethack +autopickup_exceptions +menucolors
+wget http://dayoneapp.com/downloads/dayone-cli.pkg && open dayone-cli.pkg
+wget https://gist.github.com/raw/1838072/Monaco-Powerline.otf --no-check-certificate && open Monaco-Powerline.otf

bin/encode_imgs_to_vid.sh

 #!/usr/bin/env bash
 
-ffmpeg -r 2 -i frame_%06d.jpg -vcodec libx264 -threads 4 -preset slower -crf 12 -tune animation -pix_fmt yuv420p output_2fps.mp4
-#ffmpeg -r 0.5 -i frame_%06d.jpg -vcodec libx264 -threads 4 -preset slower -crf 12 -tune animation -pix_fmt yuv420p output_60fps.mp4
-#ffmpeg -r 0.25 -i frame_%06d.jpg -vcodec libx264 -threads 4 -preset slower -crf 12 -tune animation -pix_fmt yuv420p output_30fps.mp4
-#ffmpeg -r 90 -i img_%04d.png -vcodec libx264 -threads 4 -preset veryslow -crf 12 -tune animation -pix_fmt yuv420p output_90fps.mp4
-#ffmpeg -r 30 -i img_%04d.png -vcodec libx264 -threads 4 -preset veryslow -crf 12 -tune animation -pix_fmt yuv420p output_30fps.mp4
+# iMovie (baseline)
+ffmpeg -r 60 -i frame_%04d.png -vcodec libx264 -threads 3 -preset veryslow -crf 1 -pix_fmt yuv420p -profile:v baseline output_baseline_60fps.mp4
+ffmpeg -r 30 -i frame_%04d.png -vcodec libx264 -threads 3 -preset veryslow -crf 1 -pix_fmt yuv420p -profile:v baseline output_baseline_30fps.mp4
+
+# General
+#ffmpeg -r 60 -i frame_%06d.jpg -vcodec libx264 -threads 3 -preset veryslow -crf 1 -pix_fmt yuv420p output_60fps.mp4
+#ffmpeg -r 30 -i frame_%04d.png -vcodec libx264 -threads 3 -preset veryslow -crf 1 -pix_fmt yuv420p output_30fps.mp4
     echo ${DOTFILE}
     TARGET="${HOME}/${DOTFILE}"
     rm -rf "${TARGET}"
-    ln -sf "${DOTDIR}/${DOTFILE}" "${TARGET}"
+    ln -s "${DOTDIR}/${DOTFILE}" "${TARGET}"
 done
 
 rm -rf "${HOME}/.weechat/irc.conf"
-ln -sf "${HOME}/Dropbox/Mac Sync/weechat/irc.conf" "${HOME}/.weechat/irc.conf"
+ln -s "${HOME}/Dropbox/Mac Sync/weechat/irc.conf" "${HOME}/.weechat/irc.conf"
 popd &> /dev/null
 
 echo
 $PIP install --upgrade scikit-learn joblib sympy
 $PIP install --upgrade PyOpenGL PyOpenGL_accelerate OpenGLContext
 $PIP install --upgrade Mako PyOpenCL
+$PIP install --upgrade paramiko
 
 echo
 echo "* Installing Ack..."
 echo
 echo "* Installing Pelican..."
 $PIP install --upgrade pelican Markdown typogrify boto
+
+hg clone https://bitbucket.org/tksoh/hgshelve ~/.hgext/hgshelve # temporary fix