Kaydet (Commit) 23f02e16 authored tarafından Clement Lefebvre's avatar Clement Lefebvre

Virtualbox: Bump live resolution to a minimum of 1024x768px

üst 7daff245
[Desktop Entry]
Name=Bump Virtualbox Resolution
Comment=Increase resolution to 1024x768 if it's below that value
Exec=bump-virtualbox-resolution
Terminal=false
Type=application
Icon=virtualbox
StartupNotify=false
Categories=System;Monitor;
\ No newline at end of file
#!/usr/bin/python3
import subprocess
import gi
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk
out = subprocess.run(["xrandr"], capture_output=True).stdout.decode()
outlines = out.split("\n")
output = None
for line in outlines:
if ("Virtual" in line) and ("primary" in line):
output = line.partition(" ")[0]
monitor = Gdk.Display.get_default().get_primary_monitor()
geo = monitor.get_geometry()
if output:
print("Found virtual display: %s" % output)
if geo.height < 768:
subprocess.run(["xrandr", "--output", output, "--mode", "1024x768"])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment