Linux Virtual Display for iPad Pro

From Chorke Wiki
Jump to navigation Jump to search

Gnome Remote

sudo ufw allow 5900/tcp
sudo ufw status verbose
systemctl --user restart gnome-remote-desktop.service
systemctl --user status  gnome-remote-desktop.service

gsettings set org.gnome.desktop.remote-desktop.rdp screen-share-mode extend

Linux Display Driver

10-amdgpu.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/10-amdgpu.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/10-amdgpu.conf >/dev/null
Section "OutputClass"
        Identifier "AMDgpu"
        MatchDriver "amdgpu"
        Driver "amdgpu"
EndSection
EOF
fi

10-nvidia.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/10-nvidia.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/10-nvidia.conf >/dev/null
Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    ModulePath "/usr/lib/x86_64-linux-gnu/nvidia/xorg"
EndSection
EOF
fi

10-quirks.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/10-quirks.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/10-quirks.conf >/dev/null
# Collection of quirks and blacklist/whitelists for specific devices.


# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442 
Section "InputClass"
        Identifier "ThinkPad HDAPS accelerometer blacklist"
        MatchProduct "ThinkPad HDAPS accelerometer data"
        Option "Ignore" "on"
EndSection

# https://bugzilla.redhat.com/show_bug.cgi?id=523914
# Mouse does not move in PV Xen guest
# Explicitly tell evdev to not ignore the absolute axes.
Section "InputClass"
        Identifier "Xen Virtual Pointer axis blacklist"
        MatchProduct "Xen Virtual Pointer"
        Option "IgnoreAbsoluteAxes" "off"
        Option "IgnoreRelativeAxes" "off"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
        Identifier "Tag trackballs as XI_TRACKBALL"
        MatchProduct "trackball"
        MatchDriver "evdev"
        Option "TypeName" "TRACKBALL"
EndSection

# https://bugs.freedesktop.org/show_bug.cgi?id=62831
# Bug 62831 - Mionix Naos 5000 mouse detected incorrectly
Section "InputClass"
        Identifier "Tag Mionix Naos 5000 mouse XI_MOUSE"
        MatchProduct "La-VIEW Technology Naos 5000 Mouse"
        MatchDriver "evdev"
        Option "TypeName" "MOUSE"
EndSection
EOF
fi

10-radeon.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/10-radeon.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/10-radeon.conf >/dev/null
Section "OutputClass"
	Identifier "Radeon"
	MatchDriver "radeon"
	Driver "radeon"
EndSection
EOF
fi

11-nvidia-offload.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/11-nvidia-offload.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/11-nvidia-offload.conf >/dev/null
# DO NOT EDIT. AUTOMATICALLY GENERATED BY gpu-manager

Section "ServerLayout"
    Identifier "layout"
    Option "AllowNVIDIAGPUScreens"
EndSection
EOF
fi

20-intel.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/20-intel.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/20-intel.conf >/dev/null
Section "Device"
    Identifier "intelgpu0"
    Driver "intel"
    Option "VirtualHeads" "2"
EndSection
EOF
fi

30-virtscreen.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/30-virtscreen.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/30-virtscreen.conf >/dev/null
# nvidia/nouveau/amdgpu device should be configured first before Intel GPU
Section "Device"
	Identifier "nvidiagpu0"
	Driver     "nvidia" # Because you are using Nvidia proprietary driver. Change to "nouveau" if you are using open source nouveau driver
EndSection

# Then configure intel internal GPU
Section "Device"
	Identifier "intelgpu0"
	Driver     "intel"
	# You may put Option "VirtualHeads" "1" here but it seem you don't need to put this for Ubuntu 18.04.
EndSection
EOF
fi

40-libinput.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/40-libinput.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/40-libinput.conf >/dev/null
# Match on all types of devices but joysticks
#
# If you want to configure your devices, do not copy this file.
# Instead, use a config snippet that contains something like this:
#
# Section "InputClass"
#   Identifier "something or other"
#   MatchDriver "libinput"
#
#   MatchIsTouchpad "on"
#   ... other Match directives ...
#   Option "someoption" "value"
# EndSection
#
# This applies the option any libinput device also matched by the other
# directives. See the xorg.conf(5) man page for more info on
# matching devices.

Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput tablet catchall"
        MatchIsTablet "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection
EOF
fi

70-wacom.conf


if [[ ! -e /usr/share/X11/xorg.conf.d/70-wacom.conf ]];then
cat << EOF | sudo tee /usr/share/X11/xorg.conf.d/70-wacom.conf >/dev/null
# Some of the below input classes appear 3x times, once for each of
# "tablet", "touchscreen", and "touchpad" to ensure that the Wacom
# driver is not accidentally bound to other types of hardware that
# Wacom has made which are not handled by the wacom driver (e.g the
# Wacom Bluetooth Keyboard)
#
# https://sourceforge.net/p/linuxwacom/bugs/294/

Section "InputClass"
        Identifier "Wacom USB tablet class"
        MatchUSBID "056a:*"
        MatchDevicePath "/dev/input/event*"
        MatchIsTablet "true"
        Driver "wacom"
EndSection

Section "InputClass"
        Identifier "Wacom USB touchscreen class"
        MatchUSBID "056a:*"
        MatchDevicePath "/dev/input/event*"
        MatchIsTouchscreen "true"
        Driver "wacom"
EndSection

Section "InputClass"
        Identifier "Wacom USB touchpad class"
        MatchUSBID "056a:*"
        MatchDevicePath "/dev/input/event*"
        MatchIsTouchpad "true"
        Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom tablet class"
	MatchProduct "Wacom|WACOM|PTK-540WL|ISD-V4"
	MatchDevicePath "/dev/input/event*"
	MatchIsTablet "true"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom touchscreen class"
	MatchProduct "Wacom|WACOM|PTK-540WL|ISD-V4"
	MatchDevicePath "/dev/input/event*"
	MatchIsTouchscreen "true"
	Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom touchpad class"
	MatchProduct "Wacom|WACOM|PTK-540WL|ISD-V4"
	MatchDevicePath "/dev/input/event*"
	MatchIsTouchpad "true"
	Driver "wacom"
EndSection

# Serial Wacom devices should always be one of tablet, touchscreen, or
# touchpad so we can safely get away with just one match section in
# these cases
Section "InputClass"
        Identifier "Wacom PnP device class"
        MatchPnPID "WACf*|WCOM*|WACM*|FUJ02e5|FUJ02e7|FUJ02e9"
        MatchDevicePath "/dev/input/event*"
        Driver "wacom"
EndSection

Section "InputClass"
	Identifier "Wacom serial class"
	MatchProduct "Serial Wacom Tablet"
	Driver "wacom"
EndSection

Section "InputClass"
        Identifier "Wacom serial class identifiers"
        MatchProduct "WACf|FUJ02e5|FUJ02e7|FUJ02e9"
        Driver "wacom"
EndSection

# Hanwang tablets
Section "InputClass"
	Identifier "Hanwang class"
	MatchProduct "Hanwang"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

# Waltop tablets
Section "InputClass"
	Identifier "Waltop class"
	MatchProduct "WALTOP"
	MatchIsTablet "on"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
EndSection

# N-Trig Duosense Electromagnetic Digitizer
Section "InputClass"
	Identifier "Wacom N-Trig class"
	MatchProduct "HID 1b96:0001|N-Trig Pen|N-Trig DuoSense"
	MatchDevicePath "/dev/input/event*"
	Driver "wacom"
	Option "Button2" "3"
EndSection

# Dell Canvas 27 (touch part is an Advanced Silicon, pen part a Wacom)
Section "InputClass"
        Identifier "Dell Canvas 27 Touch"
        MatchUSBID "2575:0204"
        MatchDevicePath "/dev/input/event*"
        MatchIsTouchscreen "true"
        Driver "wacom"
EndSection

# Surface Go
Section "InputClass"
        Identifier "SurfaceGo Touch"
        MatchProduct "ELAN9038:00 04F3:261A"
        MatchDevicePath "/dev/input/event*"
        Driver "wacom"
EndSection

# Nuvision Solo 10 Draw (Supports Surface Pens)
Section "InputClass"
        Identifier "Nuvision Solo 10 Draw"
        MatchProduct "04F3200A:00 04F3:22F7"
        MatchDevicePath "/dev/input/event*"
        Driver "wacom"
EndSection
EOF
fi

Knowledge

lsblk
lscpu
lsusb
free -h
sudo lshw

ufw status
ufw status verbose
systemctl status ufw
apt list --installed
sudo ufw allow http
sudo ufw allow OpenSSH
sudo ufw allow 5900/tcp

sudo ss -tulpn | grep LISTEN
sudo ss -tulwn | grep LISTEN
sudo ss -tulpn | grep LISTEN | grep sshd
sudo ss -tulpn | grep LISTEN | grep redis
sudo ss -tulpn | grep LISTEN | grep gnome
sudo ss -tulpn | grep LISTEN | grep apache

sudo lspci -t
sudo lspci -v | less
sudo glxinfo -B | less

sudo lshw -short
sudo lshw -C system
sudo lshw -C display
sudo lshw -C input | less
sudo lshw -C memory| less
sudo dmidecode -t
sudo dmidecode -t 1
sudo dmidecode -t 2
sudo dmidecode -t 3

sudo dmidecode | less
sudo dmidecode | grep 'SKU Number'
sudo dmidecode -s system-product-name
sudo dmidecode -s system-serial-number

cvt 1600 1200 60

virtual display mode description:
cvt 1600 1200 60 | sed -n "s/^.*Modeline\s*\".*\"\s*//p"

virtual display mode name based on resolution:
cvt 1600 1200 60 | sed -n "s/^.*Modeline\s*\"\(.*\)\".*/\1/p"

x11vnc -storepasswd
:'
Enter VNC password: 
Verify password:    
Write password to /home/chorke/.vnc/passwd?  [y]/n y
Password written to: /home/chorke/.vnc/passwd
'

/usr/bin/x11vnc -auth guess -forever -loop -noxdamage\
 -repeat -rfbauth /home/chorke/.vnc/passwd -rfbport 5900 -shared

display server is wayland|xorg(x11)
echo ${XDG_SESSION_TYPE}
sudo apt install --reinstall x11-common
sudo systemctl start x11-common.service

xdpyinfo|grep -oP 'dimensions:\s+\K\S+'
xdpyinfo|grep -oP 'dimensions:\s+\K\S+'|cut -d 'x' -f1
xdpyinfo|grep -oP 'dimensions:\s+\K\S+'|cut -d 'x' -f2 
xrandr --current|grep '*'|uniq|awk '{print $1}'
xrandr --current|grep '*'|uniq|awk '{print $1}'|cut -d 'x' -f1
xrandr --current|grep '*'|uniq|awk '{print $1}'|cut -d 'x' -f2

References