Commits

Anonymous committed a7e8606

cleanup + eval ii so $args is interpreted correctly

Comments (0)

Files changed (3)

 # SERVERS should be a file with a list of servers, each followed by the ii
 # command line for that server (except the -s because we start with the server)
 # A -i prefix argument will override the one provided here, useful if you want
-# a specific server somehwere other than the given hierarchy, but it should be
+# a specific server somewhere other than the given hierarchy, but it should be
 # noted that the fifo path will still be relative to $PREFIX/$serv/. There are
 # then a list of "fifo command" pairs for each server. If a line ends with a "w"
 # we wait a few seconds before executing it (default 5). Each server block
 #      reopen a window when it does so. the "nickserv/in /l w" is at the end
 #      so I don't have to wait for that command before executing the others
 
-TITLE="pcw" # also in pcw_win.sh
+TITLE="pcw"
 PREFIX="$HOME/irc"
 SERVERS="$PREFIX/servers"
 LOG="$PREFIX/log"
 		done >> "$PREFIX/$serv/log" 2>&1 & # background so we can start ii
 
 		IFS="$oIFS"
-		ii -i "$PREFIX" -s $args
+		eval ii -i "$PREFIX" -s $args
 		[ $? -eq 2 ] || break # only restart ii on timeout (not default for ii)
 	done >> "$PREFIX/$serv/log" 2>&1 & # instead of locking the main one...
 

extras/cw_color.sh

 
 # to find out which colors are readable...
 # for i in {0..255}; do echo $(tput setaf $i) $i foobar baz qux; done
-colors=({9..11} {13..14} {26..51} {62..87} {99..123} {130..159} {165..231})
+colors=({9..11} {13..14} {26..51} {62..87} 99 {105..123} {130..159} {165..231})
 declare -A color_cache
 
 reset="$(tput sgr0)"
 	nick=${nick#<}
 	nick=${nick%>}
 
+	if [ "$date" = "SIZE" ]; then
+		cols=$nick
+		continue
+	fi
+
 	if [ ${#nick} -lt $PAD ]; then
 		head_len=$(($PAD + ${#time} + 2))
 	else
 		head_len=$((${#nick} + ${#time} + 2))
 	fi
 
-	if [ "$date" = "SIZE" ]; then
-		cols=$nick
-		continue
-	fi
-
 	time="${bold}${black}${time}${reset}"
 
 	set_format "$nick"
 # Open a new tmux window for each channel, this one has been requested for a while, and now it works!
 # make sure to add 'set -g default-terminal "screen-256color"' to your ~/.tmux.conf
 # if you don't want color, you can change the cw_color.sh part to cw etc. like the other examples
-TITLE="pcw" # also in chat.sh
+TITLE="pcw"
 
 if ! tmux list-sessions | grep -q "^$TITLE"; then
-	tmux new-session -d -s "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")>\" cw_color.sh -i \"$OUT\" -o \"$IN\""
+	tmux new-session -d -s "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")> \" cw_color.sh -i \"$OUT\" -o \"$IN\" -n \"$NICK\""
 elif ! tmux list-windows -t "$TITLE" | grep -q "$(basename "$CPATH")"; then
-	tmux new-window -d -t "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")>\" cw_color.sh -i \"$OUT\" -o \"$IN\""
+	tmux new-window -d -t "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")> \" cw_color.sh -i \"$OUT\" -o \"$IN\" -n \"$NICK\""
 fi
 
 # The default command