Skip to content

Commit 55cbe33

Browse files
authored
Xlib dependency re-removed, a feature of 1.3.0 that was regressed in 2.0.1.
1 parent a670f24 commit 55cbe33

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

i3ipc/_private/sync.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
from Xlib import display
2-
from Xlib.protocol import event
3-
from Xlib import X
41
import random
52

6-
73
class Synchronizer:
84
def __init__(self):
95
self.display = display.Display()

i3ipc/connection.py

+1-18
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
import os
1515
from threading import Timer, Lock
1616
import time
17-
import Xlib
18-
import Xlib.display
19-
from Xlib.error import DisplayError
2017
import logging
2118
from subprocess import run, PIPE
2219

@@ -86,20 +83,6 @@ def _find_socket_path(self):
8683
logger.info('got socket path from SWAYSOCK env variable: %s', socket_path)
8784
return socket_path
8885

89-
try:
90-
disp = Xlib.display.Display()
91-
root = disp.screen().root
92-
i3atom = disp.intern_atom("I3_SOCKET_PATH")
93-
prop = root.get_full_property(i3atom, Xlib.X.AnyPropertyType)
94-
if prop and prop.value:
95-
socket_path = prop.value.decode()
96-
except DisplayError as e:
97-
logger.info('could not get i3 socket path from root atom', exc_info=e)
98-
99-
if socket_path:
100-
logger.info('got socket path from root atom: %s', socket_path)
101-
return socket_path
102-
10386
for binary in ('i3', 'sway'):
10487
try:
10588
process = run([binary, '--get-socketpath'], stdout=PIPE, stderr=PIPE)
@@ -116,7 +99,7 @@ def _find_socket_path(self):
11699
logger.info('could not get i3 socket path from `%s` binary', binary, exc_info=e)
117100
continue
118101

119-
logger.info('could not find i3 socket path')
102+
logger.info('could not find i3/sway socket path')
120103
return None
121104

122105
def _sync(self):

0 commit comments

Comments
 (0)