Tips, Tricks, Scripts, etc
Kernel config
I'm still working on the perfect kernel config, but here's what I have so far. This is a kernel derived from a few sources and tweaked by me, hopefully nothing unecessary within. If you use any type of external USB devices you might have to add them back in.
The main reason for this is to reduce the number of modules and to give me more flexability with drivers such as IPW3945. You still need to have an initrd for this kernel, so probably best to do the final installation of the kernel using the built-in make install when finished doing make bzImage modules modules_install as normal.
The config is here for 2.6.23.1. (Last updated 11/12/2007)
One caveat, and I'm not sure how to fix it yet. You might need to set root=/dev/device instead of root=LABEL=/ in grub.conf with this kernel, but other labels in fstab are fine. Not sure yet why this is, the parred-down Redhat config I was using was fine, so there must be some option somewhere I'm missing. This might not longer be a problem, but I used to have to do this every time; now a label works fine. Go figure.
Just to be clear, this is not necessary for proper function of the V100 under Fedora Core 6/7/8. However, if you like to tweak your kernel, compile in modules, use different kernel patches, etc, you can start with this basic config. I still plan on compiling in more modules (IMO if it's used 100%, compile it in, so long as it doesn't need unloading for suspend etc).
(Last Modified 11/11/2007 19:08)
ACPI Suspend
Gathering some various information on the web, I've put together a ACPI Suspend script which seems to work pretty well, and even works perfect on the stock Fedora Core 6 kernel. Basically just need to stop a few services and unload a few modules before suspending.
Suspend to ram and disk seems to work rather well. Speed is very acceptable for suspend to disk, and suspend to ram happens almost immediately.
Only caveat is gkrellm crashes sometimes on restore, I think it is the CPU monitor plugin I am using. This was most definitely a CPU plugin, I've disabled it and no gkrellm problems since.
The script can be downloaded here and should hopefully work for you without any caveats. It defaults to suspend to ram, but if you pass it an argument of hibernate it will suspend to disk. I can run this from X or console and it should work fine. If you run this from console, you'll want to edit the last commands in the script to perhaps go to vt 2 and back rather than vt 7 (where X is for me). If you have any suggestions, send them on.
The script does a few various things that I want it to do which you might have no interest in... I've commented those types of things in the script itself.
(Last Modified 10/11/2007 20:26)
Media key assignments
The V100 has multimedia keys on the top of the keyboard as well as on some Fn key combinations, and below is how I'm using them. You can then assign these keys in your favorite programs as the associated F key listed, such as the Stop key is F15.
# Decrease Vol key near LCD
xmodmap -e 'keycode 174 = F13'
# Increase Vol key near LCD
xmodmap -e 'keycode 176 = F14'
# Stop (Fn-Up)
xmodmap -e 'keycode 164 = F15'
# Play (Fn-Down)
xmodmap -e 'keycode 162 = F16'
# Back (Fn-Left)
xmodmap -e 'keycode 144 = F17'
# Forward (Fn-Right)
xmodmap -e 'keycode 153 = F18'
# Mute (Fn-Esc)
xmodmap -e 'keycode 160 = F19'
And if the caps lock key annoys you as it does me, you can convert it into a control key with the following:
xmodmap -e 'remove Lock = Caps_Lock'
xmodmap -e 'keysym Caps_Lock = Control_L'
xmodmap -e 'add Control = Control_L'
Easiest way to use this is to put the commands into your .Xclients, .xinitrc, or a Desktop Environment startup script (such as ~/.kde/Autostart/startup for an example)
(Last Modified 3/8/2007 21:51)
ACPI Event script
I've had an ACPI event script for several years now to automagically tweak the CPU speed, brightness, hard drive APM, etc. I've tweaked it to work nicer with the V100. Unfortunately even with the 6 hour battery, I don't quite get 4 hours under light use (wireless, ssh, a little web browsing). There might be additional things to tweak to help in this regard. The V100 seems to let me spin the disks down better than my old laptop, a Sony SRX87, not sure what the differences are. The Sony would spin back up all the time, where the V100 seems to stay completely off until I force something to load. I haven't left the machine idle and watched it to see how long it'll stay inactive, but so far it seems good.
So this script turns down the max CPU (to 1ghz) when off AC, turns the brightness down to 30 (minimum, but usable) and turns on hard drive APM, restores them when back on AC, turns everything down as much as possible when the lid is closed (see bootnote), suspends the laptop when the power button is pressed and Hibernates when the Suspend (Fn+F4) sequence is pressed (see my Suspend script). In case you're wondering, the Fn+F12 (Hibernate) sequence doesn't seem to create an ACPI event, so this setup works for me and is very easy to change.
You can grab the file here which is the action.sh and an event file. They should go into your /etc/acpi directory. Please make sure the script matches your laptop in terms of where the CPU information is, batteries, etc. Beyond that, run tail -f /var/log/acpid and see if the script works. If you need help tweaking it, let me know.
As a bootnote, here's the other keys which do not create ACPI events:
- Lid open event (the lid close event "completes" but I can't seem to catch this in my ACPI action script?) -- CORRECTION, had conflicting scripts, this is fine now!
- Fn-F12 (Hibernate) - Does not seem to create an ACPI or XEV event
- Fn-F7 (switch monitor) - Does not seem to create an ACPI or XEV event
(Last Modified 3/8/2007 21:47)
Battery shutdown script
Don't miss my script in the parent of this section, Linux, as it contains a nice battery script tailored for the V100 to shut down nicely when the battery gets too low. Currently it's set to shut down, but I'll be modifying it for hibernation soon.
If you run a DE like Gnome or KDE, they can handle this themselves but not in a very flexible way. For instance if I am not paying attention and my battery level gets critical, KDE will immediately shut the laptop down. With my script, I have some minutes of warning before this happens and if I plug it into the AC the machine doesn't shut down on me.
(Last Modified 3/7/2007 11:30)