Disable screen blanking while specified program is running

If none of the more specific forums is the right place to ask

Disable screen blanking while specified program is running

Postby Josh66 » 2018-03-03 03:03

Is there a way to disable the screen lock, but only when certain (user specified) programs are running?

For example, when I'm calibrating my monitor - it takes a long time and there's not really anything else I can be doing while it's running. If the screen locks while it's running, the spectrometer is taking readings from a blank screen...

If there's a way to do this (I feel like there must be), I haven't been able to figure it out.
Josh66
 
Posts: 16
Joined: 2013-08-20 15:02
Location: Columbus, OH

Re: Disable screen blanking while specified program is runni

Postby bw123 » 2018-03-03 03:51

I've been looking for the best way to do this too. There is a script solution called lightsonplus that runs as a daemon and detects when video players are in fullscreen:
https://github.com/devkral/lightsonplus
but I haven't really used it yet. Looks like it will need some editing for what I want to do.

I think it depends on what app is doing the blanking/locking/screensaving and how it can be interacted with. This would be a great feature for all of them to support.
User avatar
bw123
 
Posts: 3135
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Disable screen blanking while specified program is runni

Postby debiman » 2018-03-04 09:45

there's a proper way of doing this, but depending on your setup it can involve many different applications, starting with systemd, power management, Xorg's own rudimentary screensaver, other screensavwers...

it might be easier to simply write a little script that will wiggle the mouse regularly.
look at xdotool.
User avatar
debiman
 
Posts: 2499
Joined: 2013-03-12 07:18

Re: Disable screen blanking while specified program is runni

Postby pendrachken » 2018-03-05 15:35

Why are you doing things the hard way?


Just disable screen blanking when you don't want the screen to blank, and re-enable it again when you want screen blanking. It will literally take you half a second to do this versus who knows how long to cobble a bunch of crap together to do it in only certain instances.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P
pendrachken
 
Posts: 1324
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: Disable screen blanking while specified program is runni

Postby bw123 » 2018-03-06 15:18

pendrachken wrote:Why are you doing things the hard way?


Just disable screen blanking when you don't want the screen to blank, and re-enable it again when you want screen blanking. It will literally take you half a second to do this versus who knows how long to cobble a bunch of crap together to do it in only certain instances.


That should work fine disabling screensaver manually. This is very easy to do, no matter what method. Unfortunately people forget. In my case it's when watching movies, which I love. When I watch a movie, I like to get it cued, get the sound set just right, get the snacks together, sit down and stay there. Having to get up and pause the movie, disable the screensaver, and sit back down ruins the whole movie for me. It just isn't the same, and why should I have to remember something that my computer can easily do for me, with proper instruction?

I set my screensaver for ten minutes, which is JUST when a lot of movies are getting good. Here is where the movie is interrupted after ten minutes in some of my favorites.

Blade Runner (Director's Cut) - Harrison Ford eating noodles, "He say you Brade Lunnah."
Godfather (Coppola Restoration)- Wedding Scene, "Twenny, Thirty Grand, Small bills cash..."
Apocalypse Now (Redux) - The mission, "Captain, have you ever seen this gentleman before?"
2001: A Space Odyssey - End of day, awaken to monolith (first appearance).
The Mechanic - Rigging the first murder, plastic explosives in the book.

This exclusion by app idea would be a very welcome feature for me in any screen blank/saver/locking doodad. This wouldn't really be ideal though, because I do like the screensaver to work when I am playng music. That is the idea behind the lightsonplus script. It tried to detect fullscreen on several different media players. I think it's a decent idea, and I'm going to tweak it and give it a try.
User avatar
bw123
 
Posts: 3135
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Disable screen blanking while specified program is runni

Postby wizard10000 » 2018-03-06 16:27

Assuming you are using Gnome since you didn't specify otherwise, what about using a shell script to start your video player?
Code: Select all
#!/bin/bash

killall gnome-screensaver

# start your video player here

gnome-screensaver &

disown

exit 0


edit: I haven't tested this but am reasonably certain it'll work.
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1280
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Disable screen blanking while specified program is runni

Postby debiman » 2018-03-06 18:12

i never have any problems with screenblanking when watching movies. i.e., my media player disables screenblanking automatically.

but op describes a quite different situation.

i wonder how they are getting on?
User avatar
debiman
 
Posts: 2499
Joined: 2013-03-12 07:18

Re: Disable screen blanking while specified program is runni

Postby Josh66 » 2018-03-24 15:02

I haven't found a solution other than temporarily setting the blanking time to 'never'.

But, yes, it also does not blank while watching videos for me - so clearly it's possible.
Josh66
 
Posts: 16
Joined: 2013-08-20 15:02
Location: Columbus, OH

Re: Disable screen blanking while specified program is runni

Postby debiman » 2018-03-25 09:38

Josh66 wrote:I haven't found a solution other than temporarily setting the blanking time to 'never'.

and i don't think you'll find a better solution for your calibrating software.
so is this topic solved now?
User avatar
debiman
 
Posts: 2499
Joined: 2013-03-12 07:18

Re: Disable screen blanking while specified program is runni

Postby Josh66 » 2018-03-30 14:34

debiman wrote:
Josh66 wrote:I haven't found a solution other than temporarily setting the blanking time to 'never'.

and i don't think you'll find a better solution for your calibrating software.
so is this topic solved now?

I don't know if "solved" is the right word, haha! Anyway, it appears that there isn't an easy fix.

Looks like the title of the thread is already too long to add 'solved' to it - it will only let me add two more characters.
Josh66
 
Posts: 16
Joined: 2013-08-20 15:02
Location: Columbus, OH


Return to General Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable