8000 feat!(`HyprlandService`): move to GObject-based objects by linkfrg · Pull Request #171 · linkfrg/ignis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat!(HyprlandService): move to GObject-based objects #171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

linkfrg
Copy link
Owner
@linkfrg linkfrg commented Feb 28, 2025

This PR brings objects inherited from IgnisGObject for Hyprland Service, replacing usual python dictionaries.
This approach allows to bind to properties and other GObject features.

New classes:

  • HyprlandWorkspace
  • HyprlandWindow
  • HyprlandKeyboard

Migration Guide:

  1. Since these objects are not dictionaries anymore, you have to get properties like usual class attributes:
# Old
hyprland.active_workspace["id"]
# New
hyprland.active_workspace.id
  1. HyprlandService.kb_layout is removed, use HyprlandService.main_keyboard.active_keymap instead.
  2. HyprlandService.switch_kb_layout() is removed, use HyprlandService.main_keyboard.switch_layout() instead (to restore the old functionality pass "next" as an argument to it).
  3. HyprlandService.workspaces will not be notified on the active workspace change anymore.
    If you want to restore the old functionality, use bind_many():
# Old
hyprland.bind(
    "workspaces",
     transform=lambda value: [WorkspaceButton(i) for i in value],
)
# New
hyprland.bind_many(
    ["workspaces", "active_workspace"],
    transform=lambda workspaces, *_: [
        WorkspaceButton(i) for i in workspaces
    ],
)

Closes: #95

@linkfrg linkfrg changed the title feat(HyprlandService): move to GObject-based objects feat!(HyprlandService): move to GObject-based objects Feb 28, 2025
@linkfrg linkfrg merged commit 314e727 into main Feb 28, 2025
3 checks passed
@linkfrg linkfrg deleted the feat/hyprland-gobject branch February 28, 2025 18:41
linkfrg added a commit to linkfrg/dotfiles that referenced this pull request Feb 28, 2025
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.

Hyprland Service: move to GObject-based objects
1 participant
0