You are not logged in.
Pages: 1
I have a script that automates making and installing packages from the AUR. Is there a way to make it play a sound or give me a pop in X when it is finished?
The script is iphitus' and is as follows:
#! /bin/bash
# AUR Package installation script
# run as:
# aur
# James Rayner < iphitus@gmail.com >
. /etc/rc.d/functions
stat_busy "Downloading PKGBUILDs"
wget -q http://aur.archlinux.org/packages/$1/$1.tar.gz
if [[ $? -eq 0 ]];
then
stat_done
status "Extracting PKGBUILD" tar -zxvf $1.tar.gz
rm $1.tar.gz &> /dev/null
cd $1
if [[ $UID = 0 ]]; then
stat_busy "Making Package"
exec makepkg -fi
else
stat_busy "Making Package"
exec makepkg -f
fi
else
stat_fail
echo " Package Unavailable"
fi
I know it's not a necesary thing, but when the comp is working on a particularly long project I tend to wander off and do something else. It would be convenient to not have to look over every couple of minutes to see if it's done yet.
Thanks.
Offline
You can use the WAIT command to wait for all background processes in your script to finish before performing an action.
So you'd have e.g.
[your script]
wait
player sound.mp3
I don't know how to easily do a popup in X, but to play you'll have to specify a player and a soundfile. If you don't want to play the sound in your default music player (since it's a bit of an arse having Amarok/XMMS/MPD stop playing music just to beep at you ) then personally I'd advise using sox - it's a tiny CLI player, great for sounds like this. You'd then just do sox soundfile.mp3, and soxmixer lets you change settings
Hope that helps.
Komodo
.oO Komodo Dave Oo.
Offline
Thanks for the help
Offline
No problem mate
.oO Komodo Dave Oo.
Offline
Pages: 1