Skip to content

feat: Add Hyprland support and improve Wayland compatibility#1

Open
JaINTP wants to merge 1 commit intodagimg-dot:mainfrom
JaINTP:feature/hyprland-support
Open

feat: Add Hyprland support and improve Wayland compatibility#1
JaINTP wants to merge 1 commit intodagimg-dot:mainfrom
JaINTP:feature/hyprland-support

Conversation

@JaINTP
Copy link
Copy Markdown

@JaINTP JaINTP commented Apr 7, 2026

Description

This PR introduces native support for the Hyprland compositor and addresses several issues related to running floww in pure Wayland environments.

Key Changes:

  • Hyprland Backend: Added a new workspace management backend that uses hyprctl. It is automatically prioritized when a Hyprland session is detected (via the HYPRLAND_INSTANCE_SIGNATURE environment variable).
  • Robust Environment Detection: Modified the ewmhlib import logic to catch all exceptions. Previously, the application could crash on startup in Wayland environments if ewmhlib (via python-xlib) attempted to connect to a non-existent X11 display.
  • Config Isolation Fix: Fixed a bug in ConfigManager where DEFAULT_CONFIG was being mutated globally during merging. This was causing state leakage between unit tests and intermittent failures.
  • Improved Workspace Querying: Implemented _get_total_workspaces_with_hyprctl using hyprctl workspaces -j to accurately determine the workspace count for numeric switching.

Motivation

floww relied primarily on X11-specific tools (ewmhlib/wmctrl). This update makes the tool viable for Hyprland users while making the core logic more resilient to Wayland-only setups.

Testing

  • Added tests/test_workspace_manager.py with 6 new unit tests covering:
    • Initialization under different WM environments.
    • Successful and failed workspace switching via hyprctl.
    • Correct parsing of workspace counts from Hyprland JSON output.
  • Verified that all 55 project tests pass using make test.
  • Verified code style consistency using make lint (ruff).

Checklist

  • Code follows the existing style of the project.
  • Tests have been added to cover changes.
  • All tests pass locally.
  • Linting passes locally.

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.

1 participant