Linux Autostart application with delay and also minimize the application after start. #kalilinux #linux

Some application start in full screen and I do not want that. I want them minimized when I login.

In this case I am running Kali 2020.1.

You need to install a program.

sudo apt-get install wmctrl

The I did create a app directory in home,

In this directory I created app.sh file with the applications that did not support start minimized or did not work.

ls
lifera.sh pidgin.sh recoll.sh skype.sh teams.sh

The content of the file is different of course, but you will understand the build of the file.
In this example we look at teams.sh

#!/bin/bash
sleep 4
/usr/bin/teams & #Path to application
sleep 7 #In some case it works with 2 sometimes you need to modify this to 10 or something else
wmctrl -c teams

After this you can create the Autostart the application via GUI tools or just add a desktopfile in ~/.config/autostart/teams.desktop

#cat teams.desktop 

[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=teams
Comment=
Exec=/home/roger/app/teams.sh
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=false

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.