ubuntu下设置qt程序开机自启
1:
vi ~/.xsessionrc
#!/bin/bash
cd /opt/xxx/xxx/xxx/xxx/build/
./myQt.exe&
2:
vim ~/.config/autostart/xxx.desktop
写入
[Desktop Entry] Version=1.0 Name=demo Comment=demo for display Exec=bash -c "cd /opt/xxx/xxx/xxx/xxx/build && ./myQt.exe" #修改 #Icon=/yourpath/Display.png StartupNotify=true Terminal=false Type=Application Categories=Applications;