注销然后登录时,自动运行脚本不起作用

时间:2015-03-09 05:27:56

标签: ubuntu gnome cx-freeze linuxmint cinnamon

使用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

1 个答案:

答案 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)。

相关问题