remove Xlib dependency; it's kind of unneccesary -- we will default to 1 monitor if xrandr fails to shell out anyways
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmBzd3EACgkQO3+8IhRO Y5gOgQ//XeoH1o2FxYHOIxORrurC6Dd2PkQOsIbHdgdogRZlrTNlXXUoz5M4Z+12 mtvOZf1d/MuO9A4sGKi1gk5FY8RadBOsSPp4LuPsICzfz8S8xfNFGmIlp2jyJr3e dQ4sxq/IDjc80Wo/dw19o/iBthIRswDhSOPz7jREykrG68MEiYwHuCtrhUve5SmK VELNMRwgFEw4ZVypyZK7RMRaFI1FxdjTc5AjBKvvOd5g3J4xWZjXsoOocewBEHor zpRN63tsCNxpJ0QcvbGJbadgJ1CLOeqT+7C1dMFJ4ZvAYhsQHZKGWzmJmtF6WpFE g6WhnIU8E9ipXuvCcX0zTLyCgfVzSizqbxcmRQXuvZJYtIismpzTK2aEDYEOmNri 2LC+tNQLsD5Es/lopZmW3JJqTQq1Nmq1Q/06B34iROvyRtch8vvEseGOj9ZwAsSx uB9cl7fotD7zBE8KgxtLaIVyvGKZGhqsOBznS6bpmz+gswQKEflI19sejCXpiqz9 Fr+Rb5/j/y0pda7fwl9XPLaTP7HUVG7tT/WmTRTnXqJkP2c6nRnbkYvThVtbK93s aNQRKfOdPJ3xwxdbbL11rup/4DtbkMHNRslfRXxLxp1jdPnhWjl3/CNgz9DCMKWC bLdoGHnuW5nU5j4lEYcE4O1ooObyggtQFL0yJztvNvSeCRF/zTc= =gWQX -----END PGP SIGNATURE-----
1 files changed,
5 insertions(+),
8 deletions(-)
jump to
M
nitroplasm.py
→
nitroplasm.py
@@ -21,7 +21,6 @@ QLabel, \
QSizePolicy import sys from PyQt5.QtGui import QPixmap -from Xlib import display import subprocess import dbus import argparse@@ -105,14 +104,12 @@ def set_layout(self, index):
self.layout = self.layout_selector.itemData(index) def get_displays(self): - if 'RANDR' in display.Display().list_extensions(): - try: - output = [l for l in subprocess.check_output(["xrandr"]).decode("utf-8").splitlines()] - return len([l.split()[0] for l in output if " connected " in l]) - except: - return 1 - else: + try: + output = [l for l in subprocess.check_output(["xrandr"]).decode("utf-8").splitlines()] + return len([l.split()[0] for l in output if " connected " in l]) + except: return 1 + def set_monitor(self, index): self.monitor = self.monitor_selector.itemData(index)