SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) include ../lib/shared.mk TARGET := $(XDG_DIR)/rofi DESKTOP_SRC := $(SRC)/desktop DESKTOP_TARGET := ~/.local/share/applications install: | init update init: ifeq ($(call cmd_exist,rofi), true) $(info => Setting up rofi) $(mk_link) $(SRC) $(TARGET) $(MAKE) -C $(SRC) desktop_init else $(report) warn "rofi not installed. Skipping." endif update: remove: $(info => Remvoing rofi) $(rm_link) $(TARGET) $(MAKE) -C $(SRC) desktop_remove desktop_init: ifeq ($(shell [ -e $(DESKTOP_TARGET) ] $(return_val_truthy) ), true) $(info ==> Setting up desktop shortcuts.) cd $(DESKTOP_SRC) ; \ for i in *.desktop; do ; \ $(mk_link) $(DESKTOP_SRC)/$$i $(DESKTOP_TARGET)/$$i ; \ done else $(report) warn "$(DESKTOP_TARGET) does not exist. Skipping." endif desktop_remove: ifeq ($(shell [ -e $(DESKTOP_TARGET) ] $(return_val_truthy) ), true) $(info ==> removing rofi desktop entries.) cd $(DESKTOP_SRC) ; \ for i in *.desktop; do ; \ $(rm_link) $(DESKTOP_TARGET)/$$i ; \ done endif