Automatically turn off monitor
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2005
    Posts
    45

    Question Automatically turn off monitor

    I use an old laptop as a Fedora Server. I would like monitor powered off after a few minutes. Is there a way to do it? [Server runs with no GUI]
    vbetool, which I used to use on an Ubuntu machine in past is not as option as it directly talks to BIOS.
    Thanks in advance for any pointers.

  2. #2
    Join Date
    Oct 2011
    Posts
    1,863

    Re: Automatically turn off monitor

    See if this helps: https://wiki.archlinux.org/index.php...e_with_setterm

    I've tested something like the following from a VT and the screen was blanked after 1 minute.
    Code:
    $ setterm --blank 1

  3. #3
    Join Date
    Dec 2012
    Location
    santa barbara, CA
    Posts
    926

    Re: Automatically turn off monitor

    In this thread:
    https://askubuntu.com/questions/6285...g-command-line

    they talk about 2 options (will try them at home over the weekend)

    Code:
    vbetool dpms off
    To regain control of the console on pressing enter key, I suggest
    sh -c 'vbetool dpms off; read ans; vbetool dpms on'
    or

    Code:
    To Turn Off:
    xset -display :0.0 dpms force off 
    To Turn On:
    xset -display :0.0 dpms force on
    "monsters John ... monsters from the ID..."
    "ma vule teva maar gul nol naya"

  4. #4
    Join Date
    Aug 2005
    Posts
    45

    Re: Automatically turn off monitor

    @bobx001 : Thanks. But as I mentioned earlier 'vbetool' is not an option.

    @srakitnican : Thanks. However, I can use the command only from tty1 (main console), not when using SSH. I get "xterm does not support --blank" error. I did some search and found 'echo -ne "\033[9;2]" > /dev/tty1' to be a solution. However, how can I execute this command without having to log in and execute it manually?

    Another solution I found is by supposedly adding consoleblank=0 to the boot parameters, but don't know how to.
    Last edited by concoran; 15th January 2018 at 06:23 PM.

  5. #5
    Join Date
    Sep 2009
    Posts
    2,184

    Re: Automatically turn off monitor

    Adding consoleblank=0 to the boot parameters will turn off blanking. You want to add consoleblank=N to the boot parameters, where N is the number of seconds to wait before blanking. Add it to the GRUB_CMDLINE_LINUX= string in /etc/default/grub, then rebuild your grub configuration with grub2-mkconfig. This doesn't work for graphical.target, however. It sounds like you're running in multi-user.target, so you should be good to go.

    dd_wizard

  6. #6
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,371

    Re: Automatically turn off monitor

    Quote Originally Posted by dd_wizard
    Adding consoleblank=0 to the boot parameters will turn off blanking. You want to add consoleblank=N to the boot parameters, where N is the number of seconds to wait before blanking. Add it to the GRUB_CMDLINE_LINUX= string in /etc/default/grub, then rebuild your grub configuration with grub2-mkconfig. This doesn't work for graphical.target, however. It sounds like you're running in multi-user.target, so you should be good to go.

    dd_wizard
    I think you can also do this after boot with:
    Code:
    echo "N" > /sys/module/kernel/parameters/consoleblank
    in case you don't want the ridigity of changing a kernel option. Replace my "N" with the number of seconds you want

  7. #7
    Join Date
    Aug 2005
    Posts
    45

    Re: Automatically turn off monitor

    Thanks folks. Adding consoleblank to grub seems to do the trick.
    (BTW, it wasn't possible to change consoleblank file manually even after making it writable).

    Appreciate your answers.

Similar Threads

  1. How to turn off usb hard drive automatically?
    By tonytiger in forum Hardware & Laptops
    Replies: 7
    Last Post: 16th December 2008, 11:04 PM
  2. Monitor will not turn off in KDE
    By allan_r in forum Using Fedora
    Replies: 0
    Last Post: 10th December 2008, 04:53 AM
  3. monitor turn off option
    By jkmartha in forum Hardware & Laptops
    Replies: 2
    Last Post: 3rd May 2005, 08:57 AM
  4. How can I turn on Selective Acks automatically on start up?
    By kentri9 in forum Servers & Networking
    Replies: 1
    Last Post: 25th October 2004, 02:41 PM

Posting Permissions

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