Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Switching laptop backlight off

  1. #11
    Join Date
    Mar 2010
    Location
    Oslo, Norway
    Beans
    54
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Switching laptop backlight off

    killall gnome-screensaver-command -i

    you don't even need sudo.

    But you have to do it in terminal, I think.

    Edit: actually just
    Code:
    killall gnome-screensaver-command
    will work, and you can run it in any way you like; by terminal or alt F2
    Last edited by mathiaho; February 19th, 2011 at 07:26 PM. Reason: second edit :P just specifying...

  2. #12
    Join Date
    Mar 2010
    Beans
    178
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Switching laptop backlight off

    OK

    And it seems that closing the terminal also closes the gnome-screen-saver-command process.

    I do not know if you noted my edit so I re-iterate here.

    Thanks for your help. If you had not pointed me to the screen saver

    gnome-screensaver is to blame
    I would still be in where I was a year ago with this when I first took a look in to this. (and I mean no where)
    ========================================
    "If people make the final decisions, let's invest in education, not technology. " - zefrank 03-28-06
    ========================================

  3. #13
    Join Date
    Mar 2010
    Location
    Oslo, Norway
    Beans
    54
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Switching laptop backlight off

    Hehe, me neither I guess. gnome-screensaver-command -i is what really solved it for my part, so thanks for the help!

    I guess I'll make gnome-screensaver-command -i run on startup, since I really don't like having a screensaver at timeout anyway, then I'll set my hotkeys to

    Code:
    xset dpms force off
    and

    Code:
    gnome-screensaver-command -l && xset dpms force off
    I'll mark the tread as solved, although we shouldn't need to run through these loopholes to make such a simple thing work.
    Last edited by mathiaho; February 19th, 2011 at 09:43 PM.

  4. #14
    Join Date
    Jan 2010
    Beans
    7

    Re: Switching laptop backlight off

    Thank you mathiaho & naggobot for your interesting collaboration. Elegant it isn't, but work it does. I have also been trying to solve this for quite some time.
    Too bad gnome-power-manager did away with the dbus interface, as that would have made it easy, since it does switch the light off. I'm sure they had their reasons. But this will do! I don't care about screensaver function either, just give my backlight a break.

  5. #15
    Join Date
    Mar 2010
    Location
    Oslo, Norway
    Beans
    54
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Switching laptop backlight off


    And thank you for taking the time to tell us! It's nice to know that we've helped someone else than ourselves. You've gotta love this community!

  6. #16
    Join Date
    Jan 2010
    Beans
    7

    Re: Switching laptop backlight off

    Actually I'm a spy from the eeebunt, er, I mean Aurora community. But with Ubuntu's huge user base, I find many answers here, as we all have much in common.
    Anyhow, my reason for this post is for others that may stumble on this. Although your hotkey idea is just fine, I cannot enter multiple commands (i.e. &&) for my hotkeys for some reason. So I simply created a bash file called by the hotkey and perhaps it might be even better because the first command is: killall gnome-screensaver-command, so there isn't a backlog of dead running processes, although probably not a big thing. Here it is:

    Code:
    killall gnome-screensaver-command
    xset dpms force off
    gnome-screensaver-command -i
    So there is never more than one of these limbo instances running. This works very nicely. I find now when I close Linux the "a program is still running" dialog appears for 1/2 a second (it says unknown for program name), but no big, quits immediately after that with no effort on my part, it's worth it. If it really bugs you even that could be fixed, but I'm not bothering.
    I also tried running the -i command on startup, but it didn't seem to stick, although I could have jumped to conclusion, too antsy to see this finally solved. This works, so it's the winner.
    Another nice thing about your idea is that power manager screen blanking still functions on time, so it's the best of everything.
    Last edited by sputnikeee; May 16th, 2011 at 09:07 AM.

  7. #17
    Join Date
    Mar 2010
    Location
    Oslo, Norway
    Beans
    54
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Switching laptop backlight off

    I can't have && and such in hotkeys either, so I made a script, I just forgot to mention that I did. Oops
    Another thing that might be of interest: I'm using the "windows button"+F2 as the hotkey. The keyup signal from the "windows-button" makes the backlight come back on.
    Solved with "sleep 0.2" at the start of the script

    About the "gnome-screensaver-command -i" at startup: it works for me. I don't need to "killall gnome-screensaver-command", nor do I have to start "gnome-screensaver-command -i" more than once.

    I don't think there will be a pile of dead processes since "gnome-screensaver-command -i" is just run once.

Page 2 of 2 FirstFirst 12

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
  •