From 777a66e96ab4698e24d348fffdfac77875ab7d97 Mon Sep 17 00:00:00 2001 From: Andrew Sichevoi Date: Sun, 24 Jan 2021 10:03:24 +0100 Subject: [PATCH] build: basic Makefile added --- Makefile | 24 ++++++++++++++++++++++++ README.md | 9 +++++++++ reset-trackpoint-fix.conf | 2 ++ reset-trackpoint-fix.sh | 2 ++ 4 files changed, 37 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e114492 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +### https://git.thekondor.net/?p=reset-trackpoint-fix.git (mirror: github.com/thekondor/reset-trackpoint-fix) + +.PHONY: help +help: ## Show (this) help + @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +.PHONY: install +install: ## Install files + @test -f ${DESTDIR}/etc/reset-trackpoint-fix.conf || install -Dm644 reset-trackpoint-fix.conf ${DESTDIR}/etc/reset-trackpoint-fix.conf + @install -Dm755 reset-trackpoint-fix.sh ${DESTDIR}/usr/bin/reset-trackpoint-fix.sh + @install -Dm644 reset-trackpoint-fix.service ${DESTDIR}/etc/systemd/system/reset-trackpoint-fix.service + +.PHONY: uninstall +uninstall: disable ## Remove installed files + @rm ${DESTDIR}/usr/bin/reset-trackpoint-fix.sh + @rm ${DESTDIR}/etc/systemd/system/reset-trackpoint-fix.service + +.PHONY: enable +enable: ## Enable a service file to trigger resets + systemctl enable ${DESTDIR}/etc/systemd/system/reset-trackpoint-fix.service + +.PHONY: disable +disable: ## Disable a service file + systemctl disable reset-trackpoint-fix.service diff --git a/README.md b/README.md index 5b24bf1..902d282 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ The script addresses a dead trackpoint/trackpad accordingly to [wiki page](https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Carbon_(Gen_6)#TrackPoint_and_Touchpad_issues) by disconnecting and reconnecting a broken SerIO device on resume. +## Installation + +`make install` to install files. + +`make enable` to enable a service files to trigger reset on laptop resume. + +`make uninstall` to disable the service and clean installed files up. + + ## Configuration - Uncomment and set a proper value in `/etc/reset-trackpoint-fix.conf`. Usually it is equal to `serio1`. diff --git a/reset-trackpoint-fix.conf b/reset-trackpoint-fix.conf index abdec09..d852480 100644 --- a/reset-trackpoint-fix.conf +++ b/reset-trackpoint-fix.conf @@ -1,2 +1,4 @@ +### https://git.thekondor.net/?p=reset-trackpoint-fix.git (mirror: github.com/thekondor/reset-trackpoint-fix) + ### Uncomment this line and set it to SerIO device which corresponds to a Trackpoint input #DEVICE=serio1 diff --git a/reset-trackpoint-fix.sh b/reset-trackpoint-fix.sh index 290e852..1ce8902 100755 --- a/reset-trackpoint-fix.sh +++ b/reset-trackpoint-fix.sh @@ -1,5 +1,7 @@ #!/bin/sh +### https://git.thekondor.net/?p=reset-trackpoint-fix.git (mirror: github.com/thekondor/reset-trackpoint-fix) + . /etc/reset-trackpoint-fix.conf if [ -z "${DEVICE}" ]; then -- 2.20.1