Advertisement
tobast

DISTANT_fnotify_pipe.sh

Sep 29th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. NOTIF_ICON="/usr/share/icons/custom/bubble-64.png"
  4. FNOTIF_FILE="/home/irssi/.irssi/fnotify"
  5. IRC_HOST="login@server"
  6.  
  7. stat=255
  8.  
  9. while (( $stat == 255 )) ; do
  10.  
  11.     ssh "${IRC_HOST}" -o PermitLocalCommand=no -o ServerAliveInterval=10 \
  12.         ": > $FNOTIF_FILE ; tail -f $FNOTIF_FILE" | \
  13.         while read head mess; do
  14.             notify-send -t 4000 -i "${NOTIF_ICON}" "IRSSI" "<b>&lt;${head}&gt;</b> ${mess}";
  15.             aplay -q "./msg.wav";
  16.         done
  17.  
  18.     stat=${PIPESTATUS[0]}
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement