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
How to Correctly Cleanup and Re-Use Sysv Shared Memory Segments
Delimited by Comma Using Awk or Sed with the Tags Below
Dbd::Oracle Installation Causing Error
How to Filter the Running Nodes
Count the Number of Executable Files in Bash
Multiple Ip Addresses on Google Cloud Compute
Counting Number of Lines in a File Using Grep and Wc
Get Started with Latex on Linux
How to Gzip All Files in All Sub-Directories into One Compressed File in Bash
Highlight Text Similar to Grep, But Don't Filter Out Text
Dd: How to Calculate Optimal Blocksize
Delete .Ds_Store Files in Current Folder and All Subfolders from Command Line on MAC
Linux - Replacing Spaces in the File Names
Can Linux Cat Command Be Used for Writing Text to File
In Unix, How to Run 'Make' in a Directory Without Cd'Ing to That Directory First
How to Get a List of Programs Running with Nohup