# -*- mode: makefile-gmake; -*-
SRC := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

include ../lib/shared.mk
TARGET :=  $(XDG_DIR)/sway

install: | init update

init:
	if (( ! $$+commands[sway] )) ; then
		$(report) debug "Sway not installed. Skipping."
	else
		$(report) header "Setting up sway"
		$(mk_link) $(SRC) $(TARGET)
	fi

update:
	if (( ! $$+commands[swaymsg] )) ; then
		$(report) debug "swaymsg not installed. Skipping."
	else
		$(report) header "Reloading sway"
		swaymsg reload ; $(report) "sway reload"
	fi

remove:
	$(report) header "Removing sway"
	$(rm_link) $(TARGET)