ubuntu18进入桌面后执行自定义的脚本(开机自启动)

mkdir -p ~/.config/autostart

cat >~/.config/autostart/run.desktop <<END
[Desktop Entry]
Type=Application
Name=StartupScript
Exec=你要执行的脚本的完整路径
Path=如果你的脚本需要设置启动目录,在这里设置
Terminal=true
X-GNOME-Autostart-enabled=true
END

chmod +x ~/.config/autostart/run.desktop
gio set ~/.config/autostart/run.desktop metadata::trusted yes

原文地址:https://www.cnblogs.com/jieliujas/p/14786254.html