个人制作的程序可以添加到开机自启动项中,简便一些流程,以下列出两种方式
方式一
第一种方式比较简单,通过Ubuntu 自带的Startup Applications即可添加,只要选中路径下的可执行文件即可。
方式二
通过Shell脚本+rc.local实现
step 01 创建一个脚本文件,比如起名为run_start.sh
#!/bin/sh
cd /home/test/Code/Debug/bin/
./Widget
step 02 修改rc.local文件,在exit 0之前添加执行脚本文件的命令
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will"exit 0" on successor any other
# value on error.
#
# In order to enableor disablethis script just change the execution
# bits.
#
# By default this script does nothing.
./home/test/sh/run_start.sh
exit0
这两种方式,都会在开机时启动相应的程序。
当然,还有很多其他的启动三方程序的方式,目前没有一一尝试,仅举两例。
网友评论