diff --git a/i3ipc/_private/sync.py b/i3ipc/_private/sync.py index a568e30..6978a78 100644 --- a/i3ipc/_private/sync.py +++ b/i3ipc/_private/sync.py @@ -1,9 +1,5 @@ -from Xlib import display -from Xlib.protocol import event -from Xlib import X import random - class Synchronizer: def __init__(self): self.display = display.Display() diff --git a/i3ipc/aio/connection.py b/i3ipc/aio/connection.py index cdbf2c9..4755853 100644 --- a/i3ipc/aio/connection.py +++ b/i3ipc/aio/connection.py @@ -7,8 +7,6 @@ import os import json from typing import Optional, List, Tuple, Callable, Union -from Xlib import display, X -from Xlib.error import DisplayError import struct import socket import logging @@ -203,22 +201,6 @@ def exists(path): if exists(socket_path): return socket_path - # next try the root window property - try: - d = display.Display() - atom = d.get_atom('I3_SOCKET_PATH') - root = d.screen().root - prop = root.get_full_property(atom, X.AnyPropertyType) - if prop and prop.value: - socket_path = prop.value.decode() - except DisplayError as e: - logger.info('could not get i3 socket path from root atom', exc_info=e) - - if socket_path: - logger.info('got socket path from root atom: %s', socket_path) - if exists(socket_path): - return socket_path - # finally try the binaries for binary in ('i3', 'sway'): try: diff --git a/i3ipc/connection.py b/i3ipc/connection.py index 978e962..50d3d44 100644 --- a/i3ipc/connection.py +++ b/i3ipc/connection.py @@ -14,9 +14,6 @@ import os from threading import Timer, Lock import time -import Xlib -import Xlib.display -from Xlib.error import DisplayError import logging from subprocess import run, PIPE @@ -86,20 +83,6 @@ def _find_socket_path(self): logger.info('got socket path from SWAYSOCK env variable: %s', socket_path) return socket_path - try: - disp = Xlib.display.Display() - root = disp.screen().root - i3atom = disp.intern_atom("I3_SOCKET_PATH") - prop = root.get_full_property(i3atom, Xlib.X.AnyPropertyType) - if prop and prop.value: - socket_path = prop.value.decode() - except DisplayError as e: - logger.info('could not get i3 socket path from root atom', exc_info=e) - - if socket_path: - logger.info('got socket path from root atom: %s', socket_path) - return socket_path - for binary in ('i3', 'sway'): try: process = run([binary, '--get-socketpath'], stdout=PIPE, stderr=PIPE) @@ -116,7 +99,7 @@ def _find_socket_path(self): logger.info('could not get i3 socket path from `%s` binary', binary, exc_info=e) continue - logger.info('could not find i3 socket path') + logger.info('could not find i3/sway socket path') return None def _sync(self): diff --git a/setup.py b/setup.py index ff97f03..8b7264c 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools import setup, find_packages REQUIRES_PYTHON = '>=3.4.0' -REQUIRED = ['python-xlib'] +REQUIRED = [] EXTRAS = {} here = os.path.abspath(os.path.dirname(__file__)) diff --git a/test/aio/window.py b/test/aio/window.py index aed6cc7..c51b470 100644 --- a/test/aio/window.py +++ b/test/aio/window.py @@ -2,7 +2,6 @@ from Xlib.display import Display from threading import Thread - class Window(object): def __init__(self, display=None): if display is None: