4

How can I know whether the monitor is on or off if X is not running, and without appealing to /proc/acpi/video? The latter isn't available from my kernel.

If X is running it's just a matter of

  $ DISPLAY=:0 xset -q 2>/dev/null| grep "^\s*Monitor is"

But what if X is not running?

1
  • I bet there's an answer buried somewhere in /sys
    – djeikyb
    Jul 10, 2013 at 21:21

1 Answer 1

1

Looking through this Q&A on StackOverflow titled: How to Determine if LCD Monitor is Turned on From Linux Command Line I found this utility called ddccontrol that says it can report if a monitor is turned on or off. You can check out the documentation for using version 0.4.

You can basically run this command:

$ ddccontrol -p

If it returns any output, then the monitor is on, if it returns nothing the monitor is off.

References

2
  • The OP is doing this already. The main question is what to do if X is not running.
    – Joseph R.
    Jul 10, 2013 at 23:03
  • @JosephR. - see updates.
    – slm
    Jul 11, 2013 at 0:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .