dhruv8sh / plasma6-desktop-indicator

Plasma 6 applet in order to show virtual desktops in a minimal way
GNU General Public License v3.0
23 stars 1 forks source link

Hide workspace number when no window active #1

Open divinae opened 4 months ago

divinae commented 4 months ago

Hi, I would like to be able to show only workspaces with opened windows as numbers. Something like this: Screenshot_20240227_133623

dhruv8sh commented 4 months ago

What are your reasons to ask for this feature?

divinae commented 4 months ago

I mean something different. I would like to hide empty workspaces. So for example, I have 4 workspaces with opened apps on the first and the last. So the widget sould show hide second and third and "1 4"

dhruv8sh commented 4 months ago

Okay, but I think that creates ambiguity. Like what happens when you scroll, does it switch to the next desktop or to the next desktop with an active window? Or does it preserve the space for the inactive desktops or does it slide out with an animation?

Can you also share the source of the screenshot so I can look into the project you are referring to?

divinae commented 4 months ago

I'm referring to waybar workspaces module https://github.com/Alexays/Waybar/wiki/Module:-Workspaces the "active-only" flag set. like here: https://youtu.be/Sibpj_o3cOI?feature=shared&t=916

dhruv8sh commented 4 months ago

Okay, it does sound like a good idea. I will publish a release for numbered indicators today(seems like not a lot of work). Expect the full thing tomorrow.

dhruv8sh commented 4 months ago

Please test and review the last update. Screenshot_20240301_202037

divinae commented 4 months ago

Screenshot_20240304_084306 Looks nice!

dhruv8sh commented 4 months ago

About the "Show indicators only on window active feature", I have run into a problem. The rest of the work is done, but I am unable to find a way to get the count of open windows on a desktop, while not staying on that desktop.

TaskManager.ActivityInfo {
        id: activityInfo
    }
    TaskManager.TasksModel {
        id: taskmanager
        groupMode: TaskManager.TasksModel.GroupDisabled
        activity: activityInfo.currentActivity
        virtualDesktop: pos
        filterByVirtualDesktop: true
        filterByActivity: true
    }

Here, pos is the index of the indicator. This returns 0 for taskamanager.count for all pos.

I'll open this issue on KDE Discuss, but if anyone wants to chip-in some help, they're welcome.