Skip to content

MrRedBeard/lxqt-touch-toggle

Repository files navigation

Touch Toggle - LXQt Panel Widget

A lightweight LXQt panel widget that toggles touchscreen input on/off and reflects the current state directly in the panel using clear, high‑contrast SVG icons.

This widget is designed for tablet / convertible / drawing setups where accidental touch input needs to be disabled quickly (stylus-only workflows, palm rejection, kiosk modes, etc.).

* Built around an old Samsung 700T1a tablet so some testing/tweaking is needed for other devices

  • Wacom EMR (Electro-Magnetic Resonance)
  • Wacom ISDv4 E6 Pen stylus
  • Wacom ISDv4 E6 Finger touch
  • Atmel Atmel maXTouch Digitizer

What This Widget Does

  • Detects the current touch input state
  • Displays the state visually in the LXQt panel
  • Toggles touch on/off with a single click
  • Automatically adapts icon color to panel theme

Visual States

Touch State Panel Theme Icon
On Any Green fingerprint
Off Dark panel White fingerprint
Off Light panel Black fingerprint

Screenshots

Visual examples of the Touch Toggle widget in use.

Full Screen

Full screen view

Touch Enabled

Touch enabled

Touch Disabled

Touch disabled


Dependencies

sudo apt install -y \
    lxqt-panel \
    liblxqt-globalkeys0 \
    liblxqt0 \
    libqt6widgets6 \
    libqt6gui6 \
    libqt6core6 \
    xinput \
    build-essential \
    cmake \
    qt6-base-dev \
    liblxqt-dev \
    libx11-dev \
    libxkbcommon-dev;

Build and Install

sudo ./scripts/clean-install.sh

or

pkill -x lxqt-panel;
sleep 1;

sudo install -m 0644 ./touchtoggle.desktop /usr/share/lxqt/lxqt-panel/touchtoggle.desktop;

rm -rf ./build
mkdir -p build;
cd build;

cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr;
make -j"$(nproc)";
sudo cmake --install . --prefix /usr;

sudo reboot

Architecture Overview

This widget is a native LXQt panel plugin backed by a small helper script.

Components

  • Panel plugin (libtouchtoggle.so)
  • Helper script (touchctl) - talks to xinput
  • SVG icons - bundled via Qt resources and installed system‑wide

Installed File Locations

Plugin Binary

/usr/lib/x86_64-linux-gnu/lxqt-panel/libtouchtoggle.so

Plugin Desktop Metadata

/usr/share/lxqt/lxqt-panel/plugins/touchtoggle.desktop

Icons

Credit: Kitchen JS Font Icons

/usr/share/lxqt/lxqt-panel/icons/lxqt-sr-panel/
├── fingerprint-on.svg        (green)
├── fingerprint-off-dark.svg  (white)
└── fingerprint-off-light.svg (black)

LXQt only discovers panel plugins from /usr/share/lxqt/lxqt-panel/plugins/.


Helper Script: touchctl

The panel widget delegates actual touch enable/disable logic to a small helper:

~/.local/bin/touchctl

What it does

  • Lists touch devices
  • Detects enabled/disabled state
  • Toggles touch input via xinput

Manual Testing

~/.local/bin/touchctl --device;
~/.local/bin/touchctl --status;
~/.local/bin/touchctl --state;
~/.local/bin/touchctl toggle;
~/.local/bin/touchctl --status;

List Input Devices

xinput list --name-only | cat -A;

Installation

Do not install manually.

All cleanup, rebuild, and installation logic is centralized in:

./scripts/clean-install.sh

This script:

  • Removes stale plugin versions (srplugin, old paths, /usr/local ghosts)
  • Installs icons
  • Builds and installs the panel plugin
  • Prompts for reboot at the end

Run it from the repository root:

./scripts/clean-install.sh

Adding the Widget to the Panel

  1. Right‑click the LXQt panel
  2. Select Configure Panel
  3. Click Add Widgets
  4. Scroll to Touch Toggle
  5. Click Add
  6. Close the panel configuration

The fingerprint icon should now appear in the panel.


Renaming History (for sanity)

This project was cleaned up and renamed during development:

  • srplugintouchtoggle
  • lxqt-sr-panellxqt-touchtoggle-panel
  • srPanelPlugintouchtogglePanelPlugin

All legacy identifiers are removed by clean-install.sh.


Development Notes

  • Panel icon is set in C++, not via .desktop
  • SVGs are bundled using icons.qrc
  • .desktop icon is only used for the Add Widgets list
  • LXQt silently ignores mismatched plugin IDs - exact naming matters

Intended Use Cases

  • Linux drawing tablets
  • Convertible laptops
  • Stylus‑only workflows
  • Palm‑rejection control
  • Kiosk / demo systems

Status

  • Stable
  • Survives reboot
  • No duplicate plugin loading
  • Clean install path

About

Toggle touch on and off with a lxqt panel widget for use on tablets while drawing for palm avoidance

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors