hedgewars-chat-notify.sh (notify on new CHAT messages in multiplayer mode)

No replies
vn971
User offline. Last seen 9 years 41 weeks ago. Offline
Joined: 2015-11-13
Posts: 1

I created a simple script to launch `hedgewars` and get a Desktop notification on each CHAT message in multiplayer mode.

Note that it catches both public room chat and your gaming chat. (Normally, you don't see public chat once you joined a gaming room.)

The script: https://gist.github.com/vn971/25cb151003de756214ce

Content (may become outdated):

Quote:

#!/bin/bash -eu
hedgewars 2>&1 | (
while read -r LINE; do
if [[ "$LINE" == *CHAT* ]]; then
notify-send "$LINE";
echo "$LINE";
fi;
done;
)

Special thanks: the idea to catch stderr was suggested by nemo.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]