nathanRamaNoodles / backlight_dimmer

Control the backlight on the official RPF display based on a touch event.
2 stars 2 forks source link

possible to make screen stay on when playing a video in chrome or kodi #4

Open Qlink84 opened 3 years ago

Qlink84 commented 3 years ago

Hi @nathanRamaNoodles ,

your backlight_dimmer works great. Appreciate it.

However, is it possible to make the screen stay on when a video is playing in chrome or kodi is running with a video or slideshow ?

Actually screen will get turned off, no matter if any media is playing or shown...

nathanRamaNoodles commented 3 years ago

What you can do is check if there is audio running on your audio card, and then suspend accordingly. here is how you can check if a audio is playing in Linux

Qlink84 commented 3 years ago

So i have to install xmacroplay and autostart following script on reboot:

#!/bin/bash
# Script to prevent screen blanking when audio is playing.
if [ -z DISPLAY ]; then
   DISPLAY=:0
fi
while true; do
    sleep 50
    if pacmd list-sink-inputs  | grep -w state | grep -q RUNNING ; then
        xdotool mousemove_relative -- -1 -1
        sleep 1
        xdotool mousemove_relative -- 1 1 
    fi
done

Is that correct ? Unfortunately this won't work for playing a slideshow through kodi, because there is no audio output ... any idea on this ?

nathanRamaNoodles commented 3 years ago

You can try checking if an application is in full screen