Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Eckhofer
tools
Commits
b1863ffb
Commit
b1863ffb
authored
Jul 04, 2013
by
Felix Eckhofer
🤹🏼
Browse files
add irssi-notify
parent
1b803377
Changes
1
Hide whitespace changes
Inline
Side-by-side
irssi-notify/irssi-notify.sh
0 → 100644
View file @
b1863ffb
#!/bin/sh
#
# irssi-notify, 2007, felix@tribut.de
HOST
=
"jason"
# where to connect to
FILE
=
"/home/irssi/.irssi/fnotify"
# on remote host
ICON
=
"
$HOME
/.local/share/icons/ksirc.png"
# on local host
ssh
"
$HOST
"
"tail -n 5
$FILE
; >
$FILE
; tail -f
$FILE
"
|
sed
-ru
"
s/&/
\&
amp;/g;
s/</
\&
lt;/g;
s/>/
\&
gt;/g;
s%(#[a-zA-Z]+ )<([^>]{0,20})>%
\1
<b>
\2
</b> %g
s%(https?://[^ ]+(
\.
[a-zA-Z]{1,3})?)%<a href=
\"\1\"
>
\1
</a>%g;"
|
# s%([a-zA-Z0-9+_-]+@[^ ]+\.[a-zA-Z]{1,3})%<a href=\"mailto:\1\">\1</a>%g;" |
while
read
heading message
do
notify-send
-i
gtk-dialog-info
-t
0
-u
critical
-i
"
$ICON
"
--
"
${
heading
}
(irssi on
$HOST
)"
"
${
message
}
"
done
notify-send
-i
gtk-dialog-info
-t
0
-u
critical
--
"CONNECTION LOST (irssi on
$HOST
)"
"The connection to
$HOST
was lost. Panic!"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment