Code: Select all
#!/bin/sh
S="1.0"
A=$(xrandr --current | egrep -m1 "connected" )
B=$(echo $A | cut -f 1 -d " ")
xrandr --output $B --brightness $S
Code: Select all
root# xrandr --current
Screen 0: minimum 320 x 200, current 1920 x 1848, maximum 8192 x 8192
VGA-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
1920x1080 60.0*+ 50.0 59.9 30.0 30.0
1920x1080i 60.1 50.0 60.0
1680x1050 59.9
1280x1024 75.0 60.0
1440x900 75.0 59.9
1280x720 60.0 50.0 59.9
1440x576i 50.1
1024x768 75.1 60.0
1440x480i 60.1 60.1
800x600 75.0 60.3
720x576 50.0
720x480 60.0 59.9
640x480 75.0 72.8 66.7 60.0 59.9
720x400 70.1
LVDS connected 1366x768+0+1080 (normal left inverted right x axis y axis) 353mm x 198mm
1366x768 60.0*+
1280x720 59.9
1152x768 59.8
1024x768 59.9
800x600 59.9
848x480 59.7
720x480 59.7
640x480 59.4
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
Code: Select all
root# xrandr --current | egrep -m1 "connected"
VGA-0 disconnected (normal left inverted right x axis y axis)
Code: Select all
xrandr --current | grep -m1 -w "connected"