Results 1 to 8 of 8

Thread: Set screen to turn off after time. Command line not desktop.

  1. #1
    Join Date
    Jun 2007
    Beans
    264
    Distro
    Ubuntu 20.04 Focal Fossa

    Set screen to turn off after time. Command line not desktop.

    Installed Ubuntu server 20.04.1 on a EVOO tablet. it works real good on it.

    But the screen stay on all the time. Can I set a timer like for 5 minutes if no keyboard the screen will turn off.

    It's a tablet and there is no way to just turn the screen off without turning off the whole tablet.

    It had Windows 10 on it I just DD backed that up before installing Ubuntu server.

    Found out this command will do it but with time it goes away.

    Code:
    echo -e "\033[9;1]" > /dev/tty1
    That will turn the screen off in 1 minute with not keyboard use. But like I said it will not stay. I have to type it back in avery few days.

    Change the 9:1 to like 9:5 and it will turn the screen off in 5 minutes.

    -Raymond Day
    Last edited by Raymond Day; September 2nd, 2020 at 01:10 PM.

  2. #2
    Join Date
    Jun 2007
    Beans
    264
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Set screen to turn off after time. Command line not desktop.

    Looking on the web a long time for a answer and 3 months ago ask about the same thing here:

    So I don't think any one will know here either.

    Guess have to make like a cron job so that command gets done about 1 time a day. Then it my stay.

    Or maybe I can open this up and install a switch on it to turn off the built in LCD screen. Not sure.

    -Raymond Day

  3. #3
    Join Date
    Aug 2020
    Location
    Denmark
    Beans
    100
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Set screen to turn off after time. Command line not desktop.

    I think your best bet is to use either screen or tmux - both are terminal multiplexers. Both programs offers the ability to set a screensaver in the console, as well as other cool features.
    I'm not aware how you set a screensaver in a "raw" bash terminal, but I use tmux myself.

  4. #4
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,520
    Distro
    Ubuntu Development Release

    Re: Set screen to turn off after time. Command line not desktop.

    A few years ago, the screen used to default to turning off after a few minutes. Now it defaults to staying on all the time. To restore the original behavior, you can add a timeout to your grub command line. Example (7.5 minutes, and I have other stuff on the line also):

    Code:
    GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 consoleblank=450 intel_pstate=passive msr.allow_writes=on cpuidle.governor=teo"
    The relevant bug report.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  5. #5
    Join Date
    Jun 2007
    Beans
    264
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Set screen to turn off after time. Command line not desktop.

    Just made a file name "screen-blank" in /etc/cron.daily/ that has just this in that file:

    echo -e "\033[9;1]" > /dev/tty1

    Will see if I can get the grub one to work.

    So I added this to /etc/default/grub

    # Turn screen off after 60 sec. of no use.
    GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=60"


    Then ran the update-grub command.

    After a reboot will see if it works.

    Will post back if it works.

    Thank you.

    -Raymond Day

  6. #6
    Join Date
    Jun 2007
    Beans
    264
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Set screen to turn off after time. Command line not desktop.

    It did not work waited about 10 minutes and the screen never went off. Got Ubuntu 20.04.1 LTS server on it now.

    Did I do the Grub command wrong some how?

    -Raymond DAy

  7. #7
    Join Date
    Jun 2007
    Beans
    264
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Set screen to turn off after time. Command line not desktop.

    There is a command to show if it's working I did this:

    Code:
    root@rayday-tablet:~# grep consoleblank /boot/grub/grub.cfg
            linux   /vmlinuz-5.4.0-47-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  consoleblank=60
                    linux   /vmlinuz-5.4.0-47-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  consoleblank=60
                    linux   /vmlinuz-5.4.0-45-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  consoleblank=60
    root@rayday-tablet:~#
    Should it show 3 of them? Maybe that is what is wrong. It is does like 60x60x60 that would be a long time before it does it. Not sure.

    -Raymond Day

  8. #8
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,520
    Distro
    Ubuntu Development Release

    Re: Set screen to turn off after time. Command line not desktop.

    Quote Originally Posted by Raymond Day View Post
    So I added this to /etc/default/grub

    # Turn screen off after 60 sec. of no use.
    GRUB_CMDLINE_LINUX_DEFAULT="consoleblank=60"


    Then ran the update-grub command.
    After a reboot will see if it works.
    O.K. sounds right.

    Quote Originally Posted by Raymond Day View Post
    Did I do the Grub command wrong some how?
    It looks O.K. to me.

    Quote Originally Posted by Raymond Day View Post
    There is a command to show if it's working I did this:

    Code:

    Code:
    root@rayday-tablet:~# grep consoleblank /boot/grub/grub.cfg
            linux   /vmlinuz-5.4.0-47-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  consoleblank=60
                    linux   /vmlinuz-5.4.0-47-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  consoleblank=60
                    linux   /vmlinuz-5.4.0-45-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro  consoleblank=60
    root@rayday-tablet:~#
    Should it show 3 of them? Maybe that is what is wrong. It is does like 60x60x60 that would be a long time before it does it. Not sure.
    I think it should be 1 per kernel, plus 1 repeated for the default kernel. I get a bit different, but think it is a red herring. I have 30 kernels installed at the moment, so won't show all:

    Code:
    linux   /boot/vmlinuz-5.4.0-42-generic root=UUID=0ac356c1-caa9-4c2e-8229-4408bd998dbd ro  ipv6.disable=1 consoleblank=450 intel_pstate=passive msr.allow_writes=on cpuidle.governor=teo
    what does your kernel command line show? here is mine:

    Code:
    $ cat /proc/cmdline
    BOOT_IMAGE=/boot/vmlinuz-5.9.0-rc4-stock root=UUID=0ac356c1-caa9-4c2e-8229-4408bd998dbd ro ipv6.disable=1 consoleblank=450 intel_pstate=passive msr.allow_writes=on cpuidle.governor=teo
    Last edited by Doug S; September 9th, 2020 at 10:02 PM. Reason: fixed erronious statement
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

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
  •