1.首先编写一个shell脚本文件,例如python_self_start.sh (nohup & 指定后台运行)
#!/bin/bash
nohup python3 /home/sensetime/Downloads/indicator-stickynotes-0.5.9/indicator-stickynotes.py &
注意:脚本需要实现开放执行权限 sudo chmod 777 xxx.sh
2.编写python文件,里面执行你开启执行的脚本,这里是indicator-stickynotes.py
3.在 /etc/profile 这个文件中,添加shell脚本文件路径,例如:
/home/Desktop/selfstarting/self_start.sh
4.重启 可自动后台运行该脚本
我这里演示的是一个便签脚本