irc is a script

This commit is contained in:
Diego Fernando Carrión 2024-08-22 17:33:02 +02:00
parent fd12dbb5f6
commit 47803671db
No known key found for this signature in database
GPG Key ID: 811EF2E03998BFC4
7 changed files with 37 additions and 1 deletions

View File

@ -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
View 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"

View File

@ -1 +0,0 @@
238407d0-2588-44dc-a0ca-2fa9b75f4e74