Skip to content

Instantly share code, notes, and snippets.

@dattasaurabh82
Last active February 9, 2024 16:43
Show Gist options
  • Save dattasaurabh82/74e55940932c097eb8e9c88b2f3eac04 to your computer and use it in GitHub Desktop.
Save dattasaurabh82/74e55940932c097eb8e9c88b2f3eac04 to your computer and use it in GitHub Desktop.
Setup waveshare 7.9" [400x1280] touchscreen display on Intel NUC running Ubuntu20.04 LTS desktop
DISPLAY: https://www.waveshare.com/wiki/7.9inch_HDMI_LCD
Connect the USB touch & power of the display's uUSB to any USB port of the Intel NUC machine.
Connect the HDMI INPUT for the display through a thunderbolt 3 -> HDMI adapater to the NUC
Connect your primary display to the NUC's main HDMI output.
In display settings of Ubuntu's Settings, arrange your display orintation and position according to your needs.
My setup involved to set it up in "Left Portrait" mode.
The display timing are automatically recognized by Ubuntu if this display is attached to the Thunderbolt 3 as secondary display.
Note: If you attach the waveshare display to the rpimary HDMI of NUC, it won't work and will appear glitchy..
"xrandr" command will output the associated displays as DP-x (in my case the waveshare display was DP-2)
Calibrate the touch input:
-------------------------
All the touch drivers are installed in Ubuntu, if not then install them by:
sudo apt-get install xserver-xorg-input-libinput -y
Check if the system recognized the touchinput drivers by running "xinput"
"xinput: will output attached inputs. Lookout for "WaveShare WaveShare"...
The command to map the touch screen to the waveshare display:
xinput --map-to-output <input device name or ID> <output display>
So in my case it was: xinput --map-to-output "WaveShare WaveShare" DP-2
To setup after restart, put this command in ~/.profile
# for touchscreen
/usr/bin/sleep 5 && /usr/bin/xinput --map-to-output "WaveShare WaveShare" DP-2 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment