The power button is linked to a script in /etc/acpi called powerbtn.sh, which is run as the default Xandros user. powerbtn.sh calls dcop to send a signal to all open applications to get ready to close.
When your run any root-level KDE applications, (such as the root File Browser), this session is owned by the root user and as such the power button script silently fails because it doesn't have permission to read root's .ICEauthority file.
There are a few possible work-arounds – you can either delete the root user .ICEauthority file (manually or via the powerbtn script), change the powerbtn script to run dcop as root, or only send a dcop signal to user-level sessions. I went with the last option, as it works and was the first thing I tried. Which method is actually preferable is left as an exercise for the reader.
Using a text editor such as vi, open the file /etc/acpi/powerbtn.sh and look for the following line (around line number 8):
dcop –all-sessions –all-users ksmserver ksmserver logout 1 2 2 && exit 0
and change it to
dcop –all-sessions –user user ksmserver ksmserver logout 1 2 2 && exit 0
and save the file. Voila, power button is back!
As above, open /etc/acpi/powerbtn.sh and look for the line that executes dcop
dcop –all-sessions –all-users ksmserver ksmserver logout 1 2 2 && exit 0
and add the “sudo” command in front of it so that the line looks like this:
sudo dcop –all-sessions –all-users ksmserver ksmserver logout 1 2 2 && exit 0
This will cause dcop to run with root privileges, which will prevent any errors. Its less editing, but of course now you're running dcop as root and some users may prefer not to do this.
If you don't feel comfortable editing any system-level scripts, you can work-around the problem by getting rid of the .ICEauthority file that causes the powerbtn.sh script to break.
Simply open up a terminal window and type:
sudo rm /root/.ICEauthority
This file will be re-created each time you run a root-level KDE application, so you'll have to do this every time the power button stops working.