Skip to content
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

Printdesks command #42

Merged
merged 5 commits into from
May 10, 2024
Merged

Printdesks command #42

merged 5 commits into from
May 10, 2024

Conversation

WhySoBad
Copy link
Collaborator

@WhySoBad WhySoBad commented May 9, 2024

Hi

I've added the hyprctl printdesks command which outputs information about all vdesks currently available

The output below is an example of running hyprctl printdesks -j which can be easily processed by other applications (e.g. sidebar widgets):

[
  {
    "id": 4,
    "name": "4",
    "focused": false,
    "populated": false
  },
  {
    "id": 3,
    "name": "3",
    "focused": false,
    "populated": false
  },
  {
    "id": 2,
    "name": "2",
    "focused": false,
    "populated": true
  },
  {
    "id": 1,
    "name": "1",
    "focused": true,
    "populated": true
  }
]

Now, the plugin stores a list with all open windows for every vdesk which has to be updated when a window opens, closes or gets moved to another workspace (which potentially is part of another vdesk). Therefore, it was necessary to add some event listeners.

The branch is rebased onto dev and therefore the new feature will be available for all users as soon as the next hyprland version is released.

@WhySoBad WhySoBad added the enhancement New feature or request label May 9, 2024
@WhySoBad WhySoBad requested a review from levnikmyskin May 9, 2024 13:04
@WhySoBad WhySoBad self-assigned this May 9, 2024
Copy link
Owner

@levnikmyskin levnikmyskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your efforts and contribution.
Your implementation, unfortunately, adds a lot of overhead, listeners and new code that imo is not necessary.

As mentioned in one of the review comments, all this can be achieved without adding new structures, by simply iterating over the vdesks. Please, correct me if I'm wrong here.

Just to be clear, I'm not against implementing this functionality, it's just that your proposition adds too much complexity :)

src/main.cpp Outdated Show resolved Hide resolved
include/VirtualDesk.hpp Show resolved Hide resolved
@WhySoBad
Copy link
Collaborator Author

WhySoBad commented May 9, 2024

I'd merge this pull request as a squash merge since the pull request contains some commits which were updated the last commit

@WhySoBad WhySoBad requested a review from levnikmyskin May 9, 2024 20:51
README.md Outdated Show resolved Hide resolved
src/main.cpp Outdated Show resolved Hide resolved
@WhySoBad WhySoBad requested a review from levnikmyskin May 10, 2024 10:32
Copy link
Owner

@levnikmyskin levnikmyskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM!

@levnikmyskin levnikmyskin merged commit 6bbcc08 into dev May 10, 2024
@levnikmyskin levnikmyskin deleted the feat/printdesks branch May 10, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants