hysteria

ii wrapper script
git clone git://git.2f30.org/hysteria.git
Log | Files | Refs | README | LICENSE

commit 5597f9f05ccb78885946dfd53b99863c60d86808
parent e85fc97c222c229b499bd77e5abae49e508d8db6
Author: sin <sin@2f30.org>
Date:   Mon Apr 14 23:56:21 +0100

Rename hiii to highlight

Diffstat:
connectserver | 2+-
highlight | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hiii | 66------------------------------------------------------------------
join | 2+-
monitor | 2+-
5 files changed, 69 insertions(+), 69 deletions(-)
diff --git a/connectserver b/connectserver @@ -17,6 +17,6 @@ fi host="$1" tmux new-window "ii -i irc -s $host -n $nick -f $fullname" ./waitfile "irc/$host/out" -tmux new-window "tail -f irc/$host/out | ./hiii" +tmux new-window "tail -f irc/$host/out | ./highlight" tmux split-window -p 1 "cat > irc/$host/in" tmux rename-window "$host" diff --git a/highlight b/highlight @@ -0,0 +1,66 @@ +#!/usr/bin/perl +# +# Taken from: https://github.com/berkoz/hiii + +use v5.10; +use strict; +use warnings; + +my %config = ( + # You can specify multiple nicknames like, 'berk|bozbalci' + + 'nick' => 'berk', + 'color_nicks' => 'light_green', + 'color_own_nick' => 'light_red', + 'color_url' => 'light_blue', + 'color_actions' => 'magenta', + 'color_server' => 'black' +); + +my %color = ( + 'black' => "", + 'red' => "", + 'green' => "", + 'yellow' => "", + 'blue' => "", + 'magenta' => "", + 'cyan' => "", + 'white' => "", + 'light_black' => "", + 'light_red' => "", + 'light_green' => "", + 'light_yellow' => "", + 'light_blue' => "", + 'light_magenta' => "", + 'light_cyan' => "", + 'light_white' => "", + 'reset' => "" +); + +my $timestamp = "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}"; +my $url = "(((https?|ftp)|mailto):(//)?[^ <>\"[:blank:]]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)"; +my $nick = "<(.*?)>"; +my $action = "ACTION (.*)?"; +my $useless = "^-!- (.*)"; + +while (<>) { + # Remove the huge timestamp from the line's beginning + s/^$timestamp //; + + # Highlight nicknames, remove <> around them + s/^$nick/$color{$config{'color_nicks'}}$1$color{'reset'} /; + + # Highlight me + s/($config{'nick'})/$color{$config{'color_own_nick'}}$1$color{'reset'}/; + + # Highlight URLs + s/$url/$color{$config{'color_url'}}$1$color{'reset'}/; + + # Highlight /me actions + s/$action/$color{$config{'color_actions'}}* $1 *$color{'reset'}/; + + # Highlight "has joined", "changed mode", etc. + s/^$useless/$color{$config{'color_server'}}$1$color{'reset'}/; + + print; +} diff --git a/hiii b/hiii @@ -1,66 +0,0 @@ -#!/usr/bin/perl -# -# Taken from: https://github.com/berkoz/hiii - -use v5.10; -use strict; -use warnings; - -my %config = ( - # You can specify multiple nicknames like, 'berk|bozbalci' - - 'nick' => 'berk', - 'color_nicks' => 'light_green', - 'color_own_nick' => 'light_red', - 'color_url' => 'light_blue', - 'color_actions' => 'magenta', - 'color_server' => 'black' -); - -my %color = ( - 'black' => "", - 'red' => "", - 'green' => "", - 'yellow' => "", - 'blue' => "", - 'magenta' => "", - 'cyan' => "", - 'white' => "", - 'light_black' => "", - 'light_red' => "", - 'light_green' => "", - 'light_yellow' => "", - 'light_blue' => "", - 'light_magenta' => "", - 'light_cyan' => "", - 'light_white' => "", - 'reset' => "" -); - -my $timestamp = "[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}"; -my $url = "(((https?|ftp)|mailto):(//)?[^ <>\"[:blank:]]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)"; -my $nick = "<(.*?)>"; -my $action = "ACTION (.*)?"; -my $useless = "^-!- (.*)"; - -while (<>) { - # Remove the huge timestamp from the line's beginning - s/^$timestamp //; - - # Highlight nicknames, remove <> around them - s/^$nick/$color{$config{'color_nicks'}}$1$color{'reset'} /; - - # Highlight me - s/($config{'nick'})/$color{$config{'color_own_nick'}}$1$color{'reset'}/; - - # Highlight URLs - s/$url/$color{$config{'color_url'}}$1$color{'reset'}/; - - # Highlight /me actions - s/$action/$color{$config{'color_actions'}}* $1 *$color{'reset'}/; - - # Highlight "has joined", "changed mode", etc. - s/^$useless/$color{$config{'color_server'}}$1$color{'reset'}/; - - print; -} diff --git a/join b/join @@ -19,7 +19,7 @@ shift for c in $*; do echo "/join $c" > "irc/$host/in" ./waitfile "irc/$host/$c/out" - tmux new-window "tail -f irc/$host/$c/out | ./hiii" + tmux new-window "tail -f irc/$host/$c/out | ./highlight" tmux split-window -p 1 "cat > irc/$host/$c/in" tmux rename-window "$c" done diff --git a/monitor b/monitor @@ -20,7 +20,7 @@ while :; do fi done if test $found -eq 0; then - tmux new-window "tail -f $n | ./hiii" + tmux new-window "tail -f $n | ./highlight" tmux split-window -p 1 "cat > $(dirname $n)/in" tmux rename-window "$title" fi