2024-04-06 23:20:36 +03:00
|
|
|
|
2024-04-07 00:30:23 +03:00
|
|
|
SBIN_DIR := /usr/sbin/
|
2024-04-06 23:20:36 +03:00
|
|
|
SERVICE_DIR := /etc/systemd/system/
|
|
|
|
|
|
2024-04-07 00:30:23 +03:00
|
|
|
SCRIPT := thinkpad-keyboard-brightness
|
|
|
|
|
TIMER := $(SCRIPT).timer
|
|
|
|
|
UNIT := $(SCRIPT).service
|
2024-04-06 23:20:36 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY:install
|
2024-04-07 00:30:23 +03:00
|
|
|
install: $(TIMER) $(UNIT) $(SCRIPT)
|
|
|
|
|
cp -f $(UNIT) $(TIMER) $(SERVICE_DIR)
|
2024-04-06 23:20:36 +03:00
|
|
|
systemctl daemon-reload
|
2024-04-07 00:30:23 +03:00
|
|
|
systemctl enable ${UNIT}
|
|
|
|
|
systemctl enable ${TIMER}
|
2024-04-06 23:20:36 +03:00
|
|
|
systemctl start ${TIMER}
|
|
|
|
|
|
2024-04-07 00:30:23 +03:00
|
|
|
|
|
|
|
|
.PHONY:disable
|
|
|
|
|
disable: $(TIMER) $(UNIT)
|
|
|
|
|
systemctl stop ${TIMER}
|
|
|
|
|
systemctl disable ${TIMER}
|
|
|
|
|
systemctl disable ${UNIT}
|
|
|
|
|
|
|
|
|
|
.PHONY:uninstall
|
|
|
|
|
uninstall: disable $(TIMER) $(UNIT)
|
|
|
|
|
rm -f \
|
|
|
|
|
$(SERVICE_DIR)/$(TIMER) \
|
|
|
|
|
$(SERVICE_DIR)/$(UNIT)
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
|
|
.PHONY:reinstall
|
|
|
|
|
reinstall: uninstall install
|
|
|
|
|
|