[Linux] Linux automatically run the specified program How to login screen

Linux automatically run the specified program How to login screen

After many attempts, most of them are trying to change the configuration file, add the name of the configuration file to run the program

Until I tried the autostart folder in the desktop file, that time-tested.

First we look at the information inside a simple desktop file named example.desktop

[Desktop Entry]
Type=Application
Exec=example
Hidden=false
X-MATE-Autostart-enabled=true
Name[zh_CN]=example
Name=example
Comment[zh_CN]=
Comment=

[Desktop the Entry]
Type = type the Application # application
Exec = example # executable file (usually an executable file needs to put the / usr / sbin directory) or with the path of the executable file
Hidden = false # false is hidden
X-MATE-Autostart-enabled = true #XMATE Desktop automatically starts to open the
name [zh_CN] = example # Chinese name
name = example # English name
Comment [zh_CN] = # Chinese description (you can not fill a specific value)
the Comment = # English description (you can not fill a specific value)

 After reading the contents of the documents, how do we use it?

Suppose your application name to test, then its file name should be test.desktop, the configuration file which should be completed later in the Exec = executable test file, and you want the executable files are copied to / usr / sbin /, because this directory has super administrator privileges, or you will be the path to the executable file write, use pwd command to see what the current path, xxx / xxx / what's test. Name [zh_CN] = write after the test, Name = write back the test

Somehow profile, we will put it where it should go in.

This place is   ~ / .config / autostart / directory, this means that ~ .config / autostart directory in which case the user login, such as my user name is abc, I put in the user inside, config / autostart inside after the desktop file, then I am to log into the user interface of the abc desktop runs inside executables under this directory, if I am logged in as root, and I put the file in the user desktop inside, config / autostart inside , desktop will run into the next interface the directory executable.

Of course, some Linux operating system might not be in this directory, it may be in the / etc / the XDG / autostart   , such as ubuntu is in this directory

Published 201 original articles · won praise 46 · views 90000 +

Guess you like

Origin blog.csdn.net/rong11417/article/details/105082304