Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions i3ipc/_private/sync.py
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
18 changes: 0 additions & 18 deletions i3ipc/aio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 1 addition & 18 deletions i3ipc/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))
Expand Down
1 change: 0 additions & 1 deletion test/aio/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down