Micron Document
config snippets: lisgd & touch

I made reference to these "configs" in a previous note. I use scripts to set up the gesture and touchscreen behavior on my PinePhone Pro.

Gesture Config

This is the script I use to start/restart the gesture daemon on my PinePhonePro. There could be issues with this script, I have not tested any orientations other than normal and right, content beyond that is a guess.

T383838enable-gestures.sh:

T282828
T8b949e#!/bin/bash

pkill lisgd

Te6edf3ORIENTATIONTff7b72=T79c0ff0

Tff7b72case Tff7b72$(xrandr Tb4b4b4| grep connected Tb4b4b4| cut -f2 -dTa5d6ff'(' Tb4b4b4| cut -f1 -dTa5d6ff' 'Tff7b72) Tff7b72in
Ta5d6ff'normal'Tff7b72)
Te6edf3ORIENTATIONTff7b72=T79c0ff0
Tb4b4b4;Tb4b4b4;
Ta5d6ff'right'Tff7b72)
Te6edf3ORIENTATIONTff7b72=T79c0ff1
Tb4b4b4;Tb4b4b4;
Ta5d6ff'left'Tff7b72)
Te6edf3ORIENTATIONTff7b72=T79c0ff2
Tb4b4b4;Tb4b4b4;
*Tff7b72)
Te6edf3ORIENTATIONTff7b72=T79c0ff0
Tb4b4b4;Tb4b4b4;
Tff7b72esac
lisgd -d /dev/input/event0 -o Ta5d6ff"Te6edf3$ORIENTATIONTa5d6ff" Tffea00\
-g Ta5d6ff'1,DU,B,S,urxvt' Tffea00\
-g Ta5d6ff'1,UD,T,M,bspc node -c' Tffea00\
-g Ta5d6ff'1,LR,BL,M,bash ~/bin/touch.sh on' Tffea00\
-g Ta5d6ff'1,RL,BR,M,bspc ~/bin/touch.sh on' Tffea00\
-g Ta5d6ff'2,UD,T,M,bspc node -k' Tffea00\
-g Ta5d6ff'1,UD,T,S,rofi -show window' Tffea00\
-g Ta5d6ff'1,URDL,T,S,import -screen -window root screenshots/$(date "+%Y-%m-%d_%H:%M:%S").png' Tffea00\
-g Ta5d6ff'1,LR,L,S,bspc desktop -f prev' Tffea00\
-g Ta5d6ff'1,RL,L,S,bspc desktop -f next' Tffea00\
Tb4b4b4&


There is a certain "finicky" aspect of this setup. I like how Rofi can show a window list, so I use that here, but if I don't have a keyboard plugged in, I can't actually use Rofi to pick the window I want because it doesn't understand the up/down power buttons like the patched Dmenu does. So if I mess up the kill gesture, I can end up with a window list that I can't use unless the touchscreen is also on. I have a binding to "fix" this, sliding my thumb along the bottom of the screen to enable touch, which is also referenced below.

Touch Config

This is the script I use to turn the touchscreen on and off. I call this when the power button is pressed, or when cycling through input methods.

That is, when I turn the screen off, I disable the touchscreen keyboard/mouse, and so if T383838lisgd is running it can act on gestures, but I wont send errant clicks to any windows that might be on screen. A value of T383838on being sent to this script let's me click on windows and they will receive the click. This includes the on-screen keyboard.

It's possible to pop up the keyboard and then call this script to shut off the touch layer, and then the keyboard can't receive clicks any more. This should never happen, but if it does, I have a gesture to re-enable the touch layer by sliding my thumb along the bottom edge of the screen. It should never happen, but if it ever does (and I remember that I have this gesture) I can fix the situation.

This script is hard coded for PinePhone devices, it references the input layer by device description. Technically it would work on anything with that exact description, but this is all current and past PinePhones as of writing this (2023, Feb).

T383838touch.sh:

T282828
T8b949e#!/bin/bash
T8b949e# script to enable/disable touchscreen

Tff7b72case Ta5d6ff"Tffd700${Te6edf31Tffd700}Ta5d6ff" Tff7b72in
Ta5d6ff"off"Tff7b72)
xinput --disable Ta5d6ff"pointer:Goodix Capacitive TouchScreen"
xinput --disable Ta5d6ff"keyboard:Goodix Capacitive TouchScreen"
Tb4b4b4;Tb4b4b4;
Ta5d6ff"on"Tff7b72)
xinput --enable Ta5d6ff"pointer:Goodix Capacitive TouchScreen"
xinput --enable Ta5d6ff"keyboard:Goodix Capacitive TouchScreen"
Tb4b4b4;Tb4b4b4;
Tff7b72esac


Tags: pinephone

Tags
Navigation
Backlinks


created: 2023-02-15

(re)generated: 2026-07-17