I just want Telegram to be run and I have added it to startup apps. The point is that I need it to be minimized. Any commands?
|
Starting an application minimizedStarting up an application in a minimized way takes two commands:
Therefore, the command or script needs to be "smart"; the second command should wait for the application window to actually appear. General solution to startup an application minimizedThe script below does that and can be used as a general solution to startup an application in a minimized way. Just run it in the syntax:
The script
How to useThe script needs both
Then:
Explanation
NoteNo need to mention that you can use the script for multiple applications at once, since you run it with arguments outside the script. EDITrecognizing the window by its pidIf the window title is unsure or variable, or there is a risk of name clashes in the window's name, using the The script below is based on the use of the application's pid, as in the output of both The setup is pretty much the same, but the window title is not needed in this version, so the command to run it is:
Just like the first script, it needs both The script
Note on the second scriptAlthough in general the second version should be more reliable, in cases when the application is started by a wrapper script, the pid of the command will be different from the application that is finally called. In such cases, I recommend using the first script. EDIT2 a specific version of the script for SteamAs requested in a comment, below a version, specifically made for starting up STEAM minimized. Why a specific version for Steam?It turns out
This exceptional behaviour of Like the original script, this one needs The script
To use it
|
|||||||||||||||||||||
|
|
It's good to have the scripts given by user72216 and Sergey as general solutions to the problem, but sometimes the application you wish to startup minimized already has a switch that will do what you want. Here are a few examples with the corresponding startup program command strings:
In Unity these applications start minimized as icons in the top menu bar rather than as icons on the launcher, though the normal launch icon will still appear once you start using the application. Other applications may behave differently. |
||||
|
|
|
If program is being closed to tray, one might actually want to close program window on startup instead of minimizing it. One example of such program is Viber. In this case one could use following script
Usage: |
|||||
|
|
I took Jacob's scripts and modified them a bit to make a more universal one.
Main differences are:
WAIT_TIME should be set big enough to allow program to fork its child processes. On my computer it is enough for big programs like steam. Increase it, if needed. Addition
|
|||||||||
|