Skip to content

Commit b030321

Browse files
committed
More progress on importing when X isn't running.
1 parent e57be16 commit b030321

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

xpybutil/keybind.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ def __regrab(changes):
486486
__keybinds[new] = __keybinds[old]
487487
del __keybinds[old]
488488

489-
update_keyboard_mapping(None)
490-
event.connect('MappingNotify', None, update_keyboard_mapping)
489+
if conn is not None:
490+
update_keyboard_mapping(None)
491+
event.connect('MappingNotify', None, update_keyboard_mapping)
491492

xpybutil/util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def build_atom_cache(atoms):
159159
"""
160160
global __atom_cache, __atom_nm_cache
161161

162+
if conn is None:
163+
return
164+
162165
for atom in atoms:
163166
__atom_cache[atom] = __get_atom_cookie(atom, only_if_exists=False)
164167
for atom in __atom_cache:

xpybutil/xinerama.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
from xpybutil import conn
1414

15-
ext = conn(xcb.xinerama.key)
15+
ext = None
16+
if conn is not None:
17+
ext = conn(xcb.xinerama.key)
1618

1719
def get_monitors():
1820
'''

0 commit comments

Comments
 (0)