-
Notifications
You must be signed in to change notification settings - Fork 0
Home
killown edited this page Feb 13, 2024
·
8 revisions
Welcome to the waypy wiki!
The following methods are part of the WayfireSocket
class and serve various purposes in interacting with the Wayfire system.
- Description: Returns the title of the currently focused view.
- Return Type: str
- Description: Retrieves a list of all views currently available.
- Return Type: list
- Description: Returns the output of the currently focused view.
- Return Type: int
- Description: Determines whether the specified view is in fullscreen mode.
- Parameters: view_id (int) - ID of the view
- Return Type: bool
- Description: Checks if the specified view is focusable.
- Parameters: view_id (int) - ID of the view
- Return Type: bool
- Description: Retrieves the geometry (position and size) of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: dict
- Description: Checks if the specified view is minimized.
- Parameters: view_id (int) - ID of the view
- Return Type: bool
- Description: Retrieves the tiled edges of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: int
- Description: Retrieves the title of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: str
- Description: Retrieves the type of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: str
- Description: Retrieves the application ID of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: str
- Description: Retrieves the role of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: str
- Description: Retrieves the bounding box of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: dict
- Description: Retrieves the layer of the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: str
- Description: Retrieves a list of all process IDs (PIDs) associated with views.
- Return Type: list
- Description: Retrieves information about the currently focused view.
- Return Type: dict
- Description: Retrieves detailed information about the currently focused view.
- Return Type: dict
- Description: Retrieves the process ID (PID) of the currently focused view.
- Return Type: int
- Description: Determines whether the currently focused view is in fullscreen mode.
- Return Type: bool
- Description: Retrieves the role of the currently focused view.
- Return Type: str
- Description: Retrieves the bounding box of the currently focused view.
- Return Type: dict
- Description: Retrieves the layer of the currently focused view.
- Return Type: str
- Description: Retrieves the ID of the currently focused view.
- Return Type: int
- Description: Retrieves information about the currently active workspace.
- Return Type: dict
- Description: Retrieves the name of the currently focused output.
- Return Type: str
- Description: Retrieves the ID of the currently focused output.
- Return Type: int
- Description: Retrieves the type of the currently focused view.
- Return Type: str
- Description: Retrieves the application ID of the currently focused view.
- Return Type: int
- Description: Retrieves the geometry (position and size) of the currently focused output.
- Return Type: dict
- Description: Retrieves the work area (usable area) of the currently focused output.
- Return Type: dict
- Description: Retrieves a list of all input devices.
- Return Type: list
- Description: Retrieves the process ID (PID) associated with the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: int
- Description: Retrieves detailed information about the specified view.
- Parameters: view_id (int) - ID of the view
- Return Type: dict
- Description: Calculates the total number of workspaces and their coordinates.
- Return Type: dict
- Description: Sets the workspace for a specified view.
-
Parameters:
- workspace_number (int) - Workspace number
- view_id (int) - ID of the view
- Return Type: bool
- Description: Leaves the scale mode.
- Return Type: bool
- Description: Toggles the scale mode.
- Return Type: bool
- Description: Retrieves the number of the currently active workspace.
- Return Type: int
- Description: Switches to the next workspace.
- Return Type: bool
- Description: Switches to the previous workspace.
- Return Type: bool
git clone https://github.com/killown/waypy
cd waypy
python3 -m pip install .
import waypy
import os
addr = os.getenv("WAYFIRE_SOCKET")
sock = waypy.WayfireSocket(addr)
sock.get_focused_view()
sock.get_focused_view_pid()
sock.get_active_workspace_number()
sock.get_focused_output()
workspace_number = 2
sock.set_workspace(workspace_number)
sock.go_next_workspace()
sock.go_previous_workspace()
view_id = sock.get_focused_view()["id"]
workspace_number = 2
sock.set_workspace(workspace_number, view_id)
sock.list_views()
monitor_output_id = 1
sock.query_output(monitor_output_id)
sock.get_active_workspace_info()
sock.get_focused_output_name()
sock.get_focused_output_id()
sock.get_focused_output_geometry()
sock.get_focused_output_workarea()
view_id = 1
sock.set_focus(view_id)
sock.list_input_devices()
sock.watch()
while True:
msg = sock.read_message()
if "event" in msg:
event = msg["event"]
window_created = "view-mapped"
window_closed = "view-unmapped"
if event == window_created:
print("window created")
if event == window_closed:
print("window closed")