参考文章:
1、嵌入式桌面(1)——weston桌面_qt weston-CSDN博客
2、https://blog.51cto.com/u_16213414/9171009
3、weston.ini: configuration file for Weston — the reference Wayland compositor | weston File Formats | Man Pages | ManKier
一、buildroot打开weston选项
配置Weston
在Buildroot中配置Weston非常简单。通过执行 make menuconfig
命令,我们可以进入配置菜单,并选择Weston和相关的依赖包。以下是一些常见的Weston配置选项:
BR2_PACKAGE_WESTON
:启用Weston软件包BR2_PACKAGE_WESTON_DRM
:启用DRM后端支持BR2_PACKAGE_WESTON_FBDEV
:启用Framebuffer后端支持BR2_PACKAGE_WESTON_X11
:启用X11后端支持
通过选择适当的配置选项,可以根据需要启用或禁用Weston的不同功能。
这一步我只打开了第一个。
二、设置自启动以及环境变量
相关文件,自己添加
/etc/init.d/S31weston //weston自启动程序
/etc/xdg/weston/weston.ini //weston配置文件
/etc/profile.d/env.sh //环境变量配置
1、自启动文件
/etc/init.d/S31weston
#!/bin/sh
#
# Start linux launcher...
#case "$1" instart)printf "Starting weston"source /etc/profile.d/env.shweston -c /etc/xdg/weston/weston.ini --tty=2 --idle-time=0 --log=/var/log/weston.log &;;stop)killall westonprintf "stop finished";;*)echo "Usage: $0 {start|stop}"exit 1;;
esac
exit 0
2、/etc/xdg/weston/weston.ini
[shell]
# top(default)|bottom|left|right|none, none to disable panel
# panel-position=none[core]
# Boards could have not any input device, and only use
# removable input device like usb(keyboard, mouse).
require-input=false
3、/etc/profile.d/env.sh
#!/bin/sh export LC_ALL='zh_CN.utf8'
export QT_QPA_PLATFORM=wayland
#export WESTON_DRM_MIRROR=1
export WESTON_DRM_KEEP_RATIO=1
export QT_GSTREAMER_WINDOW_VIDEOSINK=waylandsink
mkdir -p /tmp/.xdg && chmod 0700 /tmp/.xdg
export XDG_RUNTIME_DIR=/tmp/.xdg
export PATH=$PATH:/usr/bin/cmd
export QT_QPA_GENERIC_PLUGINS=evdevkeyboard
4、运行触摸屏的校准程序
参考文章:在 NXP iMX8 上进行 Qt5移植和开发_ARM_iMX8_中国工控网
root@colibri-imx8x:~/touchinteraction# weston-touch-calibrator
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
device "/sys/devices/platform/5a800000.i2c/i2c-16/16-002c/input/input1/event1" - head "DPI-1"
------------------------------
校准触摸屏
------------------------------
root@colibri-imx8x:~# weston-touch-calibrator -v /sys/devices/platform/5a800000.i2c/i2c-16/16-002c/input/input1/event1
------------------------------
依次点击屏幕上的校准坐标,加‘-v' 在校准结束后会输出校准结果,将这个结果保存在配置文件中下次启动就不需要重新校准了。校准后可以点击工具栏的terminal图标启动终端。
填入/etc/udev/rules.d/touchscreen.rules文件中,修改如下:
SUBSYSTEM=="input",KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1",ENV{LIBINPUT_CALIBRATION_MATRIX}="-0.000121 -0.956017 0.980913 1.0108020.014924 -0.028297 "
最后重启即可。
对于电容触摸屏用户,则无需校准,可以直接使用。当然前提是触摸屏的驱动能够正常工作。可以参考这篇文章:linux开发知识点笔记汇总(F1C200S)-CSDN博客
5、设置桌面背景
结果
在/etc/xdg/weston/weston.ini中新增:
[shell]
background-image=/usr/share/weston/background.png
background-type=scale-crop
原文链接:https://blog.csdn.net/u014436243/article/details/128288199
到这一步weston桌面只是显示出来了,工具栏上可以显示时间时间及一个终端图标。