Hyprland#
- class ignis.services.hyprland.HyprlandService(*args: Any, **kwargs: Any)#
Hyprland IPC client.
Example usage:
from ignis.services.hyprland import HyprlandService hyprland = HyprlandService.get_default() # Get IDs of all workspaces print([i.id for i in hyprland.workspaces]) # Get the ID of the active workspace print(hyprland.active_workspace.id) # Get the currently active keyboard layout print(hyprland.main_keyboard.active_keymap) # Get the title of the active window print(hyprland.active_window.title)
- signal workspace_added#
Emitted when a new workspace has been added.
- Parameters:
workspace (
HyprlandWorkspace
) -- The instance of the workspace.
- signal window_added#
Emitted when a new window has been added.
- Parameters:
window (
HyprlandWindow
) -- The instance of the window.
- signal monitor_added#
Emitted when a new monitor has been added.
- Parameters:
monitor (
HyprlandMonitor
) -- The instance of the monitor.
- gproperty workspaces: list[HyprlandWorkspace]#
read-only
A list of workspaces.
- gproperty active_workspace: HyprlandWorkspace#
read-only
The currently active workspace.
- gproperty main_keyboard: HyprlandKeyboard#
read-only
The main keyboard.
- gproperty windows: list[HyprlandWindow]#
read-only
A list of windows.
- gproperty active_window: HyprlandWindow#
read-only
The currenly focused window.
- gproperty monitors: list[HyprlandMonitor]#
read-only
A list of monitors.
- send_command(cmd: str) str #
Send a command to the Hyprland IPC. Supports the same commands as
hyprctl
. If you want to receive the response in JSON format, use this syntax:j/COMMAND
.- Parameters:
cmd (
str
) -- The command to send.- Return type:
- Returns:
Response from Hyprland IPC.
- Raises:
HyprlandIPCNotFoundError -- If Hyprland IPC is not found.
- get_workspace_by_id(workspace_id: int) HyprlandWorkspace | None #
Get a workspace by its ID.
- Parameters:
workspace_id (
int
) -- The ID of the workspace.- Return type:
- Returns:
The workspace instance, or
None
if the workspace with the given ID doesn't exist.
- get_window_by_address(address: str) HyprlandWindow | None #
Get a window by its address.
- Parameters:
address (
str
) -- The address of the window.- Return type:
- Returns:
The window instance, or
None
if the window with the given address doesn't exist.
- get_monitor_name(name: str) HyprlandMonitor | None #
Get a monitor by its name.
- Parameters:
name (
str
) -- The name of the monitor.- Return type:
- Returns:
The monitor instance, or
None
if the monitor with the given name doesn't exist.
- get_windows_on_workspace(workspace_id: int) list[HyprlandWindow] #
Get a list of windows on a workspace by its ID.
- Parameters:
workspace_id (
int
) -- The ID of the workspace.- Return type:
- Returns:
A list of windows on the workspace.
- class ignis.services.hyprland.HyprlandWorkspace(*args: Any, **kwargs: Any)#
A workspace.
- signal destroyed#
Emitted when the workspace has been destroyed.
- class ignis.services.hyprland.HyprlandWindow(*args: Any, **kwargs: Any)#
A window.
- signal closed#
Emitted when the window has been closed.
read-only
Whether the window is hidden.
- class ignis.services.hyprland.HyprlandKeyboard(*args: Any, **kwargs: Any)#
A keyboard.