[SGVLUG] Can I Hear An Indication if the Monitor is on or off?
Jess Bermudes via SGVLUG
sgvlug at sgvlug.net
Thu Aug 2 03:52:47 PDT 2018
Somebody on Stackoverflow pointed out that for some systems,
xset -q
returns some info about the displays currently connected and if the driver
and monitor support it will return a string such as "Monitor is On" if the
display is currently powered on. If that command reports that info for your
system reliably, then I could imagine one could create a shell script to
query that string and then sound a bell by printing an ASCII bell character
`tput bel` or the beep program or aplay or some other audio player program.
https://unix.stackexchange.com/questions/76479/querying-
display-power-status-on-linux-xorg-on-command-line
However, when I tried this on my system, it would still report "Monitor is
On" even if I pressed the power switch to turn off my monitor. This might
mean that my system is merely detecting the physical connection of the
display?
Someone else on another site suggested installing the ddccontrol package
and running
sudo ddccontrol -p
to probe the monitor for details that might indicate power status but it
seems with my Nvidia drivers there might be a bug and it won't work for my
system. Fun times! If you're using the open source drivers you may have
more luck.
Now, even if you found a way to read the state, as far as obtaining a
response by pressing the buttons on the monitor this would be a little more
difficult since most of the time the buttons on the monitor only affect the
microcontroller inside the monitor for the on-screen display controls such
as brightness/contrast. The ability to interface with that microcontroller
would be quite the hardware hacking challenge. What is your goal? Could
this be solved with an out of the box solution such as a photodiode circuit
to point at your monitor and detect the presence of light?
- Jess
On Wed, Aug 1, 2018 at 10:47 AM, Chime Hart via SGVLUG <sgvlug at sgvlug.net>
wrote:
> Well, some days ago I asked a similar question in a blind Linux list, but
> with no responses. Essentially what I would like is if I push the button on
> the monitor, either a tone would play or a message would inform if the
> monitor is on or off? If it were tones, we would probably want asending or
> desending, depending. Also, I suppose only a pc-speaker would handle that.
> Thanks so much in advance for any guidance.
> Chime
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sgvlug.net/pipermail/sgvlug/attachments/20180802/6980fa04/attachment.html>
More information about the SGVLUG
mailing list