I'm having a problem that this great script could fix, but I can't make it work, I hope someone can help.
My problem is I need to use compton compositor but when it's activated it makes google chrome froze video when go to fullscreen. My solution now is manually stop compton when I want to watch fullscreen videos on chrome using "killall compton" and activate it again when I end watching those videos "compton -b".
I think this script could be adapted to do those two actions automatically when detects fullscreen video on chrome, but I cant make it work, even wihout making any change.
I mean, when I launch the script I get this message:
bash: ./lightsOn.sh: /bin/bash^M: bad interpreter: No such file or directory
What am I doing wrong??
Many thanks in advance
]]>I've created a AUR package in order to update LightsOn+ more easily.
Thank you. How to use it. Should I just install it or should I put script in autostart also? Which one of twos?
BTW, it doesn't work:
$ lightsonplus
No screensaver detected
But screensaver is set.
P.S. I found that this fork works OK. But before you need to install qt5 (all) or should follow recommendation from this page
]]>In this version there is an additional option of "Dim Screen" (don't know if it was already there before or not). If I set this option to 2 min, the screen gets dim initially after 1 min by some %age. And after the actual 2 minutes it gets reduced to 0%. And of course, after 5 min the screen is switched off. (With my current settings it goes from a starting 86%=>40%=>0%=>off).
If I increase the dim screen time to e.g. 5 minutes, the first dim-step comes after approx 2 minutes. Is there a formula at work here?
Although the script works fine against the "Switch off" mechanism, but it doesn't stop the dimming. I thought I would get the value from xset -q and parse it to get an automatic default value, but I couldn't find the dim setting there either. So I have the following questions
1. How to determine in the script if dimming feature is active or not
2. If active then what is it's value
3. Is there a formula in play that calculates the initial dimming time based on the actual time value given by user for dimming to 0%
Any ideas how to make this work without having to turn the Dimming feature off completely?
]]>Thank you.
]]>Anyway in that lines sholud be *Chrom* instead of *chrom* (upper letter at the beginning).
if [[ "$activ_win_title" = *Chrom* ]];then
if [[ "$activ_win_title" = *Chromium* || "$activ_win_title" = *Firefox* ]];then
and when we use Firefox:
if [[ "$activ_win_title" = *Firefox* || "$activ_win_title" = *plugin-container* ]];then
instead of
if [[ "$activ_win_title" = *unknown* || "$activ_win_title" = *plugin-container* ]];then
fuser /dev/snd/timer
#html5 (Firefox or Chromium full-screen)
if [ $html5_detection == 1 ];then
if [[ "$activ_win_title" = *chromium* || "$activ_win_title" = *Firefox* ]];then
#check if firefox or chromium is running.
if [[ `pgrep -l firefox | grep -wc firefox` -ge 1 || `pgrep -l chromium | grep -wc chromium` -ge 1 ]]; then
return 1
fi
fi
fi
Thanks for keeping it updated.
]]>I added support for other display numbers (e.g. remote desktop), a manually inhibit command and include some mentioned fixes
Sorry for the name and for forking.
]]>pgrep -lfc ".*((c|C)hrome|chromium).*flashp.*"
shows me 0 if chromium is off, 15(or greater) if I am using flash(pepper flash) and another number otherwise.
I can't resolve problem myself so i hope you can.
If it important I am using awesomeWM.
EDIT:
Ok, i found solution.
Original code:
if [ $chromium_flash_detection == 1 ];then
if [[ "$activ_win_title" = *exe* ]];then
# Check if Chromium/Chrome Flash process is running
flash_process=`pgrep -lfc ".*((c|C)hrome|chromium).*flashp.*"`
if [[ $flash_process -ge 1 ]];then
return 1
fi
fi
fi
little changed code:
# Check if user want to detect Video fullscreen on Chromium, modify variable chromium_flash_detection if you dont want Chromium detection
if [ $chromium_flash_detection == 1 ];then
#if [[ "$activ_win_title" = *exe* ]];then
if [[ "$activ_win_title" = *chromium* ]];then
# Check if Chromium/Chrome Flash process is running
#flash_process=`pgrep -lfc ".*((c|C)hrome|chromium).*flashp.*"`
flash_process=`pgrep -lfc "chromium --type=ppapi"`
if [[ $flash_process -ge 1 ]];then
return 1
fi
fi
fi
It's looks like working
I don't know why in original code was "exe" instead of "chromium" or "chrome".
I think (if you need this) you can comment lines: if activ window bla bla and fi, then lightson will working always if you use flash.
]]>