Xfce Forum

Sub domains
 

You are not logged in.

#1 2023-12-20 17:26:45

Friedrich
Member
Registered: 2016-09-18
Posts: 140

[SOLVED] Check whether a Monitor is on or off

Hi,

i have a normal monitor and my tv connected to the xubuntu system. i want to check in a script whether they are on or off. i tried xset -q, xrandr and sysfs nothing is working. when the tv is off xset or xrandr or sysfs tell me its on or connected. but when i turn the tv on the monitor gets black for a moment so something happens and the system recognizes there is a second display now. is there an other way to check whether tey are on or off? is there a xfec command or can i read that information somewhere?

Last edited by Friedrich (2024-01-06 08:43:29)

Offline

#2 2024-01-03 22:22:37

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Re: [SOLVED] Check whether a Monitor is on or off

No ideas?

Offline

#3 2024-01-03 23:31:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,482

Re: [SOLVED] Check whether a Monitor is on or off

Can you post back the xrandr output for when the monitor is on and off? Also, what is the make and model of the monitor and how is it connected?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#4 2024-01-04 08:33:16

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Re: [SOLVED] Check whether a Monitor is on or off

This is the output when the monitor is on and the tv is off. Its the same when the tv is on. Is there a difference between "connected" and "off"?

xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 531mm x 298mm
   1920x1080     60.00*+
   1680x1050     59.95  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      60.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
HDMI-0 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 1600mm x 900mm
   3840x2160     60.00 +  59.94    50.00    29.97    25.00    23.98  
   4096x2160     59.94    50.00    29.97    25.00    24.00    23.98  
   1920x1080    119.88   100.00    60.00*   59.94    50.00    29.97    25.00    23.98    60.00    50.04  
   1360x768      60.02  
   1280x1024     60.02  
   1280x720      59.94    50.00  
   1152x864      60.00  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x480       59.94  
   640x480       59.95    59.94    59.93  

Offline

#5 2024-01-04 12:00:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,482

Re: [SOLVED] Check whether a Monitor is on or off

Interesting the xrandr is still showing it as connected. Is it somehow still sending a power signal?

Since its HDMI, how about using something like ddclient?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#6 2024-01-05 18:02:45

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Re: [SOLVED] Check whether a Monitor is on or off

ToZ wrote:

Interesting the xrandr is still showing it as connected. Is it somehow still sending a power signal?

Since its HDMI, how about using something like ddclient?

How can i check if there is a power signal?

ddccontrol gives me the same output when one, both or no monitor/tv is on. Its the same problem when using xrandr.

Offline

#7 2024-01-05 18:34:12

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,482

Re: [SOLVED] Check whether a Monitor is on or off

I was just testing this myself now that I have an external monitor connected (HDMI) and it doesn't work for me either.  Some more suggestions here, but it doesn't look promising.

Does the following work for you (requires the ddcutil package)?

sudo modprobe i2c-dev
sudo ddcutil detect

I get:

Invalid display
   I2C bus:  /dev/i2c-2
   DRM connector:           card1-HDMI-A-1
   EDID synopsis:
      Mfg id:               ACR - Acer Technologies
      Model:                S200HQL
      Product code:         857  (0x0359)
      Serial number:        LZ3AA0062426
      Binary serial number: 1417686462 (0x54802dbe)
      Manufacture year:     2015,  Week: 48
   DDC communication failed. (getvcp of feature x10 returned Error_Info[DDCRC_RETRIES in ddc_write_read_with_retry, causes: DDCRC_DDC_DATA, DDCRC_READ_ALL_ZERO(9)])
   DRM reports the monitor is disabled.
   DRM reports the monitor status is disconnected.

...while the monitor is powered off.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#8 2024-01-05 20:38:14

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Re: [SOLVED] Check whether a Monitor is on or off

Thats what i get:

Display 1
   I2C bus:  /dev/i2c-3
   EDID synopsis:
      Mfg id:               BNQ
      Model:                BenQ GL2480
      Product code:         30957
      Serial number:        ETJ5M0068304U
      Binary serial number: 257 (0x00000101)
      Manufacture year:     2021,  Week: 20
   VCP version:         2.2

Invalid display
   I2C bus:  /dev/i2c-4
   EDID synopsis:
      Mfg id:               GSM
      Model:                LG TV
      Product code:         1
      Serial number:        
      Binary serial number: 16843009 (0x01010101)
      Manufacture year:     2017,  Week: 1
   DDC communication failed

but both are on.

Offline

#9 2024-01-05 23:21:19

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,482

Re: [SOLVED] Check whether a Monitor is on or off

The LG TV doesn't support DDC. I'm sorry but I don't know what else to try to determine whether its physically on or off.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#10 2024-01-06 08:43:01

Friedrich
Member
Registered: 2016-09-18
Posts: 140

Re: [SOLVED] Check whether a Monitor is on or off

A new tv is planed this year. Good to know what i can do when xrandr doesnt work. Thanks.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 561.48 KiB (Peak: 578.32 KiB) ]