Nintendo Switch ScreenCtl

Power-key menu, screen-off, and tap-to-wake on L4T Ubuntu

View the Project on GitHub Ozdotdotdot/switch-tablet-screenctl

Screen off and tap to wake on an Ubuntu Nintendo Switch

This guide gives an L4T Ubuntu Switch tablet-like display controls:

The setup uses X11, xrandr, evtest, YAD, and two systemd user services. It was verified on Ubuntu 24.04 with the Switch panel exposed as DSI-0.

1. Download this project

git clone https://github.com/Ozdotdotdot/switch-tablet-screenctl.git
cd switch-tablet-screenctl

2. Install packages and input permissions

sudo apt update
sudo apt install -y evtest yad zenity x11-xserver-utils xinput
sudo usermod -aG input "$USER"

Log out and back in after adding the group. Confirm it with:

id | grep input

3. Confirm the panel and input devices

xrandr --query
./scripts/find-powerkey
./scripts/find-touch

The tested Switch reports:

The event numbers may change. The included finder scripts discover them instead of relying on fixed /dev/input/eventN paths.

4. Install the scripts and display configuration

sudo install -m 755 scripts/screenctl scripts/find-powerkey scripts/find-touch \
  scripts/powerkey-listener.sh scripts/tapwake.sh /usr/local/bin/
sudo install -m 644 config/screenctl.conf /etc/screenctl.conf

Edit /etc/screenctl.conf if xrandr --query reports a different panel or mode:

PANEL="DSI-0"
MODE="1280x720"
RATE="60"
ROTATE="normal"
DISPLAY=":0"

Test the controller before continuing:

screenctl status
screenctl off
sleep 2
screenctl on

If the screen does not return, connect over SSH and run screenctl on after correcting /etc/screenctl.conf.

5. Stop logind from handling a short power-key press

Install the included logind drop-in:

sudo install -d /etc/systemd/logind.conf.d
sudo install -m 644 config/powerkey-menu.conf \
  /etc/systemd/logind.conf.d/powerkey-menu.conf

It keeps a long press as the emergency power-off fallback:

[Login]
HandlePowerKey=ignore
HandlePowerKeyLongPress=poweroff

Restarting logind can close the graphical session. Save your work first, then run:

sudo systemctl restart systemd-logind

6. Install and enable the user services

mkdir -p ~/.config/systemd/user
install -m 644 systemd/powerkey-listener.service systemd/tapwake.service \
  ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now powerkey-listener.service tapwake.service
loginctl enable-linger "$USER"

Use these user services only. Do not also create a system-level tap-wake service with a fixed event number.

7. Test the complete flow

  1. Run systemctl --user status powerkey-listener tapwake.
  2. Press the physical power key.
  3. Confirm that the YAD menu appears.
  4. Tap Screen Off.
  5. Confirm that the panel becomes dark while Linux continues running.
  6. Tap the dark touchscreen once.
  7. Confirm that the panel returns.

Watch logs in another terminal if anything fails:

journalctl --user -u powerkey-listener -u tapwake -f

How it works

power key -> evtest --grab -> YAD menu -> screenctl off
touch event -> tapwake.sh -> screenctl on

Touch alignment

The tested 1280x720 panel uses normal rotation and the identity touch matrix:

xinput set-prop "$(xinput list --id-only touchscreen)" \
  "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1

If you rotate the display, update both ROTATE in /etc/screenctl.conf and the touchscreen matrix.

Troubleshooting

Verified against the running Switch on 2026-08-20.