diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2019-05-12 23:31:10 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2019-05-12 23:31:10 -0300 |
commit | ae3595d7ce043c0e53325d258885a7af0c672444 (patch) | |
tree | 57d951db76016630d1c84e41d99562d193b6bec4 | |
parent | 9c756230912a34c0a30cd2da3313e94a4200243a (diff) | |
download | kvmx-ae3595d7ce043c0e53325d258885a7af0c672444.tar.gz kvmx-ae3595d7ce043c0e53325d258885a7af0c672444.tar.bz2 |
Set screen resolution depending on which screen the spice session is currently located
-rw-r--r-- | IDEAS.md | 1 | ||||
-rwxr-xr-x | kvmx | 8 |
2 files changed, 7 insertions, 2 deletions
@@ -1,6 +1,5 @@ # Ideas -* Set screen resolution depending on which display the spice session is at `xrandr` action. * LVM support at `kvmx-create`, with optional LUKS support for the whole volume. * Additional way to handle missing image on `kvmx up` by spawning `kvmx_install` instead of `kvmx-create`. * Fix isolinux support: @@ -2026,7 +2026,13 @@ function kvmx_xrandr { elif [ ! -z "$resolution" ]; then mode="`echo $resolution | tr 'x' ' '`" else - local mode="`xrandr | grep '*+' | awk '{ print $1 }' | tr 'x' ' '`" + # Set resolution according to the current active screen + #local mode="`xrandr | grep '*+' | awk '{ print $1 }' | tr 'x' ' '`" + + # Set screen resolution depending on which screen the spice session is currently located + local id="`xdotool search --name $VM`" + local screen="`xdotool getwindowgeometry $id | grep screen: | cut -d '(' -f 2 | cut -d : -f 2 | cut -d ')' -f 1 | sed -e 's/ //'`" + local mode="`xrandr | grep "Screen ${screen}:" | cut -d , -f 2 | sed -e 's/ current //' -e 's/ //g' | tr 'x' ' '`" if [ ! -z "$resolution_y_offset" ]; then local x="`echo $mode | awk '{ print $1 }'`" |