LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-30-2013, 12:41 AM   #16
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 1,960

Rep: Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538Reputation: 538

@michaelslack

You are forgiven,
the thread went a little 'off topic'

Originally it was youTube in a browser
that could be extended to other streaming services, like BBC Iplayer, 4od, 5demand, ITV Player etc in the UK
 
Old 07-25-2019, 10:07 AM   #17
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,093

Original Poster
Rep: Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929
I am still having this issue (good lord), and I've rolled a solution up. Post #2 should be the proper way to do it.

https://www.linuxquestions.org/quest...9/#post6018530
 
Old 07-25-2019, 08:03 PM   #18
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware64
Posts: 863
Blog Entries: 27

Rep: Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203Reputation: 1203
My custom X-starting script does something similar to ponce's solution:

xset s off
xset -dpms
setterm -blank 0
setterm -powerdown 0

I used to also have "setterm -powersave off" but that's commented out because it's not supported by this video device.
 
Old 07-25-2019, 11:43 PM   #19
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 72

Rep: Reputation: Disabled
I've used another approach for a general solution. I run this script in xfce.
It disables the screensaver if any application is running fullscreen.

Code:
#!/bin/sh

while sleep "${1:-110}"; do
    WIN=$(xprop -root _NET_ACTIVE_WINDOW | cut -c 41-49)
    xprop -id $WIN | grep -q STATE_FULLSCREEN && \
        xscreensaver-command -deactivate
done
 
3 members found this post helpful.
Old 07-26-2019, 09:19 AM   #20
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,093

Original Poster
Rep: Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929
Ooh, clever.

AFAIK this is what Caffeine does, but your solution is less overdesigned.
 
Old 07-26-2019, 02:53 PM   #21
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 72

Rep: Reputation: Disabled
Thanks :-) I don't think I knew about Caffeine.
Anyway, who doesn't love hacking up a quick shell script to solve a problem, eh?
 
Old 07-26-2019, 03:23 PM   #22
cwizardone
Senior Member
 
Registered: Feb 2007
Distribution: Slackware64-current with "True Multilib" & Xfce.
Posts: 4,866
Blog Entries: 1

Rep: Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268Reputation: 2268
Quote:
Originally Posted by dugan View Post
I am still having this issue (good lord), and I've rolled a solution up. Post #2 should be the proper way to do it.

https://www.linuxquestions.org/quest...9/#post6018530
Try editing, /etc/rc.d/rc.setterm or /etc/rc.d/rc.M.
 
Old 09-03-2019, 06:17 PM   #23
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,093

Original Poster
Rep: Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929
You know what?

I've come to the realization that any proper solution to this needs to start with "just don't use xscreensaver".

I noticed that xscreensaver was coming on even after I'd done "xset s off", and I suspected that xscreensaver wasn't well-behaved in regards to the XResetScreenSaver/XGetScreenSaver API.

So I locked at xscreensaver's source code for confirmation and, oh, man... it's much worse than I thought.

https://github.com/porridge/xscreens...timers.c#L1356
https://github.com/porridge/xscreens...er/xset.c#L129

Instead of just querying the timeout value from X and honoring it, it actually assumes that the value you'd set using xset (or that was set by, say, a game or media player that wants to disable the screen saver) is wrong, and tries to "correct" it for you.

This is ridiculous.

[EDIT: I later checked the xscreensaver tarball that was linked from LinuxFromScratch, and it's notably less ridiculous than that fork. But it still doesn't honor xset settings.]

(It also looks to me like xlockmore actually honors the standard X API to disable the screen saver, and should be a worthy substitute for xscreensaver).

Note: if you're picking a screen saver or a locker, make sure it calls and honors either XGetScreensaver (linked above) or XScreenSaverQueryInfo. When MPlayer plays a movie, it uses both systems.

I've also noticed that xautolock honors XScreenSaverQueryInfo. But then, I'd assume that anything would be more well-behaved than xscreensaver.

Last edited by dugan; 09-03-2019 at 11:13 PM.
 
2 members found this post helpful.
Old 09-03-2019, 10:57 PM   #24
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,093

Original Poster
Rep: Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929
I just want to make a new post with more technical information.

Xlib provides a standard API to set the screensaver timeout, including a function called XResetScreenSaver.

https://linux.die.net/man/3/xresetscreensaver

The recommendation by the gnome-screensaver project for how a program should disable the screen saver is to call XResetScreenSaver. Here's a link to their recommendation.

Quote:
For reference, joystick using applications that use SDL are expected to not activate the screensaver any longer, due to changes in SDL ( ). Applications not using SDL should call XResetScreensaver as appropriate to avoid screensaver activation.
https://bugs.launchpad.net/ubuntu/+s...378/comments/9

SDL does call XResetScreenSaver to temporarily disable the screen saver. Reference:

Quote:
Use XResetScreenSaver() instead of disabling screensaver entirely.
https://www.libsdl.org/release/SDL-1.2.15/docs.html

MPlayer also calls XResetScreenSaver to disable the screen saver when it's playing movies. This is mentioned right in its manpage:

Quote:
Code:
-stop-xscreensaver (X11 only)
    Turns off xscreensaver at startup and turns it on again on exit. If your screensaver supports neither the XSS nor XResetScreenSaver API please use -heartbeat-cmd instead.
https://linux.die.net/man/1/mplayer

Oh, that XSS API that the MPlayer man page mentioned? It is, I believe, used by the screen savers to query the idle time that was elapsed.

https://linux.die.net/man/3/xss

I'm going to leave the previous post (which I made before fact-checking everything) as-is, but this post is what I know for sure.

The takeaway? If you set your screen saver interval for one minute, play a full-screen video in MPlayer for one minute, and the screen saver comes on, then something is wrong. I'm a bit curious as to which screen savers fail this test.

My current understanding of the way this should normally work is that the the screen saver or locker calls XScreensaverQueryInfo to poll for the idle time, and the game or media player calls XResetScreenSaver to reset the idle time.

I'm aware of a program that should be helpful for looking into this:

https://github.com/g0hl1n/xprintidle

Last edited by dugan; 09-04-2019 at 12:58 AM.
 
Old 09-04-2019, 12:56 AM   #25
solarfields
Senior Member
 
Registered: Feb 2006
Location: Outer Shpongolia
Distribution: Slackware
Posts: 1,014

Rep: Reputation: 587Reputation: 587Reputation: 587Reputation: 587Reputation: 587Reputation: 587
you may try xscreensaverstopper.sh:

https://github.com/xtendo-org/.../bl...averstopper.sh
 
Old 09-04-2019, 12:57 AM   #26
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,093

Original Poster
Rep: Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929
Quote:
Originally Posted by solarfields View Post
you may try xscreensaverstopper.sh:

https://github.com/xtendo-org/.../bl...averstopper.sh
Looks like another reinvention of Caffeine.

I'd rather just shop for a screen saver that works properly.

Last edited by dugan; 09-04-2019 at 01:02 AM.
 
Old 09-04-2019, 08:20 AM   #27
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 1,286
Blog Entries: 1

Rep: Reputation: Disabled
Go into init level 3. If this will still happen this is because power management of your system - power saving by blanking the screen. Xscreensaver has not much to do with this. Perhaps of course.

Edit: Precisely I meant after hour of passive input. Cause you cant watch youtube in frame buffer - except possibly using VLC - at least I know VLC can ue frame buffer as output device.

Last edited by igadoter; 09-04-2019 at 08:44 AM.
 
Old 09-04-2019, 08:26 AM   #28
montagdude
Senior Member
 
Registered: Apr 2016
Distribution: Slackware
Posts: 1,553

Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
I really dislike xscreensaver also. For what it's worth, Cinnamon's screensaver seems to "just work" without being overdesigned. There is also a Cinnamon applet to automatically disable power saving when media is playing, which seems to work pretty well. It can also be activated or deactivated manually. Since switching to Cinnamon, I have had no need for custom scripts to do this sort of thing.
 
1 members found this post helpful.
Old 09-04-2019, 09:30 AM   #29
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 9,093

Original Poster
Rep: Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929Reputation: 3929
I wanted to make sure I had my technical understanding right. Specifically:
  • the screen saver is supposed to call XScreenSaverQueryInfo to get the elapsed idle time and to decide when to activate
  • the game or media player is supposed to call XResetScreenSaver to reset the elapsed idle time, and to delay the screen saver from activating
So of course I wrote a program to confirm that:
Code:
#include <X11/extensions/scrnsaver.h>
#include <unistd.h>
#include <stdio.h>

int main()
{
	int i;
	XScreenSaverInfo *ssi;
	Display *dpy;
	int event_basep;
	int error_basep;

	dpy = XOpenDisplay(0);
	XScreenSaverQueryExtension(dpy, &event_basep, &error_basep);

	ssi = XScreenSaverAllocInfo();

	for (i = 0; i < 10; i++)
	{
		sleep(1);
		XScreenSaverQueryInfo(dpy, DefaultRootWindow(dpy), ssi);
		printf("%d\n", ssi->idle / 1000);
		if (i == 5)
		{
			XResetScreenSaver(dpy);
		}

	}
	return 0;
}
It runs for ten seconds. At each second, it queries the elapsed idle time the way a screen saver would, and prints it. At the fifth second, it resets that time the way a program that wants to suspend the screen saver would.

If you name it "sstest.c", then you can build it like this:

Code:
gcc sstest.c -lX11 -lXss
When you run it and leave it alone, letting the idle time accumulate, it prints out:

Code:
0
1
2
3
4
5
0
1
2
3
This confirms what I said in my previous two posts. If you're running a screen saver that queries its idle time with XScreenSaverQueryInfo, it should be suspending automagically when you play games and watch movies. And as far as I know, that's every screen saver or screen locker other than xscreensaver. So: drop it and use literally anything else. I'd imagine that xfce4-screensaver would become a good choice on Slackware before long.

Anyway, here are some interesting links I stumbled across.

Google apparently has a screen locker. I'm not interested in using it, but it's interesting that it exists:

https://github.com/google/xsecurelock

And here's a tutorial on writing your own X screen saver:

http://www.dis.uniroma1.it/~liberato/screensaver/

Last edited by dugan; 09-04-2019 at 11:22 AM.
 
Old 09-04-2019, 09:33 AM   #30
ReFracture
Member
 
Registered: Oct 2007
Location: Underneath The Waves
Distribution: Slackware64-current
Posts: 50

Rep: Reputation: 76
I used to love screen savers.. but at a point I came to the realization that they didn't serve much purpose since I never sat around to watch them.

Work policy has ingrained into me locking my computer when I get up.. so at this point i've just disabled screensavers entirely and rely on ctrl+alt+L to lock it and turn off the monitor.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't stop screen from blanking EDDY1 Debian 7 09-18-2013 12:25 AM
[SOLVED] How to stop screen blanking during inactivity Stephen Morgan Slackware 1 01-04-2012 01:35 PM
how to stop the screen blanking on crunchbang linux samsearcher Linux - Newbie 8 06-16-2009 01:23 PM
watch your widescreen movies more full screen shanenin Linux - Software 3 08-02-2005 12:30 AM
Can't stop KDE/Mandrake 9.2 from blanking screen themusk Linux - Software 1 03-20-2004 08:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration