While playing around with MQTT I wanted to have desktop notifications if something is going on. Adam Rudd made a solution with Growl for OS X. For a Linux system the first thing that comes to my mind is zenity
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
#!/bin/sh # # Copyright (c) 2013 Fabian Affolter <fabian at affolter-engineering.ch> # # Released under the MIT license. # BROKER=127.0.0.1 TOPIC='test/#' mosquitto_sub -v -h $BROKER -t $TOPIC | while read line; do topic=`echo $line | sed -e "s| .*||"`; message=`echo $line | sed -e "s|test/mqtt ||"`; zenity \ --notification \ --window-icon="info" \ --text="$message (Topic: $topic)"; done |
The subscription client from mosquitto works well for that purpose.
Pingback: Desktop notifications for MQTT messages | bits and pieces