« ALSA sound on my Thinkpad 600 | Main | PSP v1.50 Homebrew News »

Automating the Thinkpad

Well, after I finished getting the ALSA drivers to load without locking up my system last week, I went ahead and dug a little deeper to get the mixer levels, power management, and ::gasp:: wifi settings to work correctly. All it took was a little time and refreshing my memory on the command line arguments used to do both.

I believe that there is probably a better way to do this, but I decided to have my mixer settings and power management in auto.sh and my wifi in wifi.sh. wifi.sh is called from auto.sh. The scripts are listed below.

:::auto.sh:::

#!/bin/sh
# Set the mixer settings to correct volume and unmute
amixer -c 0 sset Master\ Digital,0 80% unmute
amixer -c 0 sset Synth,0 100% unmute
amixer -c 0 sset PCM,0 100% unmute
# Set the APM variables for Hard Drive Spin Down
hdparm /dev/hda
hdparm -S 60 /dev/hda
# This is supposed to call the wifi.sh script to set wifi
./wifi.sh &
# Open a fresh xterm window
xterm &


:::wifi.sh:::

#!/bin/sh
# Reset the PCMCIA card
cardctl reset
# Set the wireless settings for the card
iwconfig eth0 essid "myssid"
iwconfig eth0 enc myweppassword
ifconfig eth0 up
# Reset the PCMCIA card once again for good measure
cardctl reset
# This will call out to the router for a DHCP assigned IP
pump -i eth0

I set both of these scripts to run on the login of root into the system. I am going to migrate them over for my daily use account. Since they are initialized on login, there were some places that I had to point to these scripts in two seperate inisitalization files.

They were both located in the user's home directory, in this case /root/. The first is /root/.libranet/startup_programs

I added ./auto.sh there

The second was in /root/.fluxbox/init

Here I made the rootCommand = ./wifi.sh

I understand that right now it looks as though the wifi.sh is the only one running, but my ALSA settings and APM settings are both working also, so I am not going to mess with something that works.

TrackBack

TrackBack URL for this entry:
http://www.wifi-secured.com/cgi-bin/mt/mt-tb.cgi/9

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on June 21, 2005 2:59 PM.

The previous post in this blog was ALSA sound on my Thinkpad 600.

The next post in this blog is PSP v1.50 Homebrew News.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.