Anonymous avatar Anonymous committed 66b76a0

make tmux default in chat.sh, start tmux but don't open terminal in pcw_win.sh

Comments (0)

Files changed (2)

 #      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
 PREFIX="$HOME/irc"
 SERVERS="$PREFIX/servers"
 LOG="$PREFIX/log"
 
 DELAY=5 # seconds to wait when we get a "w"
 
+if ! tmux list-sessions | grep -q "^$TITLE"; then
+	tmux new-session -d -s "$TITLE"
+fi
+
 {
 	echo
 	date
 
 done < "$SERVERS" >> "$LOG" 2>&1
 
+tmux attach-session -t "$TITLE"
+
 # vim: set ts=4 sw=4 noexpandtab:
 # 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"
+TITLE="pcw" # also in chat.sh
 
 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\""
+	tmux new-session -d -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\""
 fi
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.