天天看點

嵌入式桌面(1)——weston桌面RK3399平台weston桌面weston配置檔案解析相關内容

weston參考文檔:
https://www.mankier.com/5/weston.ini
https://www.mankier.com/7/weston-drm
http://manpages.org/westonini/5

weston的使用
https://blog.csdn.net/u012080932/article/details/114373675
weston設定
https://blog.csdn.net/weixin_42892101/article/details/107696652
           

RK3399平台weston桌面

平台:RK3399

系統:Linux4.4+buildroot

相關檔案

/etc/init.d/S31weston 			//weston自啟動程式
/etc/xdg/weston/weston.ini		//weston配置檔案
/etc/profile.d/env.sh			//環境變量配置
           
/etc/init.d/S31weston 
           
#!/bin/sh
#
# Start linux launcher...
#

case "$1" in
  start)
                printf "Starting weston"
                source /etc/profile.d/env.sh
                weston -c /etc/xdg/weston/weston.ini --tty=2 --idle-time=0 --log=/var/log/weston.log &
        ;;
  stop)
                killall weston
                printf "stop finished"
        ;;
  *)
        echo "Usage: $0 {start|stop}"
        exit 1
        ;;
esac
exit 0
           
/etc/xdg/weston/weston.ini
           
[core]
# Boards could have not any input device, and only use
# removable input device like usb(keyboard, mouse).
#require-input=false

[shell]
panel-position=none
           
/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
           

weston配置檔案解析

weston是可以從指令行和配置檔案(weston.ini)這兩部分擷取配置資訊的。

weston.ini檔案的位置:

$XDG_CONFIG_HOME/weston.ini   (if $XDG_CONFIG_HOME is set)
$HOME/.config/weston.ini      (if $HOME is set)
weston/weston.ini in each
    $XDG_CONFIG_DIR           (if $XDG_CONFIG_DIRS is set)
/etc/xdg/weston/weston.ini    (if $XDG_CONFIG_DIRS is not set)
           

其中環境變量 H O M E 是 用 戶 的 主 目 錄 , HOME是使用者的主目錄, HOME是使用者的主目錄,XDG_CONFIG_HOME是使用者特定的配置目錄,$XDG_CONFIG_DIRS是冒号“:”分隔的配置基目錄清單,例如/etc/xdg-foo:/etc/xdg .

weston.ini檔案的組成部分

weston.ini檔案由多個部分(section)組成,可存在于任何順序的,或者省略(使用預設配置)

section如下:

core           The core modules and options
libinput       Input device configuration
shell          Desktop customization
launcher       Add launcher to the panel
output         Output configuration
input-method   Onscreen keyboard input
keyboard       Keyboard layouts
terminal       Terminal application options
xwayland       XWayland options
screen-share   Screen sharing options
           

旋轉weston渲染的qt程式

配置output字段,添加顯示裝置的名稱和旋轉角度。

前面weston通過如下指令啟動:

weston -c /etc/xdg/weston/weston.ini --tty=2 --idle-time=0 --log=/var/log/weston.log &
           

是以weston的啟動log儲存在/var/log/weston.log檔案中,通過cat /var/log/weston.log | grep Output檢視顯示裝置的名稱:

[[email protected]:/]# cat  /var/log/weston.log | grep Output
[06:35:51.270] Output repaint window is 15 ms maximum.
[06:35:51.510] Output DSI-1, (connector 91, crtc 83)
           

在weston.ini中添加如下配置即可旋轉weston上跑的qt程式:

[output]
name=DSI-1
transform=90
           

經測試,觸摸也跟着顯示一起旋轉了,猜測應該是weston的預設配置起了作用。

滑鼠光标的顯示和隐藏

TBC

相關内容

5718

[email protected]:~# ls /sys/class/drm/
card0/          card0-DPI-1/    card0-HDMI-A-1/ card1/          controlD64/     renderD128/     renderD129/     version
           

3399

[[email protected]:/]# ls /sys/class/drm/
card0-DSI-1/     card0/           renderD128/
card0-HDMI-A-1/  controlD64/      version
           
[output]      
name=HDMI-A-1 
virtualIndex=0
              
[output]      
name=DSI-1    
virtualIndex=1
           

繼續閱讀