diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-10-03 11:26:46 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-10-03 11:26:46 -0300 |
commit | 33a23a1cb3b9dffdbf6592089a17dafaabb7f5a6 (patch) | |
tree | 278b2ebad1e2732752fd4ef8ed0cde8a864866f3 | |
parent | 46187fe284aebe3926ea85049d872353edc97b56 (diff) | |
download | kvmx-33a23a1cb3b9dffdbf6592089a17dafaabb7f5a6.tar.gz kvmx-33a23a1cb3b9dffdbf6592089a17dafaabb7f5a6.tar.bz2 |
Detect resolution dynamically at kvmx_xephyr
-rwxr-xr-x | kvmx | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1075,8 +1075,23 @@ function kvmx_xephyr { GUEST_DISPLAY="`cat $DISPLAYFILE`" XDMCP_PORT="`cat $XDMCPPORTFILE`" + # Check for resolution configuration if [ ! -z "$resolution" ]; then resolution="-screen $resolution" + else + # Detect resolution dynamically + if which xwininfo &> /dev/null; then + resolution="`xwininfo -root | grep -- '-geometry' | cut -d '+' -f 1 | sed -e 's/-geometry//'`" + + # Check for resolution_x_offset and resolution_y_offset configuration + if [ ! -z "$resolution_x_offset" ] || [ ! -z "$resolution_y_offset" ]; then + local width="`echo $resolution | cut -d 'x' -f 1`" + local height="`echo $resolution | cut -d 'x' -f 2`" + resolution="$(($width $resolution_x_offset))x$(($height $resolution_y_offset))" + fi + + resolution="-screen $resolution" + fi fi if ! which Xephyr &> /dev/null; then |