1. Evan Gates
  2. pcw


Evan Gates  committed dcb07c3

add tmux option and make it default for now

  • Participants
  • Parent commits 7e28d25
  • Branches default

Comments (0)

Files changed (1)

File pcw_win.sh

View file
 # does mean however that some ideas won't work out of the box, for instance
 # using urxvtc or screen.  You should be able to keep track of some stuff here
 # in order to decide whether or not to launch a new window, have fun!
+# NOTE: if you use cw_color.sh make sure you have a 256 color terminal, or edit
+#       cw_color.sh accordingly
-exec urxvt -title "$CPATH" -e srw -p "$(basename "$CPATH")> " cw "$OUT" "$IN"
+#exec urxvt -title "$CPATH" -e srw -l -p "$(basename "$CPATH")> " cw_color.sh -i "$OUT" -o "$IN" -n "$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
+if ! tmux list-sessions | grep -q "^$TITLE"; then
+	urxvtc -title "$TITLE" -e tmux new-session -s "$TITLE" -n "$(basename "$CPATH")" "srw -p \"$(basename "$CPATH")>\" cw_color.sh -i \"$OUT\" -o \"$IN\""
+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\""
 # The default command
 # exec urxvt -title "$CPATH" -e srw -p "$(basename "$CPATH")> " cw "$OUT" "$IN"
 # If for some reason you really don't want to use srw...
 # exec urxvt -title "$CPATH" -e cw "$OUT" "$IN"
-# For colors, bell on nick, better line wrapping etc.
+# For colors, bell on nick, better line wrapping etc. (this is what i use)
 # exec urxvt -title "$CPATH" -e srw -p "$(basename "$CPATH")> " cw_color.sh -i "$OUT" -o "$IN" -n "$NICK"
+# And to add reflowing text when the window changes size.  Although beware, in
+# this case reflow means reprint the whole file at the new width.  This can be
+# slow, but if you use chat.sh it gzips the old out files everytime you startup
+# again.  (This is the one I use, along with chat.sh)
+# exec urxvt -title "$CPATH" -e srw -w -p "$(basename "$CPATH")> " cw_color.sh -i "$OUT" -o "$IN" -n "$NICK"
 # If you want to use tabbed (http://tools.suckless.org/tabbed) so each new
 # channel has it's own tab.  Start tabbed with -d then export the window id as
 # pcw_window_id (or whatever you want...) then start pcw.  It should be fairly
 # simple to do that in a script, use cw_color.sh if you want the colors etc.
 # exec urxvt -embed "$pcw_window_id" -title "$CPATH", -e srw -p "$(basename "$CPATH")> " cw "$OUT" "$IN"
 # If you want notifications in dzen, then click on a specific message to spawn
 # a terminal for that channel.
 # NOTE: alpha quality at best, more of a proof of concept, but have fun with it