且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在启动时运行 Qt 应用程序

更新时间:2023-01-30 08:22:17

您需要为您的应用程序创建一个桌面入口文件(请参阅 here) 并将其放在用户的 $HOME/.config/autostart 目录中.

You need to create a desktop entry file for your application (see here) and to put it in user's $HOME/.config/autostart directory.

当窗口管理器启动时,该目录中的任何桌面入口文件都将被执行(参见 此处).

Any desktop entry file in that dir will get executed when a Window Manager starts up (see here).

为此,通常您需要手动创建桌面入口文件(就是这样,而不是通过 C++ 代码/脚本)并通过 C++ 代码安装在该目录中.

To do this, usually you'll need to create your desktop entry file by hand (that's it, not via C++ code/script) and to just install in that directory via C++ code.