Files
monitor-lets-go/Makefile
T
Maksim Totmin ac82e3e82a feat: restore portable layout on shutdown and before suspend
Add WriteConfig/Prepare backend methods (real for Hyprland, no-op for
Sway), -apply/-prepare/-no-reload CLI flags, ExecStartPre cleanup and
suspend systemd hooks so a stale docked config can never leave the
built-in display disabled after resume.
2026-08-02 12:50:37 +07:00

60 lines
1.8 KiB
Makefile

# monitor-lets-go Makefile
BIN := monitor-lets-go
SRCDIR := ./cmd/monitor-lets-go
INSTALL ?= install
.DEFAULT_GOAL := build
# ---------------------------------------------------------------------------
# Build
# ---------------------------------------------------------------------------
build:
go build -ldflags="-s -w" -o $(BIN) $(SRCDIR)
# build with race detector for development
build-race:
go build -race -o $(BIN) $(SRCDIR)
# ---------------------------------------------------------------------------
# Install
# ---------------------------------------------------------------------------
install: build
$(INSTALL) -Dm755 $(BIN) $(HOME)/.local/bin/$(BIN)
systemd-install:
$(INSTALL) -Dm644 contrib/monitor-lets-go.service $(HOME)/.config/systemd/user/monitor-lets-go.service
systemctl --user daemon-reload
systemctl --user enable --now monitor-lets-go
# Install a system-sleep hook (requires root). This writes the portable
# monitor config to disk before suspend so the compositor never loads a
# stale docked config on resume. Without this hook, the daemon's polling
# mechanism catches the change within seconds after resume.
system-sleep-install:
sudo $(INSTALL) -Dm755 contrib/monitor-lets-go-system-sleep /usr/lib/systemd/system-sleep/monitor-lets-go
systemd-status:
systemctl --user status monitor-lets-go
systemd-logs:
journalctl --user -u monitor-lets-go -f
# ---------------------------------------------------------------------------
# Quality
# ---------------------------------------------------------------------------
lint:
go vet ./...
test:
go test -v -race ./...
# ---------------------------------------------------------------------------
# Clean
# ---------------------------------------------------------------------------
clean:
rm -f $(BIN)