使用cx_Freeze将我的Python脚本冻结为可执行文件后,可执行文件名为BingNiceWallpapers。 我希望它在登录时自动运行,所以编写一个名为BingNiceWallpapers.desktop的脚本将它放入〜/ .config / autorun
[Desktop Entry]
Type=Application
Exec=/home/i/图片/build/exe.linux-i686-3.4/BingNiceWallpapers
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[zh_CN]=BingNiceWallpapers
Name=BingNiceWallpapers
Comment[zh_CN]=
Comment=
X-GNOME-Autostart-Delay=0
问题是当启动或重启计算机时,程序在登录时会自动运行,但是当注销然后使用同一帐户登录时,程序不会自动运行,那么如何解决这个问题?
我测试了linuxmint-17.1-cinnamon-32bit
答案 0 :(得分:0)
我试图在 linuxmint-17.1-cinnamon-32bit 上做同样的事情。我制作了可执行文件并将其放入~/bin
文件夹中。然后我通过GUI将我的应用程序添加到启动中(我在对话框中仅指定了名称和命令)。并检查应用程序是否在注销后运行,然后登录:它运行。
所以配置文件myapp.desktop
如下所示:
[Desktop Entry]
Type=Application
Exec=/home/me/bin/myapp
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=MyApp
Name=MyApp
Comment[en_US]=
Comment=
X-GNOME-Autostart-Delay=0
它位于~/.config/autostart
文件夹中(但不在autorun
)。