Ever wanted you laptop to just do one thing?
You want to turn it on and it should just play music?
But it takes ages
- to boot,
- then you have to login
- wait again
- then start the music app
- press play
I did modify my Fedora to allow an alternative bootup that does just that, but automatically:
in grub.conf:
title Fedora Core root (hd0,1) kernel /boot/vmlinuz-2.6.18-1.2257.fc5 ro root=LABEL=/ quiet initrd /boot/initrd-2.6.18-1.2257.fc5.img savedefault title Please, play some music for me. root (hd0,1) kernel /boot/vmlinuz-2.6.18-1.2257.fc5 ro root=LABEL=/ quiet nonetwork music initrd /boot/initrd-2.6.18-1.2257.fc5.img
In /etc/init.d/network, quite at the beginning:
if grep -i nonetwork /proc/cmdline >/dev/null; then exit 0 fi
In /etc/X11/prefdm, quite at the beginning:
[ -f /etc/X11/switchlogin.sh ] && /etc/X11/switchlogin.sh
That file looks like this:
#!/bin/sh XDM=/etc/X11/xdm if grep -i music /proc/cmdline >/dev/null; then sed 's/AutoLoginUser=user/AutoLoginUser=music/g' < $XDM/kdmrc.orig > $XDM/kdmrc else cat $XDM/kdmrc.orig > $XDM/kdmrc fi
It switches between the user user and the user music, kdmrc.orig contains my normal bootup setup.
What is still missing is to add the following shell script to the user music’s startup (I gave him gnome):
#!/bin/sh setxkbmap de_neo rhythmbox & sleep 4; rhythmbox --play & sleep 4; rhythmbox --play & sleep 4; rhythmbox --play &
Sometimes the prog takes a time to startup.
Bottom line: Start the laptop, select the music startup, close the laptop, connect the earphones, put it in the backpack, and after some time, it starts to play.
Recent Comments