Anywhere Linux Ubuntu - audible notification

#1

On ubuntu desktop, I get a notification with a small pop up window. I guess this is part of my Unity desktop. But I need a notification sound. I found a way to get that functionality with a shell script. It looks at one of the RA log files and when the mod time changes it uses vlc to play a file with a beep sound.
It’s interesting, there are several log files. I used each one of them and I choose this one. When my RW phone get a call this log file changes.
#!/usr/bin/ksh

republicbell.sh

ring the bell when there is a new text from republic anywhere

PATH=.:/home/rich/bin:/usr/local/bin:/usr/bin:/bin

cd /home/rich/bin

RA_DIR="/home/rich/.config/Republic Anywhere/139de40d-acc7-416e-90d6-d71f2f18fdf8/db/events"
LOG_FNAME="*.log"
MP3_FILE=tos_communicator_beep.mp3

lasttime=1

sleep 1
while true
do
ra_running_cnt=$(ps -ef|fgrep republicanywhere|grep -v grep|wc -l)
newtime=$(ls -l --time-style="+%s" “$RA_DIR”/$LOG_FNAME|cut -d" " -f6)

    if test $newtime -gt $lasttime -a $ra_running_cnt -gt 0
    then
            echo $newtime
            cvlc --no-repeat --no-loop $MP3_FILE 2>/dev/null 1>&2 &
            procid=$!
            sleep 2
            kill $procid
            lasttime=$newtime
    fi
    sleep 1

done

3 Likes

Official Republic Anywhere Feature Request Thread
Message an
Expert customer