Skip to content

asidko/gnome-touchpad-emulator-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GNOME Touchpad Emulator Toggle

A minimal GNOME Shell extension that adds a Touchpad Mode tile to the Quick Settings panel. One tap to start TouchpadEmulator, one tap to stop. Useful on Linux phones (postmarketOS, Mobian) where you want trackpad-style cursor input from a quick-settings toggle instead of hunting for the app icon.

tile

Why

TouchpadEmulator ships with a .desktop launcher, but on a phone it's faster to flip it from the same pulldown as Wi-Fi and brightness. Tapping the tile spawns the binary directly and tracks its lifecycle — no polling, no pkill scanning, no shell launcher.

Requirements

  • GNOME Shell 45 – 50 (tested on 50.1).
  • touchpad-emulator installed and /usr/bin/TouchpadEmulator on $PATH.
  • /dev/uinput and /dev/input/event* accessible to your user (the upstream touchpad-emulator package ships a udev rule for this).

On postmarketOS:

sudo apk add touchpad-emulator

Install

git clone https://github.com/asidko/gnome-touchpad-emulator-toggle.git \
  ~/.local/share/gnome-shell/extensions/touchpad-emulator@local

Log out and log back in (Wayland — extensions can't be loaded into a running session), then enable:

gnome-extensions enable touchpad-emulator@local

The tile appears in Quick Settings as Touchpad Mode.

How it works

  • Spawns /usr/bin/TouchpadEmulator directly via Gio.Subprocess. wait_async on the child is the single source of truth for tile state — if the process exits for any reason, the tile auto-greys.
  • Stop sends SIGTERM to the held subprocess handle, so there's no pkill scanning and no chance of killing the wrong process.
  • A one-shot pgrep at startup adopts any TouchpadEmulator started outside the tile (e.g. autostart); for that case only, stop falls back to pkill -f.

Notes for postmarketOS / Snapdragon devices

  • TouchpadEmulator claims iio-sensor-proxy for its own screen-rotation feature. GNOME's auto-rotate quick-setting will disappear while the emulator is running and reappear on stop. This is expected — only one process can claim the accelerometer at a time.
  • Alpine's killall/pkill -x silently fail to match process names longer than 15 characters (kernel comm truncation). The shipped LaunchTouchpadEmulator.sh hits this bug; this extension avoids it by spawning the binary directly and matching with pkill -f.

Uninstall

gnome-extensions disable touchpad-emulator@local
rm -rf ~/.local/share/gnome-shell/extensions/touchpad-emulator@local

License

MIT

About

GNOME Shell extension that adds a Quick Settings tile to toggle TouchpadEmulator on Linux phones.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors