-
@Twsuts
这是阻塞系统运行?还是后台运行作为开机动画?我试了分别在/etc/profile、/home/coolpi/.profile文件尾增加qt demo是可以的
sudo apt install qtbase5-examples coolpi@coolpi:~$ cat /etc/profile # /etc/profile: system-wide .profile file for the Bourne shell (sh(1)) # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...). if [ "${PS1-}" ]; then if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then # The file bash.bashrc already sets the default PS1. # PS1='\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi if [ -d /etc/profile.d ]; then for i in /etc/profile.d/*.sh; do if [ -r $i ]; then . $i fi done unset i fi #echo "coolpi" | sudo -S /usr/lib/aarch64-linux-gnu/qt5/examples/gui/analogclock/analogclock coolpi@coolpi:~$ coolpi@coolpi:~$ cat ~/.profile # ~/.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/bin:$PATH" fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/.local/bin" ] ; then PATH="$HOME/.local/bin:$PATH" fi echo "coolpi" | sudo -S /usr/lib/aarch64-linux-gnu/qt5/examples/gui/analogclock/analogclock coolpi@coolpi:~$
因为不是后台运行,重启后会阻塞桌面系统显示窗口。此时可以通过键盘ctrl+alt+f6切换到终端命令行进行恢复修改操作。
也可以后台运行测试
vim ~/.profile ... echo "coolpi" | sudo -S /usr/lib/aarch64-linux-gnu/qt5/examples/gui/analogclock/analogclock &
-
@大法师 感谢您的回答,您的操作看起来很正常,这样看来确实很奇怪,但我这边不论是ubuntu22还是ubuntu20我在.profile文件下启动我的qt程序都没反应,它会直接进入桌面,而在/etc/xdg/autostart/下可以自动启动我的应用程序,但是后者显示屏会出现几秒钟的ubuntu图形界面,这看起来很糟糕!
-
@Twsuts
百度网盘或onedrive有最新镜像,是否镜像不一致? -
@大法师 前天刚刷的最新镜像,甚至于我在使用ssh登陆时都能启动程序,终端登陆就会启动程序,但是显示屏上就是直接进入了桌面。
-
@Twsuts
是不是自动登陆设置打开了? -
@大法师 还真是的
-
@大法师 关了也没用,换了一个最简单的demo也没用,我只能通过我原来的方法启动程序,然后把整个桌面服务关了试试看了,不过这样启动会慢很多
-
@Twsuts 看看登录服务用的是什么gdm还是LightDM,改那个的配置文件。不启动桌面启动你的QT程序
-
@Twsuts SSH能启动 开机不启动,你看看是不是用户不一致
-
@顾真牛 用户都是一样的coolpi,我现在解决了这个问题,在那之前加入export DISPLAY=:0 这样就可以启动了
-
-
大 大法师 moved this topic from Pi 4B on