Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-07-31 16:01:58

paolo321
Member
Registered: 2011-06-26
Posts: 121

xfce power manager and power button

I'm using Opensuse 11.4 with xfce 4.8
If I press power button, system just shutdowns, even if I've set xfce power manager to ask what to do.
This is something like http://forums.debian.net/viewtopic.php?f=6&t=52565

Anyway, I've not found anything related to OpenSUSE, and solutions posted there for Debian doesn't work here
(files mentioned there are not present in my system, and I've not found the correct ones)

Am I the only one experiencing this?

Greetings

Offline

#2 2011-08-02 02:11:09

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: xfce power manager and power button

What is the value of "power-button-action" in your "~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml" file. I believe the value to ask the user is 3. That's the value set in "/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml" where the default should be to ask.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2011-08-03 20:02:01

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfce power manager and power button

~> cat ~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-power-manager.xml

<?xml version="1.0" encoding="UTF-8"?>

<channel name="xfce4-power-manager" version="1.0">
  <property name="xfce4-power-manager" type="empty">
    <property name="power-button-action" type="uint" value="3"/>
    <property name="hibernate-button-action" type="uint" value="3"/>
    <property name="sleep-button-action" type="uint" value="3"/>
  </property>
</channel>

So, it should be correct , but it doesn't ask ...

Last edited by paolo321 (2011-08-03 20:02:36)

Offline

#4 2011-08-04 02:27:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: xfce power manager and power button

Perhaps you should file a bug report.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2011-08-13 02:09:00

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfce power manager and power button

I also have OpenSuse 11.4 and xfce 4.8 on a netbook.
I have this file : /etc/acpi/events/power_button
And to let Xfce control the power instead of acpi, edit it to :

event=button/power.*
#action=/usr/lib/acpid/power_button
action=/bin/true

What do you have in your /etc/acpi folder ? What the result of :
find /etc/acpi/

I just discover that we now have a wiki : https://wiki.xfce.org/tips?&#handle_acp … ut_options

Last edited by angstrom (2011-08-13 03:28:19)


Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...

Offline

#6 2011-08-13 10:36:34

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfce power manager and power button

Looked on that wiki...
I have the same exact file that you , but solution #2 from wiki ( /bin/true ) seems not working ...
solution #1 gives me some weird problems, I need to investigate more ...

BTW: did you have a solution also for locking screen after suspend or hybernate ? I made a custom zenity logout window, but I'd like a cleaner solution...

Offline

#7 2011-08-13 12:13:09

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfce power manager and power button

If "Solution #1" give you something ... it means that the /etc/acpi/event file is honored ? Then if you put /bin/true in the action field, it will at least do nothing when the power button is pressed. Is it the case ?


Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...

Offline

#8 2011-08-13 12:56:04

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfce power manager and power button

yes, putting /bin/true there it will do nothing on power button press, but xfce power manager does not detect power button, anyway...
acpi_listen shows

button/power PWRF 00000080 00000003

It's much like debian thread linked in my first post...
Version used is Xfce Power Manager 1.0.3

Running it with --debug only error I see is

(xfce4-power-manager:6886): xfce4-power-manager-WARNING **: could not map keysym 1008ffa8 to keycode

just near BUTTON_POWEROFF ...

Then, i tried to use Solution 1 with my custom logout menu done with zenity (I need screen locking on suspend or hibernate...)
And I just disabled Xfce Power Manager

I hit power button, and I see my zenity window... CORRECTLY !!!

I'm happy it's quite working... But I'm quite confused: this seems definitely a bug in Xfce Power Manager
... But then why you have the same configuration WITHOUT this problem? :-)

Thank you again really much, BTW !!!

Last edited by paolo321 (2011-08-13 12:56:40)

Offline

#9 2011-08-13 13:06:09

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfce power manager and power button

paolo321 wrote:

Version used is Xfce Power Manager 1.0.3

I have version 1.0.10 from Factory, maybe that is why ?


Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...

Offline

#10 2011-08-13 18:28:42

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfce power manager and power button

Tried to install 1.0.10-20.1 from tumbleweed and 1.0.10-54.3 from factory , no luck :-(

ACPI system from /etc/acpi works...
Xfce Power Manager works if i select manually an action, but not if I just press power button...

Tried on several virtual machines and on a physical PC ...
Tried also to install from scratch 12.1 milestone 3 xfce ...

After this, I don't know what I could try :-)

PS:
I could only use acpi scripts, making my own wrappers and custom actions, totally without Xfce Power Manager...
It's possible, yeah, maybe it would work (MAYBE) ... but I prefer to not reinvent the wheel :-)

EDIT:
I've been able to activate xflock4 from /etc/pm/sleep.d (to lock screen when suspend/hybernate)
but not to activate xfce4 session logout window from /etc/acpi/events when pressing power button

I'm quite confused, since these 2 things should happen out of the box, without problems ...

Last edited by paolo321 (2011-08-14 20:23:06)

Offline

#11 2011-08-17 00:28:38

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfce power manager and power button

Tried on several virtual machines and on a physical PC ...
Tried also to install from scratch 12.1 milestone 3 xfce ...

After this, I don't know what I could try :-)

Uhm ... go back to version 0.8.4 (available on Opensuse 11.3 repo).

I switched back the old version, which is HAL dependent, because this one have "Automatically Reduce brightness after a defined period" :-p
I know that is not a solution but ... maybe worth a try ?

Last edited by angstrom (2011-08-17 00:32:21)


Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...

Offline

#12 2011-08-17 02:10:06

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfce power manager and power button

It seems that xfce4-power-manager don't get the power button signal ... why : don't know. Try to google : could not map keysym 1008ffa8 to keycode

Otherwise, I manage to get a very ugly way to launch xfce4-session-logout with acpid :
In the /etc/acpi/events/power_button script, put :

event=button/power.*
action=/tmp/runme.sh

In the /tmp/runme.sh script, put :

#!/bin/bash

USER=xxxx  # < put here the user that is currentely login with xfce !!!
su -l $USER -c "DISPLAY=:0 /usr/bin/xfce4-session-logout" &> /tmp/out

Make sure to replace xxxx by your login name.
Make the script executable. Push the power button ? If nothing happen, see what in /tmp/out ...


Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...

Offline

#13 2011-08-18 07:01:29

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfce power manager and power button

I've found no useful information about "could not map..." , most people just say that they moved to use standard acpi tools and not xfce power manager.
Seems there are already bugreport in various distributions, maybe it will be fixed ...
I'm trying the script below to run commands impersonating logged in user, So I can show logout window on power button, or lock screen from /etc/pm/sleep.d ....

I have tried it a couple of times and it SEEMS to work, using it like
action=/usr/local/sbin/run-as-X-user.sh /usr/bin/xfce4-session-logout

Important: enable access to your X server with xhost +local:

#!/bin/bash

LOGGED_IN_USER=`ls -trl /tmp/.ICE-unix/ | tail -n -1 | cut -d' ' -f3`
NUM_X_USERS=`echo $LOGGED_IN_USER | wc -l`
# SESSION_MANAGER format determined analyzing current variable...
# DBUS_SESSION_BUS_ADDRESS found checking environment of xfce4-panel

if [ $NUM_X_USERS -eq 1 ]; then
su -c "export HOST=`hostname` ;
export SESSION_ID=`ls -t /tmp/.ICE-unix/ | head -n1` ;
export DISPLAY=:0.0 ;
export SESSION_MANAGER=local/$HOST:@/tmp/.ICE-unix/$SESSION_ID,unix/$HOST:/tmp/.ICE-unix/$SESSION_ID ;
export DBUS_SESSION_BUS_ADDRESS=`cat /proc/$(pidof xfce4-panel)/environ | tr '\0' '\n' | grep DBUS_SESSION_BUS_ADDRESS | cut -d '=' -f2-` ;
$*" $LOGGED_IN_USER
fi

Sources:
http://wiki.xfce.org/tips
https://bbs.archlinux.org/viewtopic.php?pid=757342
http://ubuntuforums.org/showthread.php?t=1059023

Last edited by paolo321 (2011-08-18 07:02:09)

Offline

#14 2011-12-08 11:42:38

Hobbs
Member
Registered: 2011-12-08
Posts: 2

Re: xfce power manager and power button

Hi

Just discovered the same problem in PCLinuxOS Xfce 2011.07 (Phoenix).

Found a solution that worked for me;

I have the file: /etc/acpi/events/power in which there is the line: action=/etc/acpi/actions/pm-fallback-shutdown. I simply deleted the word 'shutdown' from the end of that line, and saved the file.

Now the user specified options set in Xfce4 Power Manager (general options tab) function correctly when the power button is pressed.

Thought it might be some help.

Last edited by Hobbs (2011-12-08 15:01:48)

Offline

#15 2012-01-19 01:46:31

angstrom
Member
Registered: 2011-08-13
Posts: 267

Re: xfce power manager and power button

Hi,

Weird thing happen to my notebook. One day my power button don't work anymore (meaning power button configure to "Ask" when pressed, but nothing happen when it is pressed). I found out that it is fixed by switching off the Numlock in ~/.config/xfce4/xfconf/xfce-perchannel-xml/keyboards.xml

Here is my tests :
- Create new empty account : testa
- Login with testa. Configure to "Ask" when power button pressed
- Press "Power" => Logout dialog => Logout
- With root, change NumLock to "true" in /home/testa/.config/xfce4/xfconf/xfce-perchannel-xml/keyboards.xml
- Login with testa
- Press "Power" => nothing happen
- Logout with the Xfce menu
- Change back Numlock to "false"
- Login with testa
- Press "Power" => Logout dialog appear.

My xfce version (on OpenSuse 12.1, kernel 3.1.0, i686) :

exo                           0.6.2-63.1
gtk-xfce-engine               2.8.1-23.1
libthunarx-2-0                1.2.3-75.1
libxfce4menu-0_1-0            4.6.2-27.1
libxfce4panel-1_0-3           4.8.6-74.1
libxfce4panel-1_0-3-debuginfo 4.8.6-74.1
libxfce4ui                    4.8.1-34.1
libxfce4util                  4.8.2-34.1
libxfce4util-devel            4.8.2-34.1
libxfcegui4                   4.8.1-40.1
libxfconf-0-2                 4.8.1-29.1
libxfconf-devel               4.8.1-29.1
thunar                        1.2.3-75.1
thunar-doc                    1.2.3-75.1
thunar-volman                 0.6.0-36.1
xfce4-appfinder               4.8.0-27.1
xfce4-dev-tools               4.8.0-34.1
xfce4-icon-theme              4.4.3-31.1
xfce4-mixer                   4.8.0-38.1
xfce4-notifyd                 0.2.2-36.1
xfce4-panel                   4.8.6-74.1
xfce4-panel-doc               4.8.6-74.1
xfce4-power-manager           1.0.10-73.1
xfce4-session                 4.8.2-96.1
xfce4-settings                4.8.3-47.1
xfce4-taskmanager             1.0.0-25.1
xfce4-volumed                 0.1.13-20.1
xfce-utils                    4.8.3-34.1
xfconf                        4.8.1-29.1
xfdesktop                     4.8.1-3.6.1
xfwm4                         4.8.3-51.1
xfwm4-doc                     4.8.3-51.1
xfwm4-themes                  4.6.0-29.1

It's really weird that keyboard numlock is messing with power manager ... It would be great if someone can confirm this behavior.

EDIT: solved by applying a patch. See https://bugzilla.xfce.org/show_bug.cgi?id=8360

Last edited by angstrom (2012-01-19 23:34:39)


Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...

Offline

#16 2012-01-20 12:16:00

Hobbs
Member
Registered: 2011-12-08
Posts: 2

Re: xfce power manager and power button

Yes, can confirm, after the fix I mentioned above, I also had to ensure numlock was off for the shutdown dialogue to work properly when pressing power button.

I'm back to using Gnome now so can't really comment further except I remember at the time the behaviour was slightly different on two different computers; on an Asus 1001HA netbook the numlock light was on at boot and stayed on until manually switched off, but on a Dell Inspiron 6400 numlock was off at boot but did indeed mess up the shutdown dialogue if I switched it on (both using xfce at the time obviously).

Last edited by Hobbs (2012-06-10 21:15:44)

Offline

#17 2012-02-17 08:34:45

paolo321
Member
Registered: 2011-06-26
Posts: 121

Re: xfce power manager and power button

Hi, sorry if I stayed away for a while from my own post :-)

In the meanwhile, I used Xubuntu Oneiric 11.10 on my netbook, and power button works (probably because I've not numlock on by default, but I cannot remember exactly)
Tried just now in a virtual machine, and I can confirm: power button works only without numlock...

Really really weird :-)

Offline

Board footer

Powered by FluxBB