I am almost done with my Display conky widget. I need some help getting info from xrandr output. The first line relating to port 2 will be either
HDMI-A-1 connected 2560x1440+2560+0
or HDMI-A-1 disconnected
I need a command one-liner to check if HDMI-A-1 says connected or disconnected. If disconnected print "No monitor detected", if connected, print $3 but strip the "+2560+0" from the end.
The closest my online resource can come up with is:
Code: Select all
${exec xrandr --query | grep 'HDMI-A-1 connected' >/dev/null && xrandr --query | grep 'HDMI-A-1 connected' | awk '{print $3}' || echo "No monitor detected" | sed 's/+2560+0//'}
Thank you,
Logan