Skip to content

Conversation

killown
Copy link
Contributor

@killown killown commented Sep 25, 2025

Wayfire's socket file location shifted from /tmp to XDG_RUNTIME_DIR between versions.

@killown killown marked this pull request as draft September 25, 2025 16:42
@killown
Copy link
Contributor Author

killown commented Sep 25, 2025

In [8]: import os

In [9]: os.getenv("WAYFIRE_SOCKET") is None
Out[9]: True

In [10]: from wayfire import WayfireSocket

In [11]: sock = WayfireSocket(allow_manual_search=True)

In [12]: sock.list_outputs()
Out[12]: 
[{'id': 1,
  'name': 'DP-1',
  'geometry': {'x': 2560, 'y': 0, 'width': 1920, 'height': 1080},
  'workarea': {'x': 0, 'y': 42, 'width': 1920, 'height': 1038},
  'wset-index': 1,
  'workspace': {'x': 0, 'y': 0, 'grid_width': 3, 'grid_height': 3}},
 {'id': 3,
  'name': 'DP-2',
  'geometry': {'x': 0, 'y': 0, 'width': 2560, 'height': 1080},
  'workarea': {'x': 0, 'y': 0, 'width': 2560, 'height': 1080},
  'wset-index': 2,
  'workspace': {'x': 0, 'y': 0, 'grid_width': 3, 'grid_height': 3}}]

In [13]: sock = WayfireSocket(allow_manual_search=False)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
Cell In[13], line 1
----> 1 sock = WayfireSocket(allow_manual_search=False)

File /tmp/pywayfire/wayfire/ipc.py:56, in WayfireSocket.__init__(self, socket_name, allow_manual_search)
     53     self.socket_name = socket_name
     55 if self.socket_name is None:
---> 56     raise Exception("Failed to find a suitable Wayfire socket!")

Exception: Failed to find a suitable Wayfire socket!

@killown killown marked this pull request as ready for review September 25, 2025 16:46
@killown killown marked this pull request as draft October 2, 2025 17:15
@killown
Copy link
Contributor Author

killown commented Oct 2, 2025

I've improved the way pywayfire finds sockets, it's now automatic, even if there are ENV issues.
will handle cases like:

export WAYFIRE_SOCKET=""  
export WAYFIRE_SOCKET="/wrong_path/to/socket_file" 

Maybe you dislike it because allow_manual_search=True is now default, but if you try using the wrong ENV, you’ll get how convenient this is

@killown killown marked this pull request as ready for review October 2, 2025 17:57
@ammen99
Copy link
Member

ammen99 commented Oct 2, 2025

I've improved the way pywayfire finds sockets, it's now automatic, even if there are ENV issues. will handle cases like:

export WAYFIRE_SOCKET=""  
export WAYFIRE_SOCKET="/wrong_path/to/socket_file" 

Maybe you dislike it because allow_manual_search=True is now default, but if you try using the wrong ENV, you’ll get how convenient this is

allow manual search should be False by default. The env var is always set if you have your environment properly set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants