levnikmyskin / hyprland-virtual-desktops

A plugin for the Hyprland compositor, implementing virtual-desktop functionality.
BSD 3-Clause "New" or "Revised" License
102 stars 9 forks source link

Printdesks command #42

Closed WhySoBad closed 4 months ago

WhySoBad commented 4 months ago

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 commented 4 months ago

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