diff --git a/i3/Makefile b/i3/Makefile index 1a26d77..948edc7 100644 --- a/i3/Makefile +++ b/i3/Makefile @@ -1,3 +1,5 @@ +include *.mk + REQUIRED_BINS=\ /usr/bin/i3 \ /usr/bin/i3blocks \ @@ -44,8 +46,8 @@ OUT=$(I3_CONFIG_OUT) $(DUNST_CONFIG_OUT) .PHONY: clean_install clean_install: clean install -clean: clean_i3 clean_dunst clean_compton clean_i3blocks clean_bins -install: $(REQUIRED_BINS) install_i3 install_compton install_i3blocks install_bins clean_dunst +clean: clean_i3 clean_dunst clean_compton clean_i3blocks clean_bins clean_playerctl +install: $(REQUIRED_BINS) install_i3 install_compton install_i3blocks install_bins clean_dunst install_playerctl $(REQUIRED_BINS): $(ROOT_APT) install $(PACKAGES) diff --git a/i3/playerctl.mk b/i3/playerctl.mk new file mode 100644 index 0000000..b4fd0c8 --- /dev/null +++ b/i3/playerctl.mk @@ -0,0 +1,22 @@ +PACKAGE=playerctl +GITHUB_VERSION=2.0.2 +GITHUB_URL=https://github.com/altdesktop/playerctl/releases/download/v$(GITHUB_VERSION)/playerctl-$(GITHUB_VERSION)_amd64.deb + +BIN=/usr/bin/playerctl +ROOT_APT=sudo aptitude + +install_playerctl: $(BIN) + +$(BIN): +ifeq ($(shell aptitude search $PACKAGE 2&> /dev/null; echo $?), 0) + $(ROOT_APT) install $(PACKAGE) +else + $(eval TMP = $(shell mktemp -d)) + curl -fsSL $(GITHUB_URL) -o $(TMP)/playerctl.deb + chmod -R a+rx $(TMP) + sudo apt install $(TMP)/playerctl.deb + rm -rf $(TMP) +endif + +clean_playerctl: + $(ROOT_APT) remove $(PACKAGE)