user-none / KDocker

Dock most applications to the system tray
GNU General Public License v2.0
298 stars 22 forks source link

Hide either original or KDocker icon in system tray? #120

Closed dairefagan closed 2 weeks ago

dairefagan commented 1 year ago

Ubuntu 22.04.1 LTS Gnome 42.5 KDocker 5.3

I autostart Proton VPN with the command kdocker -t -d 15 -n Protonvpn protonvpn as there is no built-in minimise parameter. This results in 2 icons on my top panel:

image

Can you please tell me if it is possible to remove one of them? Preference to either keep the original or make the same click-menu options accessible from the KDocker icon.

Daxx commented 1 year ago

After starting it without kdocker, it might help to see the output from : xwininfo -root -children | grep [Pp]rotonvpn - and - wmctrl -l | grep "[Pp]rotonvpn"

More detail about each window can be found with xwininfo -id 0x??????? # (From either command above)

Of course, the chosen window can be docked using the same id kdocker -w 0x???????

If that gives a better result, I would write a shell script that starts protonvpn, then wrangles the window id, then docks the window. If your output looks good enough, I might be motivated to help with that, if needed.

Rikj000 commented 2 months ago

I tried with pidof to get the process ID,
and then kdocker -x <process id>,
which sadly also leads to a double icon in the tray.

This of course only applies to programs which already have their own tray implementation
(e.g. virt-manager, fdm, yubico-authenticator)

I hoped to use kdocker to automatically minimize these to the tray.

Suggestion

Implement a new command flag to only "close" (minimize to tray) without starting a new kdocker tray entry.

Work around

  1. Right click expand/collapse system tray overflow icon => Configure System Tray...
  2. Click Entries
  3. Search for KDocker
  4. Set Visibility for all to Always hidden
Toggle to expand/collapse screenshot ![kdocker-double-entries-work-around](https://github.com/user-none/KDocker/assets/24852597/f6802869-9ff9-4d3d-a007-9959ad2c7bf0)

The downside of this work around is that in the system tray overflow menu,
the double entries will still show

user-none commented 2 weeks ago

Implement a new command flag to only "close" (minimize to tray) without starting a new kdocker tray entry.

The purpose of KDocker is to dock applications to the system tray. It's a solution to hiding windows. If they already have a tray icon then KDocke either isn't the right solution or you need to disable the application's tray icon if it allows that.