I'm using kdocker (I'm using GNOME though) for thunderbird and that works great. Now I've found this really nice desktop client for whatsapp and would like to start it at startup. There are 2 problems though: it's a snap app, so it takes ages to load and thus doesn't work well with kdocker (kdocker gives a timeout error and after that whatsdesk opens not minimized in the tray). The second issue is that it already has it's own icon in the system tray so kdocker adds a duplicate in any case.
As a workaround for now I'm running this script on startup:
#!/bin/bash
snap run whatsdesk &
sleep 10
wmctrl -c "Whatsdesk"
I was wondering though if there was a better way to do this, instead of opening the window and then killing the application (it minimizes in the tray even after being killed like this).
Yes, there is a better way to do this, it's still kind of dirty, but at least it works. Just put the code below in a file without extension and select the script to be run at system start /log in. You also have to set Whatsdesk to be started at boot. Then it should just work fine. :)
I was actually insprired by your script, so it's just a kind of extension to your's:
The -F option forces wmctrl to be case sensitive and it has to be the full name of the window title. So... as long as you don't have another window with the exact same name, you are fine. Every 0.25 seconds will be searched for a matching window. To change that, just change the "0.25" to something else (in seconds). Also, after 10 seconds, this script does end itself when no matching window was found. To change that, change the "40" to something else (wanted seconds x (1 / 0.25)) <- replace with your wanted value.
I hope that helps you. (works for me at least ;D) :)
After that, you can view the whatsdesk tray icon on the taskbar