Add
This commit is contained in:
161
README.md
Normal file
161
README.md
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
# Duel head
|
||||||
|
|
||||||
|
## Display
|
||||||
|
- [Hardkernel 3.2" tft lcd](https://www.hardkernel.com/shop/c1-3-2inch-tfttouchscreen-shield/)
|
||||||
|
- Generic HDMI monitor
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Package
|
||||||
|
```bash
|
||||||
|
sudo apt install gnome-icon-theme weston=9.0.0-4ubuntu1
|
||||||
|
```
|
||||||
|
|
||||||
|
The package `gnome-ichone-theme` is used for weston shortcut icon.
|
||||||
|
|
||||||
|
### UDev `/etc/udev/rules.d/99-weston.rules`
|
||||||
|
```text
|
||||||
|
odroid@gnome-desktop:~$ cat /etc/udev/rules.d/99-weston.rules
|
||||||
|
ACTION=="add|change", SUBSYSTEM=="drm", DEVPATH=="/devices/platform/soc/fe000000.apb4/fe050000.spi/spi_master/spi0/spi0.0/drm/card1", ENV{ID_SEAT}="seat-weston"
|
||||||
|
#SUBSYSTEM=="graphics", ENV{ID_FOR_SEAT}=="graphics-platform-fe050000_spi-cs-0", ENV{ID_SEAT}="seat-weston"
|
||||||
|
ACTION=="add|change", SUBSYSTEM=="input", ENV{ID_FOR_SEAT}=="input-platform-fe050000_spi-cs-1", ENV{ID_SEAT}="seat-weston"
|
||||||
|
ACTION=="add|change", SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", OWNER="odroid", ENV{LIBINPUT_CALIBRATION_MATRIX}="1.366975 0.036143 -0.072346 -0.092563 -2.159515 1.082110"
|
||||||
|
```
|
||||||
|
The key is to set `ID_SEAT` on the device to be separated. In the example above, it was set to `seat-weston`.
|
||||||
|
|
||||||
|
Simply set `ID_SEAT` on at least one graphics output device and the input device you want to isolate. also, set the touch calibration values.
|
||||||
|
|
||||||
|
If `ID_SEAT` set, GDM and ubuntu desktop not use these devices. (They use `seat0` - default)
|
||||||
|
|
||||||
|
|
||||||
|
### weston.ini `/etc/xdg/weston/weston.ini`
|
||||||
|
```text
|
||||||
|
odroid@gnome-desktop:~$ cat /etc/xdg/weston/weston.ini
|
||||||
|
[core]
|
||||||
|
require-input=false
|
||||||
|
locking=false
|
||||||
|
idle-time=0
|
||||||
|
#gbm-format=abgr8888
|
||||||
|
#repaint-window=16
|
||||||
|
background-color=0x00ffffff
|
||||||
|
background-type=scale
|
||||||
|
panel-position=none
|
||||||
|
startup-animation=none
|
||||||
|
close-animation=none
|
||||||
|
|
||||||
|
[shell]
|
||||||
|
background-color=0xff002244
|
||||||
|
clock-format=minutes
|
||||||
|
locking=false
|
||||||
|
|
||||||
|
[libinput]
|
||||||
|
touchscreen_calibrator=true
|
||||||
|
calibration_helper=/usr/bin/save-calibration
|
||||||
|
|
||||||
|
[launcher]
|
||||||
|
path=/usr/bin/weston-terminal
|
||||||
|
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
|
||||||
|
|
||||||
|
[launcher]
|
||||||
|
path=/root/tc
|
||||||
|
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
|
||||||
|
|
||||||
|
[launcher]
|
||||||
|
path=/usr/bin/weston-simple-egl
|
||||||
|
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
|
||||||
|
|
||||||
|
#[input-method]
|
||||||
|
#path=/usr/libexec/weston-keyboard
|
||||||
|
|
||||||
|
#[xwayland]
|
||||||
|
#path=/usr/bin/Xwayland
|
||||||
|
|
||||||
|
#[autolaunch]
|
||||||
|
#path=/usr/share/odroid-kiosk-weston/weston-autostart.sh
|
||||||
|
#watch=true
|
||||||
|
|
||||||
|
[output]
|
||||||
|
name=UNNAMED-1
|
||||||
|
mode=320x240
|
||||||
|
ui-size=320x240
|
||||||
|
priority=9
|
||||||
|
seat=seat-weston
|
||||||
|
```
|
||||||
|
|
||||||
|
The key is `seat=seat-weston` in section `[output]`. Set the seat used for display.
|
||||||
|
|
||||||
|
In weston9, the `SPI-1` device is recognized as `UNNAMED-1`, so we set it to `UNNAMED-1`.
|
||||||
|
|
||||||
|
|
||||||
|
### Systemd
|
||||||
|
#### Socket `/etc/systemd/system/weston.socket`
|
||||||
|
```text
|
||||||
|
odroid@gnome-desktop:~$ cat /etc/systemd/system/weston.socket
|
||||||
|
[Unit]
|
||||||
|
Description=Weston, a Wayland compositor
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=%t/weston-0
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Service
|
||||||
|
```text
|
||||||
|
odroid@gnome-desktop:~$ cat /etc/systemd/system/weston.service
|
||||||
|
[Unit]
|
||||||
|
# Make sure we are started after logins are permitted.
|
||||||
|
Description=Weston Wayland compositor startup
|
||||||
|
Requires=systemd-user-sessions.service
|
||||||
|
After=systemd-user-sessions.service
|
||||||
|
After=plymouth-quit-wait.service
|
||||||
|
Wants=dbus.socket
|
||||||
|
After=dbus.socket
|
||||||
|
Requires=weston.socket
|
||||||
|
RequiresMountsFor=/run
|
||||||
|
After=getty@tty7.service
|
||||||
|
Conflicts=getty@tty7.service plymouth-quit.service
|
||||||
|
Before=graphical.target
|
||||||
|
ConditionPathExists=/dev/tty0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
StandardInput=tty
|
||||||
|
UtmpIdentifier=tty7
|
||||||
|
User=root
|
||||||
|
#Group=odroid
|
||||||
|
EnvironmentFile=-/etc/default/weston
|
||||||
|
Environment="XDG_RUNTIME_DIR=/run/user/0"
|
||||||
|
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus"
|
||||||
|
#Environment=XDG_SEAT=seat-weston
|
||||||
|
Environment=XDG_SESSION_CLASS=user
|
||||||
|
#Environment=XDG_SESSION_TYPE=wayland
|
||||||
|
#Environment=XDG_SESSION_DESKTOP=weston
|
||||||
|
#Environment=HOME=/home/odroid
|
||||||
|
#Environment=SEATD_VTBOUND=0
|
||||||
|
|
||||||
|
PAMName=login
|
||||||
|
|
||||||
|
TTYPath=/dev/tty7
|
||||||
|
TTYReset=yes
|
||||||
|
TTYVHangup=yes
|
||||||
|
TTYVTDisallocate=yes
|
||||||
|
|
||||||
|
StandardInput=tty-fail
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
UtmpIdentifier=tty7
|
||||||
|
UtmpMode=user
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/weston --log=/home/odroid/weston.log --seat=seat-weston --drm-device=card1 --socket=weston-0 --tty=7 --modules=systemd-notify.so
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=graphical.target
|
||||||
|
```
|
||||||
|
In `ExecStart`...
|
||||||
|
|
||||||
|
SPI Display's DRM device name is `card-1`, so must set `--drm-device=card1`
|
||||||
|
|
||||||
|
Create a socket weston-0(`weston.socket`) and set it(`--socket=weston-0`) so that it does not overlap with sockets on the existing Ubuntu desktop.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
- Run weston without root
|
||||||
49
overlay/etc/systemd/system/weston.service
Normal file
49
overlay/etc/systemd/system/weston.service
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
[Unit]
|
||||||
|
# Make sure we are started after logins are permitted.
|
||||||
|
Description=Weston Wayland compositor startup
|
||||||
|
Requires=systemd-user-sessions.service
|
||||||
|
After=systemd-user-sessions.service
|
||||||
|
After=plymouth-quit-wait.service
|
||||||
|
Wants=dbus.socket
|
||||||
|
After=dbus.socket
|
||||||
|
Requires=weston.socket
|
||||||
|
RequiresMountsFor=/run
|
||||||
|
After=getty@tty7.service
|
||||||
|
Conflicts=getty@tty7.service plymouth-quit.service
|
||||||
|
Before=graphical.target
|
||||||
|
ConditionPathExists=/dev/tty0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=notify
|
||||||
|
StandardInput=tty
|
||||||
|
UtmpIdentifier=tty7
|
||||||
|
User=root
|
||||||
|
#Group=odroid
|
||||||
|
EnvironmentFile=-/etc/default/weston
|
||||||
|
Environment="XDG_RUNTIME_DIR=/run/user/0"
|
||||||
|
Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus"
|
||||||
|
#Environment=XDG_SEAT=seat-weston
|
||||||
|
Environment=XDG_SESSION_CLASS=user
|
||||||
|
#Environment=XDG_SESSION_TYPE=wayland
|
||||||
|
#Environment=XDG_SESSION_DESKTOP=weston
|
||||||
|
#Environment=HOME=/home/odroid
|
||||||
|
#Environment=SEATD_VTBOUND=0
|
||||||
|
|
||||||
|
PAMName=login
|
||||||
|
|
||||||
|
TTYPath=/dev/tty7
|
||||||
|
TTYReset=yes
|
||||||
|
TTYVHangup=yes
|
||||||
|
TTYVTDisallocate=yes
|
||||||
|
|
||||||
|
StandardInput=tty-fail
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
UtmpIdentifier=tty7
|
||||||
|
UtmpMode=user
|
||||||
|
|
||||||
|
ExecStart=/usr/bin/weston --log=/home/odroid/weston.log --seat=seat-weston --drm-device=card1 --socket=weston-0 --tty=7 --modules=systemd-notify.so
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=graphical.target
|
||||||
5
overlay/etc/systemd/system/weston.socket
Normal file
5
overlay/etc/systemd/system/weston.socket
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Weston, a Wayland compositor
|
||||||
|
|
||||||
|
[Socket]
|
||||||
|
ListenStream=%t/weston-0
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ACTION!="remove", SUBSYSTEM=="input", DEVPATH=="/devices/platform/soc/fe000000.apb4/fe050000.spi/spi_master/spi0/spi0.1/input/input4/event4", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="1.382308 0.050764 -0.072342 -0.013080 -2.273183 1.071859"
|
||||||
2
overlay/etc/udev/rules.d/99-weston.rules
Normal file
2
overlay/etc/udev/rules.d/99-weston.rules
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
ACTION=="add|change", SUBSYSTEM=="drm", DEVPATH=="/devices/platform/soc/fe000000.apb4/fe050000.spi/spi_master/spi0/spi0.0/drm/card1", ENV{ID_SEAT}="seat-weston"
|
||||||
|
ACTION=="add|change", SUBSYSTEM=="input", ENV{ID_FOR_SEAT}=="input-platform-fe050000_spi-cs-1", ENV{ID_SEAT}="seat-weston"
|
||||||
37
overlay/etc/xdg/weston/weston.ini
Normal file
37
overlay/etc/xdg/weston/weston.ini
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
[core]
|
||||||
|
require-input=false
|
||||||
|
locking=false
|
||||||
|
idle-time=0
|
||||||
|
background-color=0x00ffffff
|
||||||
|
background-type=scale
|
||||||
|
panel-position=none
|
||||||
|
startup-animation=none
|
||||||
|
close-animation=none
|
||||||
|
|
||||||
|
[shell]
|
||||||
|
background-color=0xff002244
|
||||||
|
clock-format=minutes
|
||||||
|
locking=false
|
||||||
|
|
||||||
|
[libinput]
|
||||||
|
touchscreen_calibrator=true
|
||||||
|
calibration_helper=/usr/bin/calibration-helper
|
||||||
|
|
||||||
|
[launcher]
|
||||||
|
path=/usr/bin/weston-terminal
|
||||||
|
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
|
||||||
|
|
||||||
|
[launcher]
|
||||||
|
path=/usr/bin/launch-calibration
|
||||||
|
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
|
||||||
|
|
||||||
|
[launcher]
|
||||||
|
path=/usr/bin/weston-simple-egl
|
||||||
|
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
|
||||||
|
|
||||||
|
[output]
|
||||||
|
name=UNNAMED-1
|
||||||
|
mode=320x240
|
||||||
|
ui-size=320x240
|
||||||
|
priority=9
|
||||||
|
seat=seat-weston
|
||||||
16
overlay/usr/bin/calibration-helper
Executable file
16
overlay/usr/bin/calibration-helper
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SYSPATH="$1"
|
||||||
|
MATRIX="$2 $3 $4 $5 $6 $7"
|
||||||
|
|
||||||
|
echo "$1 $2 $3 $4 $5 $6 $7" > /root/tcc
|
||||||
|
|
||||||
|
DEV_PATH=$(udevadm info $SYSPATH --query=property | awk -- 'BEGIN { FS="=" } { if ($1 == "DEVPATH") { print $2; exit } }')
|
||||||
|
|
||||||
|
echo "$DEV_PATH"
|
||||||
|
|
||||||
|
[ -z "$DEV_PATH" ] && exit 1
|
||||||
|
|
||||||
|
echo "ACTION!=\"remove\", SUBSYSTEM==\"input\", DEVPATH==\"$DEV_PATH\", ENV{ID_INPUT_TOUCHSCREEN}==\"1\", ENV{LIBINPUT_CALIBRATION_MATRIX}=\"$MATRIX\"" > /etc/udev/rules.d/99-touchscreen-calibration.rules
|
||||||
5
overlay/usr/bin/launch-calibration
Executable file
5
overlay/usr/bin/launch-calibration
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DEV_PATH="/sys"$(udevadm info /dev/input/by-path/platform-fe050000.spi-cs-1-event --query=property |\
|
||||||
|
awk -- 'BEGIN { FS="=" } { if ($1 == "DEVPATH") { print $2; exit } }')
|
||||||
|
weston-touch-calibrator "$DEV_PATH"
|
||||||
Reference in New Issue
Block a user