Minimise any window to system tray

Minimise any window to system tray.
Right click on a minimise button, and window gets minimised to system tray, and while it is in system tray, it does few things:

  1. It disappears from the main taskbar.
  2. It doesn’t appear in alt+tab list.
  3. When tray icon is clicked, it pops back to main taskbar as a normal window.
  4. If window supports progress status for taskbar, system tray icon should also have it.

Usecase:
Sometimes, an app runs a long task that user doesn’t need to check for another hour or two, like downloading big file in a browser, or rendering something in 3D editor, or a video editor, you name it. It not only will help to clean up taskbar visually, but will also help to avoid accidental task interruption (accidental window closing, or accidental focusing and clicking on something inside a windows). And if app’s tray icon shows progress status, it helps to track the progress and to not forget about it (unlike virtual desktops, where windows are easily forgotten, unless user is used to such workflow).

2 Likes

I like that idea.

That is me right there, like when shutting down.

Vektor

would activities help with this usecase?

you can turn off the automatic sleeping feature so the activity will just keep running in the background while you do other things in a foreground activity.

So, if you’re downloading , for example, a big file in a browser…you stop using the browser and wait for the one running in the system tray to finish? Or do you have a browser minimized to systray only when downloading files? And say, that would work, how would it handle grouped tasks, sound notifications etc…? Seems like a mess to me overall.

I suppose OP would say that even in activities the running processes can be forgotten. But I don’t agree on the risk of forgetting processes in virtual desktops: if you set the taskbar rightly, it can show applications across all virtual desktops, so that you can see what’s running even if you don’t switch virtual desktop.
Properly setting the taskbar would go against “cleaning up taskbar visually”, but moving things to the system tray would either:

  1. Hide processes again if they are not showed in the panel, just like it is said with virtual desktops or could be said with activities;
  2. Clutter the system tray, which now would be the one in need of being cleaned up.

I understand that cluttering the system tray section of the panel would take less space than cluttering the taskbar, but would it be worth it? Let’s suppose we minimize a window in the system tray: it isn’t true that we can track the progress, as an icon in the system tray is just an icon and I can easily forget about it just like I ignore the battery icon; an element in the taskbar, instead, natively shows the progress of running tasks using the background of the element as a progress bar.

2 Likes

not that knowledgeable about activities, but if you have two currently running, does that count as a login for your user even if you have logged out of your primary one and gone to the SSDM screen?

i also agree that the OP’s proposed solution for not forgetting about a process is just as doomed as any other method, if you are not paying attention to what is running.

seems the more places you have to hide things the more likely you are to forget them.

I don’t use activities, but I suppose they are conceptually contained in the session of the specific user, so logging out would just be logging out of everything.

If what OP is looking for is a way to remove programs from the taskbar and the task switcher while retaining the ability to keep track of the process, this would just mean creating another taskbar while hiding programs from the task switcher. This could be obtained with window rules or a small script which creates a contextual menu element to add a class to the window to apply the same rule.

1 Like

Okay, another opinion in favour of this, is many apps already follow this workflow (ability to minimise them to system tray):

  • torrent clients and download managers;
  • music players;
  • game launchers;
  • messengers and mail clients;
  • various utilities, like qpwgraph;
  • and more…

As you can see, a good portion of apps already can be minimised to tray, although this functionality is implemented by a developer.
And some of these apps have pretty wide set off features, that justify them both as normal apps and background tasks, for example steam.
It can be used both as browser (for navigating steam websites, like guides, forums, and store), and a backgound app (either downloading a game, or idle as a messenger, as it hass quick message features).
My proposal is to achieve versatile approach.
Sure, many of these apps were designed before activities and virtual desktops became a thing, yet this approach is still pretty convenient.

Out of 6 apps running on my pc, 4 are minimised to system tray: discord, steam, qbittorrent, and heroic launcher.

Saying all of it, in my opinion it looks more like generic windows management task, instead of something that should be reinvented repeatedly on individual app basis.

Hmm, I’ll try making this with a widget, if libtaskmanager doesn’t support Skip taskbar/pager/switcher a companion KWin script will do, I’ve done something similar for other widgets cursor-eyes and spacer-extended

I’ve tried this with window rules but it needs some extra. You can set a window rule for not having the specific app shown in the tasks. But, that doesn’t mean it’ll be in the systray. Furthermore, if you don’t use titlebars there’s no way of closing that window ( unless in overview or something). Me personally, I use the active window control widget. That specific app will not be detected by it when it’s active. The global menu, if you use it, won’t show either for the active ( but hidden in tasks) window. So, sure, you can hide the app from tasks but you need to be sure that, if you want it in the systray, that systray icon has a function to close etc… Apps that do support systray only do have some kind of dropdown for some actions…like close.

Yeah… I am trying to implement this as a separate widget, like KDocker but for Plasma wayland, and as it is now libtaskmanager doesn’t expose showing skip taskbar apps so I had to add that.

Now I need to find a way to toggle skip taskbar/pager/switcher and show/minimize by interacting with the icons

Example with dolphin:

1 Like

Won’t be easy. One of the first things that,well, struck me, was the fact that
an application that skips the tasks, pager etc doesn’t show a global menu when active. In my case, with the active window widget, it also wasn’t detected. Hence the need for overview to close with mouse. But I’m fairly sure you’ll figure it out. Personally, I’m in no need for such a widget, the only one I really use in systray is Goodvibes. But I guess for folks who dig this it could be nice. And um…it won’t stop there. Then there will be “show progress” “show currently running audio” and what not. Oh well, you’re good at this stuff.

an application that skips the tasks, pager etc doesn’t show a global menu when active

Hmm, that can be avoided by removing skip properties when the window is brought back to view (un-minimize) basically how I am implementing this:

  1. Expose a shortcut to minimize and set skip tasks/pager/switcher (with KWin script)
  2. When a window is “hidden” by the shortcut, will appear in the widget
  3. Clicking in the task icon brings the window back (un-minimizes) and unsets skip tasks/pager/switcher

demo

And um…it won’t stop there. Then there will be “show progress” “show currently running audio” and what not.

Yeah, those will be added later.

2 Likes

Yes, that would do the trick (3). You’re on a high roll there. Slept yet?