Discussion:
An AI-Written "NoDoze" Bash File To Stop Screensavers
(too old to reply)
Dr. Noah Bodie
2024-10-06 22:40:52 UTC
Permalink
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.

NoDoze checks once every 50 seconds (feel free to increase this numeral)
to see if you are watching a video on SMPlayer or on YouTube. If you are
using either one, then the screensaver won't activate. Works great!

---

#!/bin/bash

# Check if smplayer is running.
is_smplayer_running() {
pgrep smplayer > /dev/null
}

# Check if the browser's active tab title contains "YouTube" and "-".
is_youtube_open() {
active_window=$(xdotool getactivewindow getwindowname)
echo "$active_window" | grep -iq "YouTube" && echo "$active_window" |
grep -iq "Mozilla"
}

while true;
do if is_smplayer_running || is_youtube_open;
then xdotool key Shift

fi
# Wait for 50 seconds before checking again. Increase this delay if needed.
sleep 50
done
Big Al
2024-10-07 00:11:03 UTC
Permalink
I did not want to install Caffeine so I prompted ChatGPT to write a script that keeps the
screensaver from activating when you don't want it to activate. IE, while watching videos.
NoDoze checks once every 50 seconds (feel free to increase this numeral) to see if you are watching
a video on SMPlayer or on YouTube. If you are using either one, then the screensaver won't activate.
Works great!
---
#!/bin/bash
# Check if smplayer is running.
is_smplayer_running() {
pgrep smplayer > /dev/null
}
# Check if the browser's active tab title contains "YouTube" and "-".
is_youtube_open() {
active_window=$(xdotool getactivewindow getwindowname)
echo "$active_window" | grep -iq "YouTube" && echo "$active_window" | grep -iq "Mozilla"
}
while true;
do if is_smplayer_running || is_youtube_open;
then xdotool key Shift
fi
# Wait for 50 seconds before checking again. Increase this delay if needed.
sleep 50
done
I had AI write a program for me to prune a folder, the inverse of what I normally do, I wanted all
files BUT a small list deleted. And it did it. I did tweak it a bit but I'm a happy camper.
--
Linux Mint 21.3, Cinnamon 6.0.4, Kernel 5.15.0-122-generic
Al
Dr. Noah Bodie
2024-10-07 07:14:20 UTC
Permalink
Post by Big Al
I had AI write a program for me to prune a folder, the inverse of what I
normally do, I wanted all files BUT a small list deleted. And it did it.
I did tweak it a bit but I'm a happy camper.
i sought an answer to stopping the screensaver (it kept interrupting my
movie watching) but all i found was "Lights On", an older program that
does not work for me. But luckily AI was able to solve the problem quickly!
Paul
2024-10-07 07:37:29 UTC
Permalink
I did not want to install Caffeine so I prompted ChatGPT to write a script that keeps the screensaver from activating when you don't want it to activate. IE, while watching videos.
NoDoze checks once every 50 seconds (feel free to increase this numeral) to see if you are watching a video on SMPlayer or on YouTube. If you are using either one, then the screensaver won't activate. Works great!
---
#!/bin/bash
# Check if smplayer is running.
is_smplayer_running() {
pgrep smplayer > /dev/null
}
# Check if the browser's active tab title contains "YouTube" and "-".
is_youtube_open() {
active_window=$(xdotool getactivewindow getwindowname)
echo "$active_window" | grep -iq "YouTube" && echo "$active_window" | grep -iq "Mozilla"
}
while true;
do if is_smplayer_running || is_youtube_open;
then xdotool key Shift
fi
# Wait for 50 seconds before checking again. Increase this delay if needed.
sleep 50
done
Have you monitored the environment, to watch what the script is doing ?

For example, "xev" in a Terminal session, should see the Shift key being pressed.

First, monitor "xev" without the script running, then start the script and hands-off-keyboard
and watch xev output sent to Terminal.

Paul
Dr. Noah Bodie
2024-10-07 15:33:23 UTC
Permalink
Post by Paul
Have you monitored the environment, to watch what the script is doing ?
For example, "xev" in a Terminal session, should see the Shift key being pressed.
First, monitor "xev" without the script running, then start the script and hands-off-keyboard
and watch xev output sent to Terminal.
Paul
ok, i just tested the xev command and it did show that SHIFT_L was being
sent every 50 seconds, so everything seems to be working right. i didn't
notice any runaway apps in the background.
yossarian >
2024-10-07 13:53:44 UTC
Permalink
On Sun, 06 Oct 2024 19:40:52 -0300
Post by Dr. Noah Bodie
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.
Honest question
What is purpose to use screensaver. New screens don't need saver?
--
Running Linux Mint 21.3 (Virginia) using Kernel=6.5.0-45-generic on x86_64 ,
Cinnamon, lightdm, x11
AMD Ryzen 7 5700G with Radeon Graphics (16) @ 5.288GHz
Paul
2024-10-07 14:29:49 UTC
Permalink
Post by yossarian >
On Sun, 06 Oct 2024 19:40:52 -0300
Post by Dr. Noah Bodie
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.
Honest question
What is purpose to use screensaver. New screens don't need saver?
There are a couple cases to consider:

1) Disable driving the screen. Good for panel types
where the emission of light, wears them out.

2) Varying the pattern over the screen surface, and
keeping the panel running. Plasma might have been
one technology where some of the users liked this method.

https://en.wikipedia.org/wiki/Screen_burn-in

For a lot of users, the topic will be irrelevant. My LCDs
here, don't need any special handling.

There are things that wear on an LCD panel, and blanking the screen,
turns off the CCFL tubes or the edge lighting LEDs.
The intensity of CCFL tubes, drops around 25000 hours
of usage (assuming the inverter for each tube, lasts
that long). Some inverters fail after only a year or two
of usage. LEDs are roughly the same, 25000 to 50000 hours
before they reach only 70% output. Modern LED screw-in
light bulbs have a 10,000 hour rating, and that covers
the SMPS failure in the base of the bulb.

Paul
Dr. Noah Bodie
2024-10-07 14:36:06 UTC
Permalink
Post by yossarian >
On Sun, 06 Oct 2024 19:40:52 -0300
Post by Dr. Noah Bodie
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.
Honest question
What is purpose to use screensaver. New screens don't need saver?
i just do it because i like the "BLASTER" saver. true, it's not really
needed anymore but i want to keep it.
Dr. Noah Bodie
2024-10-07 15:23:38 UTC
Permalink
Post by yossarian >
Post by yossarian >
On Sun, 06 Oct 2024
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.
Honest question
What is purpose to use screensaver. New screens don't need saver?
NOTE: This works great for "power management" (screen blanking) that
laptop owners use to save on battery power. Also I've heard conflicting
reports about screen burn-in on LCD panels.
rbowman
2024-10-07 18:06:10 UTC
Permalink
Post by Dr. Noah Bodie
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want
it to activate. IE, while watching videos.
Honest question What is purpose to use screensaver. New screens don't
need saver?
At work we used caffeine to prevent being logged out after a period of
activity rather than just to prevent the screensaver. One problem with
caffeine is it simulates a keypress of a non-printing character. Most
applications ignore it but vim will try to handle the character.
Bobbie Sellers
2024-10-07 20:04:29 UTC
Permalink
Post by yossarian >
On Sun, 06 Oct 2024 19:40:52 -0300
Post by Dr. Noah Bodie
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.
Honest question
What is purpose to use screensaver. New screens don't need saver?
It is basically a tool for office users to keep others
from looking at their display and tools in use. Also some
people like to look at a good screen saver. If you do not
run, and not even I do, a cathorde ray tub monitor you are
saving the screen brom burning in whatever you are displaying.

bliss
--
b l i s s - S F 4 e v e r at D S L E x t r e m e dot com
Bud Frede
2024-10-25 20:17:55 UTC
Permalink
Post by Bobbie Sellers
Post by yossarian >
On Sun, 06 Oct 2024 19:40:52 -0300
Post by Dr. Noah Bodie
I did not want to install Caffeine so I prompted ChatGPT to write a
script that keeps the screensaver from activating when you don't want it
to activate. IE, while watching videos.
Honest question
What is purpose to use screensaver. New screens don't need saver?
It is basically a tool for office users to keep others
from looking at their display and tools in use. Also some
people like to look at a good screen saver. If you do not
run, and not even I do, a cathorde ray tub monitor you are
saving the screen brom burning in whatever you are displaying.
bliss
Some screensavers also let you put a message on the screen so you can
leave a message for people who come to your desk when you're away.

I think I even saw one that had a feature so people can leave notes for
you when you're away from your desk.

Loading...