/usr/share/checkbox/scripts/resolution_test is in checkbox 0.13.7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/usr/bin/python
import sys
from optparse import OptionParser
from gi.repository import Gdk
def check_resolution():
screen = Gdk.Screen.get_default()
n = screen.get_n_monitors()
for i in xrange(n):
geom = screen.get_monitor_geometry(i)
print 'Monitor %d:' % (i + 1)
print ' %d x %d' % (geom.width, geom.height)
def compare_resolution(min_h, min_v):
# Evaluate just the primary display
screen = Gdk.Screen.get_default()
geom = screen.get_monitor_geometry(screen.get_primary_monitor())
return geom.width >= min_h and geom.height >= min_v
def main(args):
usage = "Usage: %prog [OPTIONS]"
parser = OptionParser(usage=usage)
parser.add_option("--horizontal",
type="int",
default=0,
help="Minimum acceptable horizontal resolution.")
parser.add_option("--vertical",
type="int",
default=0,
help="Minimum acceptable vertical resolution.")
(options, args) = parser.parse_args(args)
if (options.horizontal > 0) and (options.vertical > 0):
return not compare_resolution(options.horizontal, options.vertical)
else:
check_resolution()
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
|