1 Startup Sounds with SLiM
2 ========================
3 :author: Aaron Ball
4 :email: nullspoon@iohq.net
5
6
7 == {doctitle}
8
9 For a pretty long time I've been running Xfce for my desktop and SLiM as my
10 login manager to save on boot time. This weekend though, I decided that a
11 second or two added to my boot time wouldn't bother me too much if it made my
12 system a little less utilitarian.
13
14 Inevitably, the first places to look are (completely unecessary, yes I know) a
15 fancy theme for Xfce (sprinkle a little transparency in there to taste), new
16 icons, cool theme for my login manager, and a startup sound.
17
18 Most of that was really easy. The startup sound on the other hand is something
19 not so well documented (especially with SLiM). I dabbled around a bit and had
20 an idea that believe it or not, worked on the first try.
21
22 First off, I hit up good 'ol gnome-look.org for some system sounds to try out
23 and settled finally on the
24 http://gnome-look.org/content/show.php/%22Borealis%22+sound+theme?content=12584[Borealis
25 sound scheme].
26
27 Once you've got the sound file you want (I used Exit1_1.wav for mine), actually
28 getting it to run on startup is actually really simple. All you need to do is
29 add a line to your rc.conf file that has mplayer open up your sound you want
30 played. For example...
31
32 ----
33 mplayer /home/username/.sounds/Exit1_1.wav
34 ----
35
36 One minor thing here for you SysV users out there you don't have an rc.local
37 file. To do this with a system that uses System V for initialization (Debian,
38 most forks of Debian I believe, Fedora, etc.), you need to create a script at
39 */etc/init.d/local* (you can call it whatever, but for the purposes of this,
40 we'll call it local). Once the script is created, add the following lines
41 (referencing my example above)...
42
43 ----
44 #!/bin/sh
45 mplayer /home/username/.sounds/Exit1_1.wav
46 ----
47
48 Now that we've added those, we need to run
49
50 ----
51 update-rc.d /etc/init.d/local defaults 80
52 ----
53
54 and you should be good to go.
55
56 Now, there is one concern here that could potentially cause some issues.
57 If you shut your computer down with the volume turned up, when your
58 computer boots back up again, you'll get a nice loud system startup
59 sound. To remedy this, we simply need to reset our volume before we call
60 mplayer in our script. To do this, we just add the following line before
61 the mplayer line:
62
63 ----
64 amixer set Master 30%
65 ----
66
67 That sets our volume to 30%. If you want to set it higher or lower, you can
68 just change that percentage value.
69
70 Category:Linux
71 Category:SLiM
72
73
74 // vim: set syntax=asciidoc:
|