From 649f466d6496c9f8fe965215980c756d76b36eb3 Mon Sep 17 00:00:00 2001 From: Britney Fransen Date: Tue, 17 Sep 2013 16:19:13 -0500 Subject: LinHES-system: convert ripD_eject.sh and importfiles.sh to use msg_client.py for OSD. --- abs/core/LinHES-system/PKGBUILD | 6 +++--- abs/core/LinHES-system/importfiles.sh | 4 ++-- abs/core/LinHES-system/ripD_eject.sh | 33 +++++++++++++-------------------- 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD index ab8ef52..5cc8ca9 100755 --- a/abs/core/LinHES-system/PKGBUILD +++ b/abs/core/LinHES-system/PKGBUILD @@ -1,6 +1,6 @@ pkgname=LinHES-system pkgver=8.0 -pkgrel=15 +pkgrel=16 arch=('i686' 'x86_64') install=system.install pkgdesc="Everything that makes LinHES an automated system" @@ -88,7 +88,7 @@ md5sums=('8fc4b7c1ddf8f3c4d2266ce55086b4d4' '962a3e9eaba2d1466251b7ab0956705d' '1758aed160de64abfafb28a3a8f3390e' '33fbebbd546672cedd3c5e7350ab414e' - 'ea2eef75dceeea631085928c94e3191a' + 'c773d8caacba8fbd4968e8afe5137bc6' '3edef50a49a47694bf8add39cc160add' '5e17e0786afd891550a660f646076308' 'bc69a520add58ede9b060c73e67ace13' @@ -123,7 +123,7 @@ md5sums=('8fc4b7c1ddf8f3c4d2266ce55086b4d4' 'd14335afe7dafa035a70399210e0df1a' '503df99218373dfc75e7e7f5e449a44e' '4a1fda884dcd7d65fb2690fbdbd92a83' - 'e2e24dd59d5d576cc33feafb329fa302' + '2b7fe3b57592823a4c7e3ec132dcb7f4' '92950f0ffb1faf1ed64c6be2b8fbc3f6' '95c092f67036a361ef7a57436f44332e' '410795ef9039e4c6c0484e706ecfd567' diff --git a/abs/core/LinHES-system/importfiles.sh b/abs/core/LinHES-system/importfiles.sh index 61ad324..eb0e863 100755 --- a/abs/core/LinHES-system/importfiles.sh +++ b/abs/core/LinHES-system/importfiles.sh @@ -2,10 +2,10 @@ DVD_or_CD=`cat /proc/mounts |grep iso9660|awk '{print $2}'|tail -1` if [ "$DVD_or_CD" != "" ]; then - msg_client.py --msg "Copying files from $DVD_or_CD to /myth/video. Please wait..." --timeout 900 + msg_client.py --msg "Copying files from $DVD_or_CD to /myth/video..." --timeout 3600 /bin/cp -R $DVD_or_CD/* /myth/video/ msg_client.py --kill - msg_client.py --msg "Copied videos from $DVD_or_CD to /myth/video" + msg_client.py --msg "Finished copying from $DVD_or_CD to /myth/video." else msg_client.py --msg "No optical media found. If you just inserted media please wait a moment and try again.|middle" fi diff --git a/abs/core/LinHES-system/ripD_eject.sh b/abs/core/LinHES-system/ripD_eject.sh index 99947a8..715d0dd 100755 --- a/abs/core/LinHES-system/ripD_eject.sh +++ b/abs/core/LinHES-system/ripD_eject.sh @@ -12,37 +12,30 @@ LOG='/var/log/mythtv/ripD.log' # name of Log file. TRACK=$(lsdvd | grep -i longest | awk '{print $3}') #Finds longest track FILE=$TITLE #----------------------------------------------------------------------- -FONT="-adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-*" -OPTS="-f $FONT -s 2 -p bottom -A left -i 50 -l 4" -#----------------------------------------------------------------------- [ -r /etc/rip.cfg ] && . /etc/rip.cfg #----------------------------------------------------------------------- LOCK=/tmp/.ripLock.$$ [ "$DISPLAY" == "" ] && export DISPLAY=:0 ######################################################################## -function osd { # $1=text, $2=color, $3=delay - cmd="osd_cat $OPTS" - [ -n "$2" ] && cmd="$cmd --color=$2" - [ -n "$3" ] && cmd="$cmd -d $3" - killall osd_cat - echo -e "$1" | $cmd +function osd { # $1=text, $2=delay + msg_client.py --kill + msg_client.py --msg "$1" --timeout $2 } >& /dev/null function osd_loop() { FN=$1 ; shift -# TXT="$MAX to $dir" - TXT="$MAX to $dir/$FILE" + TXT="to $dir/$FILE" N=0 while [ -f "$LOCK" ]; do - #osd "\nbacking up DVD: '$@'\n$TXT" gray 60 - osd "\nbacking up DVD: '$TITLE'\n$TXT" gray 60 - N=$(($N+1)) - [ -d "$FN" ] && SIZE=$(du -sh $FN | awk '{print $1}') + osd "Backing up '$TITLE' $TXT" 70 + N=$(($N+1)) +# [ -d "$FN" ] && SIZE=$(du -sh $FN | awk '{print $1}') # TXT="$SIZE of $MAX @ $N min. elapsed" - TXT="$N min. elapsed" + TXT="($N min. elapsed)" + sleep 60 done } ######################################################################## -LinHES-osd "\nDetecting DVD" gray20 5 & +osd "Detecting DVD..." 60 & echo "`date` detected DVD" >> $LOG rm -f /tmp/.ripLock.* #======================================================================= @@ -54,13 +47,13 @@ done #----------------------------------------------------------------------- if [ ! -d "$dir" ]; then echo "no $dir" >> $LOG - osd "\ndirectory: $dir\nnot found!" red 10 & + osd "$dir Not Found!" 10 & eject ; eject exit 0 fi if [ ! -w "$dir" ]; then echo "$dir not writable" >> $LOG - osd "\ndirectory: $Cdir\nnot writable!" red 10 & + osd "$dir Not Writable!" 10 & eject ; eject exit 0 fi @@ -113,7 +106,7 @@ fi $COMMAND # Finish: rm -f $LOCK - osd "\nfinish DVD: '$TITLE'\ninto $dir/$FILE" gray20 5 & + osd "Done Backing up '$TITLE' to $dir/$FILE" 5 & sleep 1 ; aplay $Esnd # Eject the media: sudo eject ; sudo eject -- cgit v0.12