build: basic Makefile added v0.0.1
authorAndrew Sichevoi <k@thekondor.net>
Sun, 24 Jan 2021 09:03:24 +0000 (10:03 +0100)
committerAndrew Sichevoi <k@thekondor.net>
Sun, 24 Jan 2021 09:37:26 +0000 (10:37 +0100)
Makefile [new file with mode: 0644]
README.md
reset-trackpoint-fix.conf
reset-trackpoint-fix.sh

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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
index 5b24bf1..902d282 100644 (file)
--- 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.
 
 
 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`.
 ## Configuration
 
 - Uncomment and set a proper value in `/etc/reset-trackpoint-fix.conf`. Usually it is equal to `serio1`.
index abdec09..d852480 100644 (file)
@@ -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
 ### Uncomment this line and set it to SerIO device which corresponds to a Trackpoint input
 #DEVICE=serio1
index 290e852..1ce8902 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
 #!/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
 . /etc/reset-trackpoint-fix.conf
 
 if [ -z "${DEVICE}" ]; then