gnome桌面开机启动程序

如果CentOS 7使用的桌面是gnome,可以在终端执行命令
gnome-session-properties
打开Startup Application Preferences(开机启动应用)配置界面。

按照界面提示,点击Add,
填写Name(要配置的程序名称),command(可执行文件路径)等信息添加一条配置,即可。
例如,要实现开机启动FileZilla,使用yum安装的FileZilla可执行文件路径为/usr/bin/filezilla,
则Add时,Name可以写filezilla,command写/usr/bin/filezilla。

如果操作使用的用户为admin,以上操作其实是在用户主目录下增加了一个配置文件

/home/admin/.config/autostart/filezilla.desktop

文件内容为

[Desktop Entry]
Type=Application
Exec=/usr/bin/filezilla
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=filezilla
Name=filezilla
Comment[en_US]=
Comment=

因此,如要实现开机启动程序,只需要在用户主目录按照上述格式,新建配置文件。
如eclipse(安装目录/home/admin/eclipse/)
则配置文件为

/home/admin/.config/autostart/eclipse.desktop

文件内容

[Desktop Entry]
Type=Application
Exec=/home/admin/eclipse/eclipse
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_US]=eclipse
Name=eclipse
Comment[en_US]=
Comment=

posted @ 2020-04-15 10:27  xstack  阅读(4474)  评论(0编辑  收藏  举报