LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   Xscreensaver + systemctl suspend Perl script for power management in LXDE not working (http://www.linuxquestions.org/questions/fedora-35/xscreensaver-systemctl-suspend-perl-script-for-power-management-in-lxde-not-working-4175478406/)

Xenphor 09-24-2013 05:54 PM

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?

kbp 09-24-2013 09:52 PM

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 ?

Xenphor 09-27-2013 10:49 PM

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


kbp 09-28-2013 07:03 PM

Ok, so it looks like acpi support is present .. exactly which setting wasn't working in your power manager preferences ?

Xenphor 09-28-2013 08:15 PM

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".

kbp 09-29-2013 01:30 AM

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?

Xenphor 09-29-2013 08:45 PM

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?

kbp 09-29-2013 09:17 PM

Is Power Manager checked in "Desktop Session Settings" > Automatically Started Applications ?

Xenphor 09-29-2013 10:28 PM

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.

kbp 09-29-2013 10:41 PM

That may not be related to Power Manager though .. how about after a cold boot with Power Manager starting automatically? Is it suspending ok?

Xenphor 09-30-2013 12:19 AM

Well it did succeed a second time now.

kbp 09-30-2013 12:25 AM

Cool .. let us know if the lockup comes back

Xenphor 09-30-2013 12:12 PM

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).

kbp 10-01-2013 03:30 AM

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


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