Wednesday, September 22, 2010

Palm not syncing

My Palm wasn't connecting correctly to my Linux netbook. I was getting some weird errors in the logs:

usb 2-1: new full speed USB device using uhci_hcd and address 2
usb 2-1: device descriptor read/64, error -71
usb 2-1: device descriptor read/64, error -71
usb 2-1: new full speed USB device using uhci_hcd and address 3
usb 2-1: device descriptor read/64, error -71
usb 2-1: device descriptor read/64, error -71
usb 2-1: new full speed USB device using uhci_hcd and address 4
usb 2-1: device not accepting address 4, error -71
usb 2-1: new full speed USB device using uhci_hcd and address 5
usb 2-1: device not accepting address 5, error -71
hub 2-0:1.0: unable to enumerate USB device on port 1


After hunting and hunting (and not saving the page that gave me the answer), I discovered this is related to a bug on the Palm. The page I found suggested a reset. So I did, and it synced up right after that.

Saturday, September 11, 2010

Screen Locking Shortcut in LXDE

I liked having a keyboard shortcut, ctrl-alt-l, to lock the screen under Gnome. But in LXDE, it was a bit trickier to setup. There isn't a fancy GUI for setting these options (that I know of), one has to edit Openbox's configuration file: ~/.config/openbox/lxde-rc.xml

Find the "<keyboard>" section and add the following:

<keybind key="C-A-l">
<action name="Execute">
<command>xscreensaver-command -lock</command>
</action>
</keybind>

Tuesday, September 7, 2010

Suspend on Lid Close with LXDE

LXDE has been great on my Asus EEE 1001P. It's fast and usable. I've had some issues with it, but the most frustrating problem is that Fedora 12 with LXDE doesn't suspend by default when you close the lid. I did some googling and discovered this is known and the easy to fix it is to install the gnome-power-manager. But that kind of defeats the point of LXDE, right? I'm trying to avoid installing and using gnome heaviness to stay lean and mean and fast.

So, after lots of googling around, I finally came up with the optimum configuration which uses what I hope are lighter-weight services.

First, I had to install acpid to respond to lid close/open events (my code is based on this post):
yum install acpid


I hunted through the LXDE source code and discovered that lxde-logout uses a dbus call to HAL to trigger the suspend. I found a great blog post describing how to do this from a script. I implemented that by doing creating the following files:

/etc/acpi/events/lid (update: don't put a dot in the filename for Fedora 14+, it seems a new version of acpid ignores all files with dots in their names)

event=button/lid
action=/etc/acpi/actions/lid.sh


/etc/acpi/actions/lid.sh

#!/bin/bash

# maybe this sleep isn't needed, but just to make sure the lid close event doesn't trigger immediate wake-up
sleep 2

# make sure the lid is closed
grep -q open /proc/acpi/button/lid/LID/state && exit 0

# suspend
dbus-send --system --dest=org.freedesktop.Hal --type=method_call --print-reply /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0