Install desktop file

earne/nixos
earnest ma 2021-08-23 21:28:41 -04:00
parent 1f5454956d
commit 62f455baf8
Signed by: earnest ma
GPG Key ID: A343F43342EB6E2A
2 changed files with 18 additions and 3 deletions

View File

@ -3,8 +3,10 @@ PREFIX = /usr/local
PROFILE ?= release PROFILE ?= release
BINARY_PATH = target/$(PROFILE)/libspotifyadblock.so BINARY_PATH = target/$(PROFILE)/libspotifyadblock.so
CONFIG_PATH = config.toml CONFIG_PATH = config.toml
DESKTOP_PATH = spotify-adblock.desktop
BINARY_TARGET = $(DESTDIR)$(PREFIX)/lib/$(NAME).so BINARY_TARGET = $(DESTDIR)$(PREFIX)/lib/$(NAME).so
CONFIG_TARGET = $(DESTDIR)/etc/$(NAME)/config.toml CONFIG_TARGET = $(DESTDIR)/etc/$(NAME)/config.toml
DESKTOP_TARGET = $(DESTDIR)$(PREFIX)/share/applications/$(NAME).desktop
.PHONY: all .PHONY: all
all: $(BINARY_PATH) all: $(BINARY_PATH)
@ -22,11 +24,13 @@ clean:
rm -rf target rm -rf target
.PHONY: install .PHONY: install
install: $(BINARY_PATH) $(CONFIG_PATH) install: $(BINARY_PATH) $(CONFIG_PATH) $(DESKTOP_PATH)
install -D --mode=644 --strip $(BINARY_PATH) $(BINARY_TARGET) install -D --mode=644 --strip $(BINARY_PATH) $(BINARY_TARGET)
install -D --mode=644 $(CONFIG_PATH) $(CONFIG_TARGET) install -D --mode=644 $(CONFIG_PATH) $(CONFIG_TARGET)
install -D --mode=644 $(DESKTOP_PATH) $(DESKTOP_TARGET)
.PHONY: uninstall .PHONY: uninstall
uninstall: uninstall:
rm -f $(BINARY_TARGET) rm -f $(BINARY_TARGET)
rm -f $(CONFIG_TARGET) rm -f $(CONFIG_TARGET)
rm -f $(DESKTOP_TARGET)

11
spotify-adblock.desktop Normal file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=Spotify Adblocked
GenericName=Music Player
Icon=spotify-client
TryExec=spotify
Exec=env LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify %U
Terminal=false
MimeType=x-scheme-handler/spotify;
Categories=Audio;Music;Player;AudioVideo;
StartupWMClass=spotify