]> git.llucax.com Git - personal/ion3-config.git/blob - psi_status.sh
Bugfix: don't assume the two MPD responses will come as one in statusd_mpd.
[personal/ion3-config.git] / psi_status.sh
1 #!/bin/sh
2
3 psi_profile_dir=~/.psi/profiles/luca
4
5 events_files="$psi_profile_dir"/events-*.xml
6 regex='^\s*<jid'
7
8 msgs=`egrep "$regex" $events_files | wc -l`
9 jids=`egrep "$regex" $events_files \
10                 | sed 's/.*<jid>\(.*\)<\/jid>.*/\1/' | sort -u`
11 if [ $msgs -eq 0 ]
12 then
13         echo "nada nuevo"
14 else
15         [ $msgs -gt 1 ] && pl=s
16         echo "$msgs mensaje$pl nuevo$pl (de $jids)"
17 fi