Skip to content
Snippets Groups Projects
Commit 3d1f5b8f authored by Florent Gluck's avatar Florent Gluck
Browse files

updated README.md

parent 915dbfdf
Branches
No related tags found
No related merge requests found
......@@ -707,13 +707,10 @@ sudo apt-get install qemu-guest-agent
### [2] How to automatically change the display resolution when the window's dimensions change?
Some desktop environments automatically take care of this out of the box. Gnome in Ubuntu does it automatically, but XFCE doesn't do it for instance.
Here is what to do to solve this issue.
1. If the `~/.local/bin` directory doesn't exist, create it:
```bash
mkdir -p ~/.local/bin/
```
1. Then create the bash script below and save it into `~/.local/bin/update-virt-display`:
Below we desribe what to do to solve this issue. The idea is to execute a script that runs indefinitely. The scripts' purpose is to monitor the display output and whenever a change of resolution is detected, it adjusts the display to the newly detected resolution.
1. As root, create the bash script below and save it into `/usr/local/bin/update-virt-display`:
```bash
#!/bin/bash
......@@ -724,10 +721,11 @@ Here is what to do to solve this issue.
xrandr --output "$(xrandr | awk '/ connected/{print $1; exit; }')" --auto
done
```
1. Finally, execute the script at the beginning of the session. How to achieve this depends on the window manager being used. For instance, with XFCE go to "Settings Manager" -> "Session and Startup" -> "Application Autostart" and add a new entry with the following details:
| | |
|--- |--- |
| Name | `update-virt-display` |
| Description | Monitor screen resolution changes and update the desktop size accordingly |
| Command | `bash /home/nexus/.local/bin/update-virt-display` |
| Trigger | on login |
1. As root, make the script executable with:
```
chmod +x /usr/local/bin/update-virt-display
```
1. Then, for each user you want to support, create a `~/.xprofile` with the following content:
```
/usr/local/bin/update-virt-display &
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment