You are not logged in.

#1 2012-09-03 08:04:41

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Disable turn off screen while youtube is watching

I want disable screen blanking if I am watching something in fullscreen(eg YouTube).
If I watching movies in offline player (VLC) there is no problem, screen not blanking. It happens when I watching online players like YT.

How can i fix them?

Offline

#2 2012-09-03 08:06:45

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,681

Re: Disable turn off screen while youtube is watching

 xset -dpms

Offline

#3 2012-09-03 08:31:23

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: Disable turn off screen while youtube is watching

Perhaps I wrote something wrong.

I do not want disable completely blanking screen, but only when I watching something on fulscreen.

Anyway I did it by option offtime in xorg.conf.

Offline

#4 2012-09-03 08:47:40

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: Disable turn off screen while youtube is watching

You should create a daemon that detects certain fullscreen windows and then issues commands to inhibit the screensaver, disable dpms, prevent standby,
Edit: Start here: https://github.com/unhammer/lightsOn

Last edited by progandy (2012-09-03 08:51:00)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2012-09-03 09:12:00

kanine5
Member
Registered: 2011-06-14
Posts: 10

Re: Disable turn off screen while youtube is watching

There's an app called caffeine, you might find that useful.
Link here: https://launchpad.net/caffeine

I think the package in in the AUR

Offline

#6 2012-09-03 10:20:26

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: Disable turn off screen while youtube is watching

Thanks progandy this script looks fine.
I added this script to my autostart in openbox, this is enough to work?

Last edited by xorgx3 (2012-09-03 10:21:11)

Offline

#7 2012-09-03 11:13:16

jv2112
Member
Registered: 2011-07-23
Posts: 160

Re: Disable turn off screen while youtube is watching

Nice Script! :-)


Life is pleasant. Death is peaceful. It's the transition that's troublesome. Isaac Asimov - / -

Offline

#8 2012-09-03 11:18:16

solamir
Member
From: Yaroslavl, Russia
Registered: 2012-09-02
Posts: 26
Website

Re: Disable turn off screen while youtube is watching

You can launch your browser by script:

#!/bin/bash
firefox &
while true
do
xdotool key shift; sleep 60
done

Xdotool will be pressing shift key once a minute. Сertainly package xdotool (from community) must be installed in your sistem.

Last edited by solamir (2012-09-03 11:42:37)

Offline

#9 2012-09-03 11:33:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Disable turn off screen while youtube is watching

solamir wrote:

You can launch your browser by script:

#!/bin/bash
firefox &
while true
do
xdotool key shift; sleep 60
done

Xdotool will be pressing shift key once a minute. Сertainly package xdotool (from community) must be installed in your sistem.

http://xkcd.com/196/

solamir, if you want to paste a snippet of code, please use [ code ] tags

like this

It makes the code more readable and - in case of longer listings - more convenient to scroll through.

Offline

#10 2012-09-03 11:49:19

solamir
Member
From: Yaroslavl, Russia
Registered: 2012-09-02
Posts: 26
Website

Re: Disable turn off screen while youtube is watching

Thank you, karol.
It's fixed.

Offline

#11 2012-09-05 06:04:00

xorgx3
Member
From: Poland
Registered: 2011-11-29
Posts: 197

Re: Disable turn off screen while youtube is watching

Hmm, it's my again.
I like this script: https://github.com/unhammer/lightsOn
But I added it to autostart and it not working correctly. I'm using openbox.
This is my autostart :

tint2 &
sh ~/.fehbg &
conky -c ~/.conkyrc &
sleep 8 && conky -c ~/.conkyrc2 &
exec setxkbmap pl &
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
#volumeicon &
sh ~/.scripts/lightsOn.sh 250 &

How to do this script check fullscreen every 4 minutes?

I hope you understand what my problem is.

Offline

#12 2018-10-20 06:59:16

thrashzone_ua
Member
Registered: 2018-04-10
Posts: 5

Re: Disable turn off screen while youtube is watching

I have such solution: listen to sound output and if it is running - emulate a key event.
script:

#!/bin/bash
while true; do
  sleep 30
  RUNNING=$(pacmd list-sink-inputs  | grep -w state | grep RUNNING)
  if [ -n "${RUNNING}" ]; then
    xdotool key shift
  fi
done

and run it in .xinitrc like this:

sh /path-to-script/script-name.sh &

putting this line before starting DE

yes, it's quite an old topic, but I hope my solution will be helpful for somebody

Offline

#13 2018-10-20 09:48:03

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: Disable turn off screen while youtube is watching

if your browser doesn't daemonize, you can just have xset before and after your browser in your launcher script, i.e.

xset -dpms
firefox
xset +dpms

Last edited by HiImTye (2018-10-20 09:48:17)

Offline

#14 2018-10-20 22:27:43

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,718
Website

Re: Disable turn off screen while youtube is watching

Thanks for sharing. I'm going to go ahead and close this old topic now.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB