View previous topic :: View next topic |
Author |
Message |
pr0vidence n00b
Joined: 12 Apr 2002 Posts: 47 Location: Connecticut
|
Posted: Fri Apr 12, 2002 1:12 am Post subject: Screen goes blank after 15 minutes. |
|
|
Hello all.
Just wanna say I think Gentoo is a fantastic distro. Keep up the good work.
Enough of that
When using my Gentoo box (or any other Linux distro for that matter), or, perhaps I should say, when NOT using my box (or maybe waiting many, many hours for something to compile), the screen will blank itself out after ~15 minutes. I would like to shut this feature off, does anyone know how? I have tried killing apmd, even shutting off power management at CMOS level. I don't know what's next.
Thanks all for the help. |
|
Back to top |
|
|
DaemonCat Guest
|
Posted: Fri Apr 12, 2002 9:18 pm Post subject: 15 minute black out |
|
|
It's a "term thing"! the variable is "blank". I'm using "BSD style init", (Slackware) so the setting is in /etc/rc.d/rc.M , which is the initialization script for the "multi user" modes. I assume that the Sys-V style has a similar script somewhare. The line to look for is:
/bin/setterm -blank 15
Simply comment it out by inserting a "#" at the beginning of the line, OR change the "15" to "0" and it's gone for everybody.
If you just want to disable it on a "per user" basis,
/bin/setterm -blank 0
at the command prompt after you log in should do it.
Check the manpage for "setterm" for all kinds of goodies!
man setterm
at the command prompt. |
|
Back to top |
|
|
snowmoon n00b
Joined: 05 Jun 2002 Posts: 64 Location: Albany,NY USA
|
Posted: Thu Jan 23, 2003 4:20 am Post subject: |
|
|
xset -dpms
might also work. |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20521
|
|
Back to top |
|
|
msalerno Veteran
Joined: 17 Dec 2002 Posts: 1338 Location: Sweating in South Florida
|
Posted: Fri Nov 19, 2004 10:06 pm Post subject: |
|
|
This should do the trick:
Code: | echo "setterm -blank" >> /etc/conf.d/local.start |
|
|
Back to top |
|
|
kimchi_sg Advocate
Joined: 26 Nov 2004 Posts: 3038
|
Posted: Thu Apr 21, 2005 6:30 pm Post subject: |
|
|
setterm -blank -powersave off -powerdown |
|
Back to top |
|
|
david9999 n00b
Joined: 13 Sep 2010 Posts: 1
|
Posted: Mon Sep 13, 2010 9:03 am Post subject: |
|
|
For some reason my screen goes blank when I have no activity. I have screen saver set to two hours and "active screen saver when idle" unchecked. I also have power-management disabled.
I've noticed this behavior when using totem but not sure if it's just with this program or not. It goes out during a movie and I have to touch the mouse to bring the picture back. Any ideas? |
|
Back to top |
|
|
k9dog Tux's lil' helper
Joined: 22 Jun 2009 Posts: 103 Location: Denmark
|
Posted: Sat Aug 12, 2017 10:00 pm Post subject: |
|
|
I don't think there is a way to block blanking in Linux (currently) fx.during media playing. You can change the period in the system setting, but a signal to not start blanking during continuous media is still missing it seems or at least not well defined.
There is many good media applications and libraries out there (VLC, Kodi ... just to mention a few), so I think distros lacking this feature, makes it hard to consider at least most distros good platforms for Media Centers. (At least I haven't heard of any implementation to do this). In Windows there is a feature that can block the blanking and sleep of normal system behavior. The exact behavior I think most users miss, is partly illustrated by the usage and description of https://dlaa.me/Insomnia/. Don't misunderstand me, I love Gentoo and this laptop gave up Window somewhere during Window 7 when Microsoft decided everything looked better if the system memory and cpu was eaten by useless .net and security updates that was meant to solve problems that should have been fixed in a way that didn't hurt performance of the overall system. Ah well considering the stripping of the last traces of any skin in Windows 10 it doesn't really matter. Gentoo is the place to be now.
Hehe sorry about that. Windows is properly okay. But I do think there is a long dark path from Windows NT to Windows 10 that shouldn't have been taken. Microsoft come many good improvements along the way. Personally I don't really feel they develop the system as an OS any more. And I think there is a big issue with drivers in every OS upgrade, that mostly mean you have to do new investments again and again.
When it comes to Linux, I think the best thing that could have happened was what Linus did for Minix and the cross development in the years to come.
Gentoo have truly continued in that spirit. I'm not entirely sure where the blanking should be blocked. Kernel/driver, X, desktop, tool like laptop_mode or some combination. I think the later, which might explain why there isn't a common implementation. |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Aug 12, 2017 10:42 pm Post subject: |
|
|
k9dog wrote: | I don't think there is a way to block blanking in Linux (currently) fx.during media playing. |
Works fine in mpv. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3477
|
Posted: Sat Aug 12, 2017 11:00 pm Post subject: |
|
|
Some media players simulate pressing a key on a relatively short interval, which blocks screensavers (and other "user iddle" triggers) |
|
Back to top |
|
|
Ant P. Watchman
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Sat Aug 12, 2017 11:11 pm Post subject: |
|
|
mpv just calls `xdg-screensaver suspend`, which in turn runs... xset. As you can see from the replies from 14 years ago in this thread, we've had a solution to this for quite a while... |
|
Back to top |
|
|
k9dog Tux's lil' helper
Joined: 22 Jun 2009 Posts: 103 Location: Denmark
|
Posted: Fri Sep 08, 2017 9:38 pm Post subject: |
|
|
szatox wrote: | Some media players simulate pressing a key on a relatively short interval, which blocks screensavers (and other "user iddle" triggers) |
Thanks for the information. Nice to know that there at least is a used work-around, even if not all players implement it. At least it is a place to start. I feel like Linux has become a more user friendly environment over the last decade,so not too unlikely we'll get a more native method eventually (I guess the keypress work-around is fine until then). I guess we'll just need to ask developers to incorporate it more widely until the system does Just have to reninbd them to only do it while videos are actually playing.
. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3477
|
Posted: Sat Sep 09, 2017 2:13 pm Post subject: |
|
|
You're welcome.
Also, I recently had to find a way to suppress screensaver for players that do _not_ simulate keypress, and I found a few switches for xset.
'xset q' prits current settings
'xset s 0' disables screensaver (you can reenable it later by setting a non-zero timeout - value is in seconds)
'xset -dpms' disables power saving features, so your monitor will not suspend/power off. Enable it again with xset +dpms. |
|
Back to top |
|
|
k9dog Tux's lil' helper
Joined: 22 Jun 2009 Posts: 103 Location: Denmark
|
Posted: Tue Mar 20, 2018 1:38 am Post subject: |
|
|
I recently found that most video players use screen savers own mechanism to prevent going to sleep without any emulation of keystrokes. I dont think many players use keystroke emulation (as in xdotool).
xscreensaver uses a command "xscreensaver-command -deactivate" to reset timer.
By running the command an interval shorter than the time where screensaver starts you can prevent screensaver from blanking screen. Just like suggested for xdg-screensaver.
I now made a script that will prevent the xscreensaver from initiating any screen saver or power save. Named insomnia after Windows program of the same name.
Code: | #!/bin/sh
export DISPLAY=:0
while { /usr/bin/xscreensaver-command -deactivate &> /dev/null ; sleep 30; }; do :; done
|
(Rewritten to match what Hu said in next post. I was still composing and wanted to include it in post Thanks Hu)
The DISPLAY=:0 is just so I can run from console on another machine. It does require me to be logged on the X based platform as same user where I want to inhibit the xscreensaver. You can replace the statement of xscreensaver-command with "xdg-screensaver suspend" for that screensaver. Method is better than simulating the keypress with xdotool for fx. netflix as pressing shift also makes control bar appear on netflix.
I believe the package caffeine does much the same thing. I am not sure if you can tell caffeine which screen saver you use. It failed to work on one machine, but it worked on another of mine. (Might work after I reinstalled xscreensaver. caffeine said it tried to run inihibit for wrong screensaver and obviously failed)
xset might be a level too low as I was talking about screen saving done by xscreensaver and the like. I know you can control screen power and blank screen with xset. In the early days I saw xset as a way to set options. It was pretty much limited to basic mouse-keyboard-screen stuff. Settings for screen saver also includes type of screen saver, so one level higher is where we need to control what happens.
Last edited by k9dog on Tue Mar 20, 2018 4:45 am; edited 4 times in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22853
|
Posted: Tue Mar 20, 2018 3:23 am Post subject: |
|
|
k9dog wrote: | Code: | /usr/bin/xscreensaver-command -deactivate &> /dev/null
while sleep 30 ; do /usr/bin/xscreensaver-command -deactivate &> /dev/null ; done |
| In the interest of DRY, this can be rewritten: Code: | while { /usr/bin/xscreensaver-command -deactivate &> /dev/null ; sleep 30; }; do :; done | You could use sleep as the body instead, but then killing sleep would not count as an error condition. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Tue Mar 20, 2018 8:49 am Post subject: |
|
|
k9dog wrote: | The DISPLAY=:0 is just so I can run from console on another machine. It does require me to be logged on the X based platform as same user where I want to inhibit the xscreensaver. |
k9dog ... in which case it might be a good idea to test this:
Code: | #!/bin/sh
set -e
_xpid="$(pgrep -n X)"
_xuser="$(ps -o user --no-headers $_xpid)"
_display="$(egrep -aoz ':[0-9](.[0-9])?' /proc/$_xpid/cmdline)"
if [ -n "$_display" ] ; then
export DISPLAY="$_display"
else
echo "No display found"
exit
fi
if [ "$(whoami)" = "$_xuser" ] ; then
while { /usr/bin/xscreensaver-command -deactivate &> /dev/null ; sleep 30; }; do :; done
else
echo "fooey!! ... display is currently in use by $_xuser"
fi |
Note that the above requires X be runing non-suid (otherwise, as Hu pointed out in another thread, '$_xuser' will return 'root'), so keep that in mind.
best ... khay |
|
Back to top |
|
|
|