Hello LQ, this is my first time posting though I've often found answers to my questions here before.
So, here's some background. I'm running Debian Jessie inside a chroot using Crouton on my HP Chromebook 14, using KDE as my default window manager. I wrote some simple bash scripts that use xrandr to manipulate the screens when I run certain applications, for example:
Code:
#!/bin/bash
if [ "$(xrandr -q | grep " connected" | grep "HDMI2" | wc -l)" == "1" ]
then
xrandr --output eDP1 --off
xrandr --output HDMI2 --mode 1280x720
fi
vlc
if [ "$(xrandr -q | grep " connected" | grep "HDMI2" | wc -l)" == "1" ]
then
xrandr --output eDP1 --auto
xrandr --output HDMI2 --right-of eDP1
xrandr --output HDMI2 --auto
fi
exit 0
Basically what this does is detects if I have a monitor connected to my HDMI output and if so it turns off the laptop screen and runs VLC in the 1280x720 mode on the connected screen, then reverts when I exit VLC.
So here's where the question comes: I also have an HDMI/VGA converter that I can use with an old VGA monitor I have laying around, but that monitor doesn't support the 1280x720 resolution mode. So, I would like to be able to have my script detect which monitor is connected and modify its behavior accordingly.
Here's where it gets challenging: Web searches turned up that I can read Xorg.0.log to do this, but as I said before, I'm inside a chroot on my Chromebook and I don't actually have an Xorg.0.log file. Is there some other way, such as a command line tool, for me to read data about my connected monitor?
Thanks in advance for any info you guys can provide!