audible status indicators

Tim Chase blinux.list at thechases.com
Sun Nov 23 00:55:56 UTC 2014


While I don't have a Fedora box on hand to test with, for startup, it
sounds like you should be able to do as you describe and edit (as
root) the /etc/{,rc.d/}rc.local and put in an aplay line.  On my
Debian box, it's /etc/rc.local and the last line contains "exit 0" so
I'd do something like

  sed -i.bak '/exit 0/iaplay /path/to/i_am_alive.wav' /etc/rc.local

which will insert an aplay command right before the program exits.

For the sleep/resume (again, at least according to my Debian box), as
root you should be able to create a script in /etc/pm/sleep.d/
something like

cat > /etc/pm/sleep.d/22notify.sh <<EOF
#!/bin/sh

. "${PM_FUNCTIONS}"

command_exists aplay || exit $NA

case $1 in
    suspend|hibernate) aplay /path/to/goodnight.wav ;;
    resume|thaw)       aplay /path/to/goodmorning.wav ;;
    *) exit $NA ;;
esac
exit 0
# end of script
EOF


Then make it executable

  chmod ugo+x /etc/pm/sleep.d/22notify.sh

The "22" is just some arbitrary number that puts it in the "we're
pretty much ready" time-frame.  Anything between 1 and 49 should be
fine.

-tim


  

On November 23, 2014, prayner wrote:
> I've just started using a machine without a hard disk. It's suddenly
> much more difficult to work out what state it's in when resuming
> after suspend, rebooting etc. I would like to add a few auditory
> indicators for key and common steps (like these). The boot-up
> earcon wouldn't b necessary *if* I could get gdm to come up talking
> but that isn't working under my fedora 20 system.
> It's also important that whatever I do doesn't finish up with
> someone else (probably root) owning the sound hardware and locking
> out the pulseaudio instance I will soon start up.
> Adding an rc.local file to /etc/rc.d with an aplay
> something-or-other should work for boot.
> 
> The resume-after-suspend is harder I think. I need to ensure, for
> example, that pulseaudio is in a good state for playing sound. I
> presume this is managed by acpi event handling?
> Has anyone else tried this?
> thanks in advance
> Peter
> 
> 
> -- 
> Peter Rayner
> room 343 
> School of Earth Sciences, University of Melbourne, 3010, Vic,
> Australia tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
> mobile +61 402 752 379, skype: petermorag 
> mail-to: prayner at unimelb.edu.au
> google scholar profile
> <http://scholar.google.com.au/citations?user=H3up71wAAAAJ&hl=en>
> 
> _______________________________________________
> Blinux-list mailing list
> Blinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/blinux-list




More information about the Blinux-list mailing list