pcw / extras / pcw_notify.sh

#!/bin/bash
FILE="$HOME/.pcw_notify"
CHAN="$1"
NICK="$2"

[ -f "$FILE" ] || printf "\n\n\n\n\n\n\n\n\n\n\n" > "$FILE" || exit 2

if ! pgrep -lf pcw_notify_dzen > /dev/null 2>&1; then
	while true; do
		{ tail "$FILE"; tail -n 1 "$FILE"; } | tac
		sleep 1
	done | dzen2 -m -e 'entertitle=uncollapse,grabkeys;enterslave=grabkeys;leaveslave=collapse,ungrabkeys;button1=menuprint;button2=togglestick;button3=exit:13;button4=scrollup;button5=scrolldown;key_Escape=ungrabkeys,exit' -x 1000 -w 920 -l 10 -u -h 14 -title-name "pcw_notify_dzen" -fg '#b20033' -bg black -fn "monospace-10" | while read line; do
		path="$(echo "$line" | cut -d '|' -f 1 | sed "s/ *$//")"
		channel="$(basename "$path")"
		urxvt -title "$path" -e srw -p "$channel> " cw_color.sh "$path/out" "$path/in" "$NICK" &
	done > /dev/null 2>&1 &
fi

line="$(printf "%-30s" "$CHAN") | $(tail -n 1 "$CHAN/out")"
echo "$line" >> "$FILE"
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.