Use your Tablet as a Second Screen for your Notebook
A script that turns an Android tablet into a second monitor over USB — no extra hardware or Wi-Fi required. It only supports Android and has been tested with the following devices:
| Manufacturer | Model |
|---|---|
| Samsung | Tab S9+ |
How does the tool work?
The script sets up an Android tablet as a second monitor under Hyprland:
- Check prerequisites – Load configuration, clean up old wayvnc processes, verify that
adb,hyprctl, andwayvncare installed. - Detect tablet – Show a notification and wait for a USB-connected ADB device.
- Create virtual monitor – Create a
HEADLESSmonitor in Hyprland, configure it, and position it to the right of the primary display. - Start VNC session – Point wayvnc at the
HEADLESSmonitor and forward it to the tablet on port 5900 via an ADB reverse tunnel. - Monitor – Every 2 seconds check whether the tablet and wayvnc are still running; automatically restart wayvnc if it crashes.
- Cleanup – On disconnect or abort: stop wayvnc, restore Hyprland settings, and remove the
HEADLESSmonitor.
Setup
Tablet
- Go to Settings → About device and tap Build number seven times to enable Developer options.
- Go to Settings → Developer options and enable USB debugging.
- Connect the tablet to your notebook via USB and confirm the ADB authorization prompt on the tablet.
- Install a VNC viewer. AVNC is a good open-source option available on F-Droid and the Play Store.
Notebook
Install dependencies:
Arch:
sudo pacman -S android-tools && yay -S wayvncUbuntu:
sudo apt install android-tools-adb wayvncInstall the script:
mkdir -p ~/.config/hypr/scripts
curl -o ~/.config/hypr/scripts/tablet-monitor.sh \
https://raw.githubusercontent.com/MlNUX/secondscreen_tablet/main/tablet-monitor.sh
chmod +x ~/.config/hypr/scripts/tablet-monitor.shCreate a .desktop file so the script appears in your app launcher:
mkdir -p ~/.local/share/applications# ~/.local/share/applications/tablet-monitor.desktop
[Desktop Entry]
Type=Application
Name=Tablet Monitor
Comment=Use tablet as a second monitor via USB (wayvnc)
Exec=/bin/bash -lc '~/.config/hypr/scripts/tablet-monitor.sh'
Icon=/usr/share/icons/breeze/devices/24/tablet.svg
Terminal=false
Categories=Utility;Usage
- Plug in the tablet via USB.
- Launch Tablet Monitor from your app launcher, or run the script directly:
~/.config/hypr/scripts/tablet-monitor.sh- A notification will appear while the script waits for the ADB device. Once detected, the virtual monitor is created and the VNC session starts automatically.
- In AVNC on the tablet, add a new connection with host
localhostand port5900.