LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices



Reply
 
Search this Thread
Old 09-24-2013, 06:54 PM   #1
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Rep: Reputation: Disabled
Xscreensaver + systemctl suspend Perl script for power management in LXDE not working


I have Fedora 19 lxde and it does not come with any power management utilities. I tried downloading the xfce power manager but none of the changes I made had any effect, so now I'm trying to use Xscreensaver in conjunction with a Perl script I stole (never used perl) on the Xscreensaver website http://www.jwz.org/xscreensaver/man3.html to issue a standby command with systemctl:

Code:
#!/usr/bin/perl

my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while (<IN>) {
	if (m/^(BLANK|LOCK)/) {
                if (!$blanked) {
                        system "systemctl suspend";
                        $blanked = 1;
        }
}}

I run this script in the background and it actually works the first time the screensaver is triggered; however, after resuming from suspend, even though the script still appears to be running, it will no longer trigger in the future. How can I get it to reinitialize?

Last edited by Xenphor; 09-24-2013 at 06:57 PM.
 
Old 09-24-2013, 10:52 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
It seems you would want to make a daemon in perl, there is plenty of example code out there .. but my first suggestion would be to work out why xfce power manager isn't working, I run Fed19 with LXDE and I don't have any issues with it. Are there any messages in the logs related to ACPI ?
 
Old 09-27-2013, 11:49 PM   #3
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Original Poster
Rep: Reputation: Disabled
I have this:

Code:
$ dmesg | grep acpi
[    0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x02] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x04] enabled)
[    0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x06] enabled)
[    0.000000] ACPI: LAPIC_NMI (acpi_id[0xff] high edge lint[0x1])
[    0.149495] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.5
[    0.203258] acpi PNP0A08:00: Requesting ACPI _OSC control (0x1d)
[    0.203639] acpi PNP0A08:00: ACPI _OSC control (0x18) granted
[    0.211578] acpi root: \_SB_.PCI0 notify handler is installed
[    0.211614] Found 1 acpi root devices
[    0.395898] ACPI: Requesting acpi_cpufreq
[    0.572571] acpi device:50: hash matches
 
Old 09-28-2013, 08:03 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
Ok, so it looks like acpi support is present .. exactly which setting wasn't working in your power manager preferences ?
 
Old 09-28-2013, 09:15 PM   #5
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Original Poster
Rep: Reputation: Disabled
I'm trying to get the computer to suspend after a certain amount of time elapsed, on AC. So I guess it's under the "Actions" tab under "AC".

Last edited by Xenphor; 09-28-2013 at 09:16 PM.
 
Old 09-29-2013, 02:30 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
So "Put the computer to sleep when inactive for" .. could you try setting it to something low - say 5 minutes, and then watch it and see what happens?

Last edited by kbp; 09-29-2013 at 02:33 AM. Reason: Not relevant
 
Old 09-29-2013, 09:45 PM   #7
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Original Poster
Rep: Reputation: Disabled
Ok well it worked one time after booting but it doesn't do it again. When I first launch xfce4 power settings it says that the power manager isn't running and asks to start it. Is the service not running in the background correctly or something?
 
Old 09-29-2013, 10:17 PM   #8
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
Is Power Manager checked in "Desktop Session Settings" > Automatically Started Applications ?
 
Old 09-29-2013, 11:28 PM   #9
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Original Poster
Rep: Reputation: Disabled
No it wasn't.

However I noticed that the second time it tried to suspend, my computer locked up completely and I had to restart.
 
Old 09-29-2013, 11:41 PM   #10
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
That may not be related to Power Manager though .. how about after a cold boot with Power Manager starting automatically? Is it suspending ok?
 
Old 09-30-2013, 01:19 AM   #11
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Original Poster
Rep: Reputation: Disabled
Well it did succeed a second time now.
 
Old 09-30-2013, 01:25 AM   #12
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
Cool .. let us know if the lockup comes back
 
Old 09-30-2013, 01:12 PM   #13
Xenphor
Member
 
Registered: Aug 2011
Posts: 54

Original Poster
Rep: Reputation: Disabled
Well actually I do have another problem, although it is unrelated to power management.

I don't suppose you have experience with bluetooth on LXDE Fedora? I installed quite a few of the bluetooth packages recently (bluez, blueman, gnome-bluetooth) and I can't get any of them to work. The GUI utilities don't execute because of some errors in python (?) I think according to the console and I'm not sure how to use any CLI utilities if there are any.

My asus bluetooth radio is detected by the hci tool so I don't think it's a problem with that.

I just need a straight forward utility to pair my device (controller).

Last edited by Xenphor; 09-30-2013 at 01:18 PM.
 
Old 10-01-2013, 04:30 AM   #14
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644Reputation: 644
Might be better to start a new question so any bluetooth gurus might see it .. personally I rarely use bluetooth but when I did I had no problems, maybe check /var/log/messages and add any results into the new question

cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] xfce4 power management not locking the screen during suspend/hibernate. Arcosanti Slackware 5 08-26-2012 08:33 PM
[SOLVED] usb power management (suspend) gone in 2.6.34?! Olaus Linux - Kernel 7 02-10-2011 11:15 AM
Power Management not working on embedded MIPS when using /sys/power/state RichardS Programming 1 01-21-2011 08:18 AM
KDE4 Power Management constantly wants to suspend laptop ph73nt Linux - Laptop and Netbook 0 03-16-2009 03:54 PM
Hibernate / Suspend Not Working - Gnome Power Manager ls37 Linux - Newbie 5 12-30-2007 02:14 PM


All times are GMT -5. The time now is 12:59 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration