Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Inhibit auto-suspend NOT screensaver

  1. #1
    Join Date
    Mar 2007
    Beans
    Hidden!

    one-click solution to inhibit auto-suspend but NOT screensaver

    I want to be able to inhibit auto-suspend, but still have the screensaver run in xubuntu precise (basically the "inhibit-applet" in Gnome2). As is pointed out in countless posts, xubuntu has no such feature (although the screenshot at the xfce4-power-manager page shows an "inhibit" menu item that is missing from my version!).

    I don't know if this is the right forum for this; if not please direct me.

    I have tried installing gnome-power-manager, but I can't get it to start (doing a "which gnome-power-manager" results in nothing, and I can't find it on my system). Additionally, there doesn't appear to be a "gnome-power-preferences" anymore.

    I looked at "caffeine", but the developers say that it inhibits both screensaver and sleep -- not quite what I want -- while others claim it only inhibits the screensaver. So I haven't bothered trying it yet.

    I've read some posts about people with a similar need writing scripts to manipulate Dbus to inhibit sleep, but it seems that sleep doesn't always work when they "un-inhibit".

    I have been searching off and on for a week with no solution. can anyone help?
    Last edited by opus1; October 13th, 2012 at 05:54 PM. Reason: clearer title

  2. #2
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Inhibit auto-suspend NOT screensaver

    (although the screenshot at the xfce4-power-manager page shows an "inhibit" menu item that is missing from my version!).
    Is this a xubuntu install or an xfce install on top of ubuntu? Interestingly, I don't see this option in either my 12.04 install ( Xfce 4.8 ), or in my 12.04 VM with Xfce 4.10.

    I want to be able to inhibit auto-suspend, but still have the screensaver run
    Have a look at the options in "Settings Manager -> Power Manager", specifically:
    - "On AC" tab - "Put the computer to sleep when inactive for"
    - "On Battery" - "Put the computer to sleep when inactive for"

    and "Settings Manager -> Screensaver, specifically:
    - "Advanced" tab - "Power management enabled" (disable it)

    I have tried installing gnome-power-manager, but I can't get it to start
    Code:
    ps -ef | grep power-manager
    ...will show you which power manager is running.

  3. #3
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Inhibit auto-suspend NOT screensaver

    Toz, thanks for the quick reply. To answer your questions:

    This is a fresh xubuntu install. Not xfce on ubuntu.

    You noted you don't see the inhibit option. I don't either, and what is interesting is it is clearly shown in the screenshot at xfcedocs: http://docs.xfce.org/xfce/xfce4-powe...etting-started. I've been trying to figure out if they are showing a newer version than what's in the repositories, but I haven't found a developers page yet.

    So... Thanks for the instructions on how to acomplish what I want... but, I wasn't clear in my original post . I actually know how to do that, I'd like to figure out a way to do this with one click like the gnome-panel inhibit applet (I was so deep in the problem, I forgot to explain it thoroughly enough... ). To quote one of the many posts I've read on this topic: "I want to do this in one click, not 7 (seriously, I counted)".

    I did a
    Code:
    ps -ef | grep power-manager
    and got
    Code:
    opus        5812  5797  0 09:50 pts/1    00:00:00 grep --color=auto power-manager
    so, evidently, no power manager is running. I uninstalled xfce4-power-manager and installed gnome-power-manager, but apparently the gnome one doesn't autostart and issuing a
    Code:
    gnome-power-manager
    gives me a
    Code:
    gnome-power-manager: command not found
    Puzzling!

    Thanks for the input, though! Do you have any other ideas? Me... I'm still looking.

  4. #4
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Inhibit auto-suspend NOT screensaver

    it seems there is a newer version (1.2) than what's in the repositories (1.0.11): http://mail.xfce.org/pipermail/xfce-...il/000179.html Maybe this is where the screenshot I referred to is from?

    however, the xfce goodies website lists only 1.0.10 http://goodies.xfce.org/projects/app...-power-manager

    This lack of updated information is a bit frustrating!

  5. #5
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Inhibit auto-suspend NOT screensaver

    Try re-installing xfce4-power-manager and checking the settings from my post #2.

  6. #6
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Inhibit auto-suspend NOT screensaver

    OK, I reinstalled the xfce4-power-manager and it is running. I looked at all the settings you noted in post #2. I can see how this will keep the computer from going to sleep without disabling the screensaver.

    However, everytime I want to disable/enable the sleep mode, I need to go through these steps? I can't find a one click "sleep on/sleep off" menu item or applet (like what was in gnome)...

    That's my ultimate goal -- to toggle the sleep on and off with as few mouse clicks as possible.

  7. #7
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Inhibit auto-suspend NOT screensaver

    So, I have decided to try "Caffeine". I installed it and the "about" menu says: "An application to temporarily prevent the activation of both the screen saver and the "sleep" powersaving mode." Oddly, the preferences are pretty sparse, and I can't see how to make it differentiate between "sleep" and screensaver. Still, I will set the computer to sleep in 15 minutes and see what happens.

    To further define my problem, here are some use cases. First let me say that a one-click solution is desired because 1) I'm lazy and 2) my kids and wife are not computer experts (yet) and I would need to write down the 7 steps to acheive what we want.

    Use Case 1: We're backing up the file server to "Computer A". Obviously, we don't want "Computer A" to go to sleep.

    Use Case 2: "Computer A" is on and I know I will be ssh'ing into it from "Computer B" upstairs. Thus, "Computer A" needs to stay awake.

    Use Case 3: "Computer A" is in the family room and we have relatives over. We would like the photo slideshow screensaver to play, but not for "Computer A" to go to sleep.

    Caffeine may work for 1 and 2, but depending upon how it handles screensaver vs. sleep, it may not work for 3.

    I've been looking into maybe writing something that keeps sleep from activiating without disturbing the screensaver. I figure I can make an "inhibit" script that, when activated, checks idle time, and after a certain amount of idle time, touches a file (say ".inhibit"). Then, I have a cron job that checks for the existance of ".inhibit" and if it isn't there, issue a pm-suspend. Ways to check idle time include xprintidle (e.g., http://stackoverflow.com/questions/2...ivity-in-linux and http://michkhoo.blogspot.com/2009/10...-in-linux.html), w (e.g., https://coderrr.wordpress.com/2008/0...-time-in-unix/) or seeing if xscreensaver is active.

    Unfortunately, xprintidle only looks at X activity, so it wouldn't work for use case 2. Same for checking xscreensaver activity. I looked at "w", but it looks like the idle column shows "uptime" rather than "idle" time. Besides, I'm really just trying to re-write the gnome-panel "inhibit applet" all over again!

    Maybe caffeine will work. I'll give it a try and post back. If anyone has any simpler ideas, please let me know.

    I realize I'm nitpicking since I can follow the solution posted by Toz above, but I really would like a one-click solution for my family to use!

  8. #8
    Join Date
    Mar 2007
    Beans
    Hidden!

    Re: Inhibit auto-suspend NOT screensaver

    OK, caffeine didn't work as expected. It kept the screensaver from coming on, but allowed the computer to go to sleep (which is counter to its claim that it would keep the computer from going to sleep). So it is the exact opposite of what I want.

    I guess there is no solution to this problem. I would love to create a xfce-panel inhibit applet like the one in gnome because I see a lot of posts from xfce users who want it. Unfortunately, I don't have the programming skills nor the time.

    Mark this one as 'unsolved'.

  9. #9
    Join Date
    Jun 2005
    Location
    Toronto, Canada
    Beans
    Hidden!
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Inhibit auto-suspend NOT screensaver

    Quote Originally Posted by opus1 View Post
    OK, I reinstalled the xfce4-power-manager and it is running. I looked at all the settings you noted in post #2. I can see how this will keep the computer from going to sleep without disabling the screensaver.

    However, everytime I want to disable/enable the sleep mode, I need to go through these steps? I can't find a one click "sleep on/sleep off" menu item or applet (like what was in gnome)...

    That's my ultimate goal -- to toggle the sleep on and off with as few mouse clicks as possible.
    Create the following script, make it executable and assign it to a keyboard shortcut. It will toggle the xfce4-power-manager settings to enable and disable those settings:
    Code:
    #!/bin/bash
    
    STATUS=enabled
    
    DISABLED=$(xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac)
    
    [ $DISABLED -eq 0 ] && STATUS=disabled
    
    case $STATUS in
    
    	disabled) #then enable it
    	xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac -n -t uint -s 40
    	xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-battery -n -t uint -s 40
    	;;
    
    	enabled) #then disable it
    	xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-ac -n -t uint -s 0
    	xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/inactivity-on-battery -n -t uint -s 0	
    	;;
    
    	*)
    	echo "Not a valid condition"
    	;;
    esac
    EDIT: After reading your last two posts, I'm not sure this script is enough. There is also the xset group of commands. Maybe these can help create a script that inhibits power saving but not screen saver. Have you seen this thread: http://forum.xfce.org/viewtopic.php?id=6469?
    Last edited by Toz; October 22nd, 2012 at 04:58 PM.

  10. #10
    Join Date
    Nov 2012
    Beans
    1

    Re: Inhibit auto-suspend NOT screensaver

    I'll start by qualifying my reply...

    My idea is completely unencumbered by the thought process, and might be too simplistic, and I haven't tried it yet, but it's crazy enough that it just might work...

    Have two copies of the power managenment config file... One that disables suspending and one that enables it. Then, have a script that overwrites the current config file with one or the other, depending on what you want it to do.

    When I go to Settings / Power Manager, change a setting, and click Close, I don't know if it's doing something other than writing to the config file. If it's calling the power management system of the computer and telling it to check out the new settings, my idea won't work.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •