/usr/lib/python2.7/dist-packages/dispcalGUI/util_x.py is in dispcalgui 1.7.1.6-1.
This file is owned by root:root, with mode 0o644.
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 | # -*- coding: utf-8 -*-
import os
def get_display():
"""
Parse $DISPLAY and return (hostname, display number, screen number)
"""
display = os.getenv("DISPLAY", ":0.0").split(":")
hostname = display[0]
if len(display) > 1:
try:
display_screen = tuple(int(n) for n in display[1].split("."))
except ValueError:
raise ValueError("The DISPLAY environment variable has an unknown "
"format: %r" % os.getenv("DISPLAY"))
display = display_screen[0]
if len(display_screen) > 1:
screen = display_screen[1]
else:
screen = 0
else:
display, screen = 0, 0
return hostname, display, screen
|