| |
|
CD-Player
This page has Scripts to play audio CDs with Audacious.
|
I use two diffferent scripts, one for use with mounting links set up in fstab,
the other for when you are using HAL/dbus and the links on your desktop ship a
device name to the program (the script) you link to that shortcut.
|
Background - Audacious and audio CDs
You can start audacious and open a CD, if you have configured the path to your CD player within
Audacioius (editing the Audio CD plugin.) -- Bit of a hassle, that, especially if
you have a couple players and switch or don't want to dig around the configuration...
Audacious config file wants the device and directory (mount point) for the audio CD. My scripts
are very Absolute-11.1.x specific, so I won't bother to post them here for general use, except as an
example of how to set up on your own system.
fstab generated links
My CD-scripts send the bare device name to the first Audio CD script. (ie. cdrom, dvd, etc)
#!/bin/bash
# Audio CD playing script for use with old-style /dev and /mnt points.
# Called from CDArray scripts that are used when not auto-mounting.
#
caller=$1
if [ "$caller" = "" ]; then
exit
fi
cfile="$HOME/.config/audacious/config"
if [ ! -e "$cfile" ]; then
cp /usr/share/audacious/config.sample $cfile
fi
mdev=/dev/$caller
mdir=/mnt/$caller
dv=`grep "^device=" $cfile`
dr=`grep "^directory=" $cfile`
cat $cfile | sed s!"$dr"!"directory=$mdir"!1 > $cfile
cat $cfile | sed s!"$dv"!"device=$mdev"!1 > $cfile
audacious $mdir&
exit 0
HAL generated links
The HAL/dbus version accepts the device name as generated by HAL:
#!/bin/bash
#
# this script will reconfigure and play an audio CD with Audacious using DeviceManager
# ie: dbus/HAL and the automountying crew :)
#
mdev=$1
mdir=/media/cdrom
if [ "$mdev" = "" ]; then
exit
fi
if [ ! -e "$HOME/.config/audacious/config" ]; then
cp /usr/share/audacious/config.sample $HOME/.config/audacious/config
fi
dv=`grep "^device=" $HOME/.config/audacious/config`
dr=`grep "^directory=" $HOME/.config/audacious/config`
cat $HOME/.config/audacious/config | sed s!$dr!directory=$mdir!1 > $HOME/.config/audacious/config
cat $HOME/.config/audacious/config | sed s!$dv!device=$mdev!1 > $HOME/.config/audacious/config
audacious $mdir&
exit 0
|