LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-20-2012, 07:59 PM   #1
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
What is the "proper" way to disable acpi from grabbing the xf86power in X sessions.


Hello all,

Was wondering if there was a way to modify the acpi scripts such that the acpi daemon does grab the xf86 power button from a run level 3 with no X session running ; but if a user is logged into XFCE or KDE run level 4 then acpi ignores the power button press and allows the desktop environment's power management to manage the power button keypress.

Any ideas?
 
Old 01-22-2012, 12:11 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Sorry to see you suffering with zero replies. I found a couple of threads with maybe some bits of relevance:
https://bbs.archlinux.org/viewtopic....27665#p1027665
http://forums.fedoraforum.org/showthread.php?t=228242
https://bbs.archlinux.org/viewtopic.php?id=74806
http://www.thinkwiki.org/wiki/How_to...l_keys_to_work

It seems to me that you need to add some code in rc.4 which will disable the power button keycodes when starting X, using xbindkeys or xmodmap. Or maybe it would be better to figure out how to do that in xorg.conf or a fragment in xorg.conf.d

Hope this helps you a bit. I know you're an old pro (as well as fogie), so I won't try to hold your hand...
 
Old 01-29-2012, 05:42 AM   #3
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Original Poster
Rep: Reputation: 63
Thanks gnashley for your help, I'm making progress on this, but it's not post ready yet. /fingers-crossed
 
Old 01-29-2012, 08:31 AM   #4
tty13
Member
 
Registered: Aug 2006
Distribution: Slackware64-14.2
Posts: 50

Rep: Reputation: 7
Hi, you could check if /var/run/kdm.pid exists in your /etc/acpi/acpi_handler.sh and react from there.

Last edited by tty13; 01-29-2012 at 08:57 AM.
 
Old 02-19-2012, 12:00 PM   #5
tty13
Member
 
Registered: Aug 2006
Distribution: Slackware64-14.2
Posts: 50

Rep: Reputation: 7
Hi again,
here is what I'm using now:

/etc/acpi/acpi_handler.sh
Code:
#!/bin/sh
user=$(who|grep " :0 "|cut -d" " -f1)
case "$1" in
  "button/power")
    if [ ! "$user" ];then
        /sbin/poweroff
    fi
    ;;
  *)
    logger "ACPI group $1 / action $2 is not defined"
    ;;
esac
edit: the format goes away
NeoMetal thank you!

Last edited by tty13; 02-19-2012 at 12:27 PM.
 
Old 02-19-2012, 12:17 PM   #6
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 114

Rep: Reputation: 24
Use [?code][/code?] tags instead of quote to keep code formatting. - the '?'s of course
 
Old 03-02-2012, 10:44 PM   #7
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Original Poster
Rep: Reputation: 63
tty13

Fantastic! This indeed does work. I've been using it daily for a week now, and it has been flawless.

Thank you!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the "proper" way to completely disable IPv6? narz Slackware 8 03-16-2011 10:49 PM
"bad_pool_error" & "Your system is not fully acpi compliant get your Bios updated" errors in WinXP Aquarius_Girl General 10 07-30-2010 11:27 AM
ACPI S3 (so-called "Standby" or "Sleep") in GNU/Linux posix_memalign Linux - Laptop and Netbook 1 01-17-2009 01:54 PM
How do I disable "shutdown" and "restart" options in KDE logout screen for all users? maxgsp Linux - Distributions 1 12-12-2008 03:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration