PDA

View Full Version : Linux Lullaby


Tortanick
06-06-2007, 06:39 AM
If like me you have a a Linux computer with plenty of music on it, I figured out how to make it sing you a lullyably and shut down when you're ready :)

First shut down all programs save you're media player then create you're playlist and start the music, then as root or with sudo type

at now + 5min

It will ask you for instructions type

halt

then press ctrl-d to say done.

now the computer will shut down in 5 minuets, go to bed while its still playing.

If you want to keep you're computer on but turn off the music after 5 min do this.
Replace amarok with you're media player
ps ax | grep amarok
it will respond with something like

6942 ? Sl 0:05 amarokapp
6956 ? S 0:00 kio_file [kdeinit] file /tmp/ksocket-ben/klauncherAuMsoc.slave-socket /tmp/ksocket-ben/amarokulUYrb.slave-socket
6957 ? S 0:00 kio_file [kdeinit] file /tmp/ksocket-ben/klauncherAuMsoc.slave-socket /tmp/ksocket-ben/amarokFtmr9a.slave-socket
6958 ? S 0:00 ruby /usr/share/apps/amarok/scripts/score_default/score_default.rb
6959 ? S 0:00 kio_file [kdeinit] file /tmp/ksocket-ben/klauncherAuMsoc.slave-socket /tmp/ksocket-ben/amarokscbAsb.slave-socket
6960 ? S 0:00 kio_file [kdeinit] file /tmp/ksocket-ben/klauncherAuMsoc.slave-socket /tmp/ksocket-ben/amarokk0VUVb.slave-socket
6961 ? S 0:00 kio_file [kdeinit] file /tmp/ksocket-ben/klauncherAuMsoc.slave-socket /tmp/ksocket-ben/amarokOZCjfb.slave-socket
6978 pts/1 R+ 0:00 grep amarok

I never realised amarok used so many processes. Anyway you want the line with amarokapp, note the number at the beginning of the line, in this case 6942

Now do at now + 5 min you don't need to be root this time

when it asks for instructions type:
kill 6942
then press ctrl-d
after 5 minuets amarok will shut down. There may be a way to do this inside amarok but this method will work for any media player. If you're media player has many processes like amarok just try killing manually until you find the right one.

fleamailman
07-25-2007, 04:05 PM
thanks, I liked this idea very much.