irc is a script
This commit is contained in:
parent
fd12dbb5f6
commit
47803671db
@ -7,6 +7,7 @@ fi
|
||||
alias git="GPG_TTY=\$(tty) git"
|
||||
alias gitfixlast="git rebase -i \$(git log | grep '^commit ' | head -3 | tail -1 | cut -d' ' -f2) && git push -f"
|
||||
alias gitcommitfix="git add -u && git commit -m f && gitfixlast"
|
||||
alias gitpushnew="bash -c \"\$(git push 2>&1 | grep -P '^\s+git push' | perl -pe 's/^\s+//')\""
|
||||
|
||||
# KubeCtl
|
||||
if [ -x "$(command -v kubectl)" ]
|
||||
|
36
any/scripts/.local/bin/irc
Executable file
36
any/scripts/.local/bin/irc
Executable file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
function irc-notification {
|
||||
TYPE=$1
|
||||
MSG=$2
|
||||
|
||||
notify-send \
|
||||
-t 5000 \
|
||||
-u critical \
|
||||
--category IRC \
|
||||
--app-name=IRC \
|
||||
"$TYPE" \
|
||||
"$MSG"
|
||||
|
||||
if [ -f /usr/share/sounds/freedesktop/stereo/message-new-instant.oga ]
|
||||
then
|
||||
paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga
|
||||
fi
|
||||
}
|
||||
|
||||
notification_sound=""
|
||||
|
||||
listener_ssh_cmd="ssh weechat@weechat -- nc -k -l -U /tmp/weechat.notify.sock"
|
||||
|
||||
function get-irc-notifications {
|
||||
$listener_ssh_cmd | \
|
||||
while read type message; do
|
||||
irc-notification "$(echo -n $type | base64 -d)" "$(echo -n $message | base64 -d)"
|
||||
done
|
||||
}
|
||||
|
||||
get-irc-notifications &
|
||||
|
||||
trap "pkill -f '$listener_ssh_cmd'" EXIT
|
||||
|
||||
ssh -t weechat@weechat -- "~/weechat.sh"
|
@ -1 +0,0 @@
|
||||
238407d0-2588-44dc-a0ca-2fa9b75f4e74
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user