如何在系统启动时使用 .desktop 文件启动应用程序

sph*_*nix 6 startup

我搜索并发现我可以通过使用Startup Applications仪表板在系统启动时启动应用程序。但是如果我想写一个.desktop文件,我应该将文件保存在哪个目录中,文件的内容应该是什么.desktop

我从这里找到了这个代码片段

[Desktop Entry]
Type=Application
Name=<Name of application as displayed>
Exec=<command to execute>
Icon=<full path to icon>
Comment=<optinal comments>
X-GNOME-Autostart-enabled=true
Run Code Online (Sandbox Code Playgroud)

如果这是有效的并且有效,那么我应该在 中写什么Exec?我的应用程序的名称是Albert,它在文件系统中进行搜索,就像您可以在dash. 那么写Albert在 中Exec有效吗?

sph*_*nix 9

我所做的是,我创建了一个名为的文件albert.desktop,然后/home/<user_name>/.config/autostart我使用了下面的代码片段:

[Desktop Entry]
Type=Application
Name=Albert
Exec=/usr/bin/albert
Icon=/home/<user_name>/Pictures/albert
Comment=Albert is an application that searches the file system like dash on ubuntu
X-GNOME-Autostart-enabled=true
Run Code Online (Sandbox Code Playgroud)

一切都很好!