-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (22 loc) · 974 Bytes
/
Makefile
File metadata and controls
26 lines (22 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.PHONY: install uninstall
REPO_DIR := $(abspath $(CURDIR))
SYSTEMD_USER_DIR := $(HOME)/.config/systemd/user
SERVICE_NAME := gcal-notifier
install:
@echo "Installing $(SERVICE_NAME) systemd user units..."
@mkdir -p $(SYSTEMD_USER_DIR)
# Replace the WorkingDirectory line with the actual repo path
@sed "s|<WORKING_DIRECTORY>|$(REPO_DIR)|" \
systemd/$(SERVICE_NAME).service > $(SYSTEMD_USER_DIR)/$(SERVICE_NAME).service
# Copy timer file as-is
@cp systemd/$(SERVICE_NAME).timer $(SYSTEMD_USER_DIR)/
# Reload and enable
@systemctl --user daemon-reload
@systemctl --user enable --now $(SERVICE_NAME).timer
@echo "✅ Installed and started $(SERVICE_NAME).timer"
uninstall:
@echo "Removing $(SERVICE_NAME) systemd user units..."
@systemctl --user disable --now $(SERVICE_NAME).timer || true
@rm -f $(SYSTEMD_USER_DIR)/$(SERVICE_NAME).service $(SYSTEMD_USER_DIR)/$(SERVICE_NAME).timer
@systemctl --user daemon-reload
@echo "✅ Removed $(SERVICE_NAME) units"