How to Determine If Lcd Monitor Is Turned on from Linux Command Line

Detecting if the monitor is powered off

Here is an older answer that might help: How to Determine if LCD Monitor is Turned on From Linux Command Line

Linux retrieve monitor names

sudo get-edid didn't work for me. (EDIT: now works on another computer, Lubuntu 14.10; I'd blame BIOS differences but that's a random guess...)

Anyway under X, xrandr --verbose prints the EDID block. Here is a quick and dirty way to extract it and pass to parse-edid:

#!/bin/bash
xrandr --verbose | perl -ne '
if ((/EDID(_DATA)?:/.../:/) && !/:/) {
s/^\s+//;
chomp;
$hex .= $_;
} elsif ($hex) {
# Use "|strings" if you dont have read-edid package installed
# and just want to see (or grep) the human-readable parts.
open FH, "|parse-edid";
print FH pack("H*", $hex);
$hex = "";
}'

How to control backlight by terminal command

There are many possibilities. Just to name a few:

1.Bare echo

echo 8 > /sys/class/backlight/intel_backlight/brightness

For this to work, the user must be in the video group.

Look at /sys/class/backlight/intel_backlight/max_brightness to see what maximum brightness is supported.

2.The simplest to use

Install xbacklight package and then try

 xbacklight -inc 20     # increase backlight by 20%
xbacklight -dec 30 # decrease by 30%
xbacklight -set 80 # set to 80% of max value
xbacklight -get # get the current level

3.Over sophisticated

Run xrandr --verbose and look for a line with resolution like LVDS1 connected 1024x600+0+0. The name of your display (LVDS1 in this example) is needed here. Now you are ready to set brightness

xrandr --output LVDS1 --brightness 0.4

But this sets only software, not hardware brightness so you can exceed the limits (in both directons). Don't expect beautiful results but if you are brave enough to experiment a little bit then fasten your seatbelt and run

xrandr --output LVDS1 --brightness 1.7
xrandr --output LVDS1 --brightness -0.4 #yes, negative value is possible
xrandr --output LVDS1 --brightness 1

You can torture more your display with xrandr, but be ready to reboot your computer if something goes wrong. For example play with the following

xrandr --output LVDS1 --reflect x
xrandr --output LVDS1 --reflect xy
xrandr --output LVDS1 --reflect normal # return to normal state
xrandr --output LVDS1 --rotate left
xrandr --output LVDS1 --rotate inverted
xrandr --output LVDS1 --rotate normal # again, back to normal

Checking if a Screen of the Specified Name Exists

You can grep the output of screen -list for the name of the session you are checking for:

if ! screen -list | grep -q "myscreen"; then
# run bash script
fi

Why does my lcd console turn off if I let the imx6 board stay idle for 10 minutes?

You are probably seeing the console blanking timeout after 10 minutes, which turns off the display. To check the timeout value:

$ cat /sys/module/kernel/parameters/consoleblank
600

To disable it permanently, add consoleblank=0 to the kernel commandline. For example by editing your U-Boot environment.

You can find the code, that is responsible for this in drivers/tty/vt/vt.c.

Linux/shell command to control screen brightness in android

Try this command too,

echo 100 > /sys/devices/platform/nov_cabc.0/leds/lcd-backlight/brightness

or

echo 100 > brightness


Related Topics



Leave a reply



Submit