How do I make an app start on startup so it only shows its icon in the tray?

I'd like to make apps like Discord and Telegram autorun so they always start and go to the tray, and don't show the window, is there a way to do that?

See if their preference sections allow for minimize on open. If they do, enable that feature then simply have the apps autostart at login.

If they don't have that feature, you will need to use something like "Devilspie"

However, it should be understood, whether or not the application can be minimized to the system tray on startup, either via it's own preferences or via Devilspie, as opposed to merely minimized to your window tabs on your panel is dependent on whether the application has that capacity as a feature.

Assuming, then, for the purpose of this post, that your application has neither the capacity to minimize by itself on startup nor the capacity to be minimized to the Tray, you would need to use Devilspie in conjunction with a program called "kdocker".

https://www.systutorials.com/docs/linux/man/1-kdocker/

kdocker allows any application, irrespective of whether it has the feature itself, to be minimized to the tray.

You can install kdocker with:

sudo apt-get install kdocker

You start an app minimized to the tray with kdocker with the following command:

kdocker <application name>

eg

kdocker gimp

2 Likes

Yet another approach to run arbitrary application minimized:

1 Like

Re-reading your original post, I realize that if your application does not have the minimize to tray feature, you only need Kdocker since it will achieve, upon opening the application for the first time, everything you want it to. That is to say, it will run the application and minimize it to the tray.

If, on the other hand, your app has the capacity be manually minimized to the tray via its preference settings, but will not automatically do that on first opening, all you will need is Devilispie.

I hope I have explained that clearly, It was harder to put into words than it was to think