LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 06-22-2012, 07:01 PM   #1
qweasd
Member
 
Registered: May 2010
Posts: 621

Rep: Reputation: Disabled
Power button action


I put Slackware on Zareason's Alto and started playing with power options. Trying to make power button to hibernate or bring up menu, but it just ain't happening. Regardless of settings in KDE it seems to instantly run shutdown.

Kind of off-topic, but should I expect all of the Fn- things to work? Brightness and sound level, for example, work great, while sleep and wifi do nothing. Looks like may be half of them work.
 
Old 06-22-2012, 07:08 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I had a similar problem with my netbook. I set up the XFCE power manager to hibernate the netbook when the power-button is pressed. This worked, but when waking up the netbook it shutted of the system after the wake-up finished. This was caused by the settings in /etc/acpi, the power-button was set up to shut down the system there.
 
1 members found this post helpful.
Old 06-22-2012, 07:21 PM   #3
qweasd
Member
 
Registered: May 2010
Posts: 621

Original Poster
Rep: Reputation: Disabled
Thanks! /etc/acpi was everything I needed.
 
Old 06-22-2012, 08:49 PM   #4
TommyC7
Member
 
Registered: Mar 2012
Distribution: Slackware, CentOS, OpenBSD, FreeBSD
Posts: 530

Rep: Reputation: Disabled
/etc/acpi/acpi_handler.sh is all you need. Just edit that script and set a different function for "power" under 'case "$2"'.

As for the Fn keys, check to make sure Action Keys, or Function Keys (different names on different motherboards) is set to <Enabled> in your BIOS too.
 
2 members found this post helpful.
Old 05-31-2017, 09:05 AM   #5
otsoga
LQ Newbie
 
Registered: May 2015
Location: Miami, FL
Distribution: Slackware 14.2
Posts: 12

Rep: Reputation: Disabled
Suspend

How should I edit /etc/acpi/acpi_handler.sh so that the system suspends when I press the power button?
 
Old 04-14-2018, 05:13 PM   #6
tkninja
LQ Newbie
 
Registered: Apr 2018
Location: US
Distribution: Arch Linux
Posts: 10

Rep: Reputation: 1
I don't know how you could edit /etc/acpi/acpi_handler.sh directly to do that, but you could just comment out everything in /etc/acpi/events/default, and have Xfce (or whatever GUI you use) manage the power button itself (that's what I did and it works just fine).
 
Old 04-14-2018, 05:52 PM   #7
gus3
Member
 
Registered: Jun 2014
Distribution: Slackware
Posts: 490

Rep: Reputation: Disabled
A while back, I was having trouble with X on my desktop: all mouse/keyboard input was ignored, so there was no way to exit X, not even Ctrl-Alt-F1 to switch to a text console. The only way out was the power button, but that incurred a power-cycle on every iteration of the bug-hunt.

The quick & dirty solution:

1. In /etc/acpi/acpi_handler.sh, change the "power" case to execute "/sbin/init 3".
2. "telinit 4" to launch X, powerbutton to kill X. No power cycle, plus it's just a whole lot faster.
 
Old 02-06-2023, 05:09 PM   #8
Fellype
Member
 
Registered: Jul 2013
Location: Guaratingueta / Brazil
Distribution: Slackware
Posts: 60

Rep: Reputation: 31
I know that this is an old post, but this is an useful question since the /etc/acpi/acpi_handler.sh file is always replaced when Slackware is reinstalled or in new installations.

The best solution I've found here was to do what TommyC7 said, but replacing

Code:
power) /sbin/init 0
simply by

Code:
power)
In this way, when pressing the power button on the keyboard the logout screen appears (with the options to turn off, sleep, restart, etc...) instead of turn of the PC instantly.
 
Old 02-07-2023, 10:09 AM   #9
ctrlaltca
Member
 
Registered: May 2019
Location: Italy
Distribution: Slackware
Posts: 323

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
If you don't have a use case for acpid, you can just disable it:

Code:
/etc/rc.d/rc.acpid stop
chmod -x /etc/rc.d/rc.acpid
 
  


Reply

Tags
power management



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
Looping action while button is pushed in Glade HaydenLovett Programming 1 12-18-2008 01:23 AM
Does default middle button action in Firefox 1.5 annoy you? KimVette Linux - Software 2 12-08-2005 02:30 PM
Middle mouse button action TheJkWhoSaysNi Linux - Software 1 03-25-2005 08:38 PM
Needs to push power button to power off? danpin Linux - Newbie 5 10-21-2003 08:08 PM

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

All times are GMT -5. The time now is 07:10 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