diff --git a/Makefile b/Makefile index be1ca27a..d58763b9 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ install-shell: @mkdir -p $(SHELL_INSTALL_DIR) @cp -r $(SHELL_DIR)/* $(SHELL_INSTALL_DIR)/ @rm -rf $(SHELL_INSTALL_DIR)/.git* $(SHELL_INSTALL_DIR)/.github + @$(MAKE) --no-print-directory -C $(CORE_DIR) print-version > $(SHELL_INSTALL_DIR)/VERSION @echo "Shell files installed" install-completions: @@ -80,8 +81,7 @@ install: build install-bin install-shell install-completions install-systemd ins @echo "" @echo "Installation complete!" @echo "" - @echo "To enable and start DMS:" - @echo " systemctl --user enable --now dms" + @echo "=== The DMS Team! ===" # Uninstallation targets uninstall-bin: diff --git a/core/Makefile b/core/Makefile index 119fd79e..1add9c16 100644 --- a/core/Makefile +++ b/core/Makefile @@ -10,16 +10,19 @@ GO=go GOFLAGS=-ldflags="-s -w" # Version and build info -VERSION=$(shell git describe --tags --always 2>/dev/null || echo "dev") -BUILD_TIME=$(shell date -u '+%Y-%m-%d_%H:%M:%S') -COMMIT=$(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") +BASE_VERSION=$(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0") +COMMIT_COUNT=$(shell git rev-list --count HEAD 2>/dev/null || echo "0") +COMMIT_HASH=$(shell git rev-parse --short=8 HEAD 2>/dev/null || echo "unknown") +VERSION?=$(BASE_VERSION)+git$(COMMIT_COUNT).$(COMMIT_HASH) +BUILD_TIME?=$(shell date -u '+%Y-%m-%d_%H:%M:%S') +COMMIT?=$(COMMIT_HASH) BUILD_LDFLAGS=-ldflags='-s -w -X main.Version=$(VERSION) -X main.buildTime=$(BUILD_TIME) -X main.commit=$(COMMIT)' # Architecture to build for dist target (amd64, arm64, or all) ARCH ?= all -.PHONY: all build dankinstall dist clean install install-all install-dankinstall uninstall uninstall-all uninstall-dankinstall install-config uninstall-config test fmt vet deps help +.PHONY: all build dankinstall dist clean install install-all install-dankinstall uninstall uninstall-all uninstall-dankinstall install-config uninstall-config test fmt vet deps print-version help # Default target all: build @@ -132,6 +135,9 @@ version: check-go @echo "Build Time: $(BUILD_TIME)" @echo "Commit: $(COMMIT)" +print-version: + @echo "$(VERSION)" + help: @echo "Available targets:" @echo " all - Build the main binary (dms) (default)" diff --git a/quickshell/Modules/Settings/AboutTab.qml b/quickshell/Modules/Settings/AboutTab.qml index bc11a913..df3b7722 100644 --- a/quickshell/Modules/Settings/AboutTab.qml +++ b/quickshell/Modules/Settings/AboutTab.qml @@ -162,7 +162,19 @@ Item { } StyledText { - text: SystemUpdateService.shellVersion ? `dms ${SystemUpdateService.shellVersion}` : "dms" + text: { + if (!SystemUpdateService.shellVersion) return "dms"; + + // Git versioning to show ex: "dms v0.6.2-2223" + let version = SystemUpdateService.shellVersion; + let match = version.match(/^([\d.]+)\+git(\d+)\./); + + if (match) { + return `dms v${match[1]}-${match[2]}`; + } + + return `dms ${version}`; + } font.pixelSize: Theme.fontSizeXLarge font.weight: Font.Bold color: Theme.surfaceText