diff --git a/Makefile b/Makefile index 3427e5a..58dd2fb 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ DO := ./build/utils.sh SET_CONFIG := $(DO) set-config DESTDIR ?= / +MAYBE_SUDO := '' define colorecho @tput setaf 118 || true @@ -16,6 +17,10 @@ decorated := True stays_on_top := False endif +ifeq ($(DESTDIR),/) +MAYBE_SUDO := sudo +endif + # Configuration: Use values from command line if provided, default values otherwise. at_spi_service ?= True @@ -59,7 +64,7 @@ clean: $(DO) clean install: build - sudo $(DO) install $(DESTDIR) + $(MAYBE_SUDO) $(DO) install $(DESTDIR) $(call colorecho, SUCCESS!)