Last active
December 29, 2015 18:39
-
-
Save jjrh/7712137 to your computer and use it in GitHub Desktop.
Weechat plugin to sort your buffers alphabetically (which results in grouping them by server) and correct the buffer numbering.
ibuffer has a sort mode, but it does not correct the numbering. has the hook for channel joins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weechat::register "sort_buffs" "FlashCode" "0.1" "GPL3" "sorts buffers" "" "" | |
proc sortbuffs {data signal signal_data} { | |
set bufflist [] | |
set infolist [weechat::infolist_get "buffer" "" ""] | |
while { [weechat::infolist_next $infolist] } { | |
set name [weechat::infolist_string $infolist "name" ] | |
regsub "\\." $name "," name | |
set bufflist [linsert $bufflist [llength $bufflist] $name] | |
} | |
set bufflist [lsort -decreasing -dictionary $bufflist] | |
set i 0 | |
foreach b $bufflist { | |
incr i | |
set cur [weechat::info_get "irc_buffer" $b] | |
weechat::buffer_set $cur "number" $i | |
} | |
return 1 | |
} | |
weechat::hook_signal "*,irc_in2_join" sortbuffs "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment