List displays that are turned on [duplicate]
This question already has an answer here:
Check if display is powered on in Linux
2 answers
I would like to check if a monitor is turned on so that I can switch the output to it.
xrandr --query
will show all connected displays no matter if they are turned on or not
xrandr --listmonitors
will only list the monitors that are displaying something.
shell
marked as duplicate by Rui F Ribeiro, roaima, GAD3R, elbarna, Jeff Schaller Dec 22 '18 at 1:03
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Check if display is powered on in Linux
2 answers
I would like to check if a monitor is turned on so that I can switch the output to it.
xrandr --query
will show all connected displays no matter if they are turned on or not
xrandr --listmonitors
will only list the monitors that are displaying something.
shell
marked as duplicate by Rui F Ribeiro, roaima, GAD3R, elbarna, Jeff Schaller Dec 22 '18 at 1:03
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Check if display is powered on in Linux
2 answers
I would like to check if a monitor is turned on so that I can switch the output to it.
xrandr --query
will show all connected displays no matter if they are turned on or not
xrandr --listmonitors
will only list the monitors that are displaying something.
shell
This question already has an answer here:
Check if display is powered on in Linux
2 answers
I would like to check if a monitor is turned on so that I can switch the output to it.
xrandr --query
will show all connected displays no matter if they are turned on or not
xrandr --listmonitors
will only list the monitors that are displaying something.
This question already has an answer here:
Check if display is powered on in Linux
2 answers
shell
shell
edited Dec 21 '18 at 17:10
fra-san
1,192214
1,192214
asked Dec 21 '18 at 15:45
schtiehve
61
61
marked as duplicate by Rui F Ribeiro, roaima, GAD3R, elbarna, Jeff Schaller Dec 22 '18 at 1:03
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Rui F Ribeiro, roaima, GAD3R, elbarna, Jeff Schaller Dec 22 '18 at 1:03
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
https://stackoverflow.com/questions/3433203/how-to-determine-if-lcd-monitor-is-turned-on-from-linux-command-line found shell script code to check, a la:
#!/bin/bash export DISPLAY=:0.0
if [ $# -eq 0 ]; then
echo usage: $(basename $0) "on|off|status"
exit 1
fi
if [ $1 = "off" ]; then
echo -en "Turning monitor off..."
xset dpms force off
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "on" ]; then
echo -en "Turning monitor on..."
xset dpms force on
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "status" ]; then
xset -q|sed -ne 's/^[ ]*Monitor is //p'
else
echo usage: $(basename $0) "on|off|status"
fi
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
https://stackoverflow.com/questions/3433203/how-to-determine-if-lcd-monitor-is-turned-on-from-linux-command-line found shell script code to check, a la:
#!/bin/bash export DISPLAY=:0.0
if [ $# -eq 0 ]; then
echo usage: $(basename $0) "on|off|status"
exit 1
fi
if [ $1 = "off" ]; then
echo -en "Turning monitor off..."
xset dpms force off
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "on" ]; then
echo -en "Turning monitor on..."
xset dpms force on
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "status" ]; then
xset -q|sed -ne 's/^[ ]*Monitor is //p'
else
echo usage: $(basename $0) "on|off|status"
fi
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
add a comment |
https://stackoverflow.com/questions/3433203/how-to-determine-if-lcd-monitor-is-turned-on-from-linux-command-line found shell script code to check, a la:
#!/bin/bash export DISPLAY=:0.0
if [ $# -eq 0 ]; then
echo usage: $(basename $0) "on|off|status"
exit 1
fi
if [ $1 = "off" ]; then
echo -en "Turning monitor off..."
xset dpms force off
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "on" ]; then
echo -en "Turning monitor on..."
xset dpms force on
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "status" ]; then
xset -q|sed -ne 's/^[ ]*Monitor is //p'
else
echo usage: $(basename $0) "on|off|status"
fi
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
add a comment |
https://stackoverflow.com/questions/3433203/how-to-determine-if-lcd-monitor-is-turned-on-from-linux-command-line found shell script code to check, a la:
#!/bin/bash export DISPLAY=:0.0
if [ $# -eq 0 ]; then
echo usage: $(basename $0) "on|off|status"
exit 1
fi
if [ $1 = "off" ]; then
echo -en "Turning monitor off..."
xset dpms force off
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "on" ]; then
echo -en "Turning monitor on..."
xset dpms force on
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "status" ]; then
xset -q|sed -ne 's/^[ ]*Monitor is //p'
else
echo usage: $(basename $0) "on|off|status"
fi
https://stackoverflow.com/questions/3433203/how-to-determine-if-lcd-monitor-is-turned-on-from-linux-command-line found shell script code to check, a la:
#!/bin/bash export DISPLAY=:0.0
if [ $# -eq 0 ]; then
echo usage: $(basename $0) "on|off|status"
exit 1
fi
if [ $1 = "off" ]; then
echo -en "Turning monitor off..."
xset dpms force off
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "on" ]; then
echo -en "Turning monitor on..."
xset dpms force on
echo -en "done.nCheck:"
xset -q|grep "Monitor is"
elif [ $1 = "status" ]; then
xset -q|sed -ne 's/^[ ]*Monitor is //p'
else
echo usage: $(basename $0) "on|off|status"
fi
edited Dec 21 '18 at 16:57
answered Dec 21 '18 at 16:27
K7AAY
380319
380319
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
add a comment |
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
That dosen't seem to yield the results I'm looking for. What I wanna do is run a script that only executes when a second Monitor is Physically turned on. This Script will always return the status "on" when one Monitor is on and in usage.
– schtiehve
Dec 21 '18 at 18:45
add a comment |