Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ephemient/2f4e596fe68e1f13cbde26b8979eb058 to your computer and use it in GitHub Desktop.
Save ephemient/2f4e596fe68e1f13cbde26b8979eb058 to your computer and use it in GitHub Desktop.
[Unit]
Description=Map absolute input touch device to fixed output
BindsTo=dev-input-%i.device
After=dev-input-%i.device
[Service]
Type=oneshot
ExecStart=/bin/sh -c ' \
/usr/bin/libinput list-devices | \
/usr/bin/awk \' \
function end_record() \
{ \
if (fields["Kernel"] == "/dev/input/%I") print fields["Device"]; split("", fields) \
} \
match($$0, /^([^:]+):[[:space:]]*(.*)/, parts) { fields[parts[1]] = parts[2] } \
/^$$/ { end_record() } END { end_record() } \' | \
/usr/bin/xargs -d\'\\n\' -n1 -r -t /usr/bin/xinput list --id-only | \
/usr/bin/xargs -d\'\\n\' -i -t /usr/bin/xinput --map-to-output {} eDP-1'
[Unit]
Description=Start all ENV{SYSTEM_USER_WANTS} units from udev
[Service]
Type=oneshot
ExecStart=/bin/sh -c "/bin/udevadm info -e | /bin/grep '^E: SYSTEMD_USER_WANTS=' | /bin/cut -d= -f2- | /usr/bin/xargs -d'\n' -n1 -r -t /bin/systemctl --user start"
[Install]
WantedBy=default.target
[Unit]
Description=Read gestures from libinput touchpad and action shell commands.
BindsTo=dev-input-%i.device
After=dev-input-%i.device
[Service]
Type=simple
ExecStart=/usr/bin/libinput-gestures --device /dev/input/%I
ExecStopPost=-/bin/rm -f /tmp/libinput-gestures-%u.lock
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_TOUCHPAD}=="1", \
TAG+="systemd", ENV{SYSTEMD_USER_WANTS}+="libinput-gestures@%k.service"
SUBSYSTEM=="input", KERNEL=="event*", ENV{LIBINPUT_DEVICE_GROUP}=="18/4f3/2513:i2c-04F3200A:00", \
TAG+="systemd", ENV{SYSTEMD_USER_WANTS}+="absolute-input@%k.service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment