安装了一个软件没有GUI的怎么让他开机自启动?
Tofloor
poster avatar
jau1
deepin
2017-07-04 18:32
Author
看深度百科里面的例子没看到,而且里面说的文件夹什么的 我的机器上也没有
Reply Favorite View the author
All Replies
avatar
MeowSprite
deepin
2017-07-04 18:55
#1
1. 可以在~/.profile文件末尾添加一条执行程序的语句。
2. 可以写一个desktop文件,放到~/.config/autostart里。
3. 放到systemd里,弄成一个系统服务。

dde现在还没有管理脚本开机启动的功能吧。
Reply View the author
avatar
jau1
deepin
2017-07-04 19:03
#2
https://bbs.deepin.org/post/142005
1. 可以在~/.profile文件末尾添加一条执行程序的语句。
2. 可以写一个desktop文件,放到~/.config/autostar ...

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/binPATH"
fi
if 1 ;then
        onedrive-d start
fi


这样好像不对。。能帮我修改一下么 我是在1. 可以在~/.profile文件末尾添加一条执行程序的语句。
Reply View the author
avatar
RedPanda
deepin
2017-07-04 19:47
#3
楼主搞第二条吧。网上有教程,几句语句就能用了。
Reply View the author
avatar
jau1
deepin
2017-07-04 20:57
#4
https://bbs.deepin.org/post/142005
楼主搞第二条吧。网上有教程,几句语句就能用了。

弄了半天。。没成功。。
Reply View the author
avatar
MeowSprite
deepin
2017-07-05 02:41
#5
本帖最后由 MeowSprite 于 2017-7-4 18:42 编辑
https://bbs.deepin.org/post/142005
弄了半天。。没成功。。

>>> if 1 ;then
>>>         onedrive-d start
>>> fi

<<< onedrive-d start &

直接把这段改成这样子。没有必要加判断语句啊。
你改完之后,运行下面这命令
  1. source ~/.profile
Copy the Code

看看onedrive-d有没有正确运行起来。
Reply View the author