diff --git a/.gitignore b/.gitignore
index 7f5ce74..84db14b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
.gdb_history
alsa-scarlett-gui
alsa-scarlett-gui-resources.c
+vu.b4.alsa-scarlett-gui.desktop
diff --git a/USAGE.md b/USAGE.md
index 4af3f19..9395176 100644
--- a/USAGE.md
+++ b/USAGE.md
@@ -71,6 +71,19 @@ To run:
./alsa-scarlett-gui
```
+You can install it into `/usr/local` (binary, desktop file, and icon)
+with:
+
+```
+sudo make install
+```
+
+And uninstall with:
+
+```
+sudo make uninstall
+```
+
## No interface connected
If no interface is detected (usually because there isn’t one
diff --git a/src/Makefile b/src/Makefile
index b0173d8..cf10135 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -32,13 +32,14 @@ XML_OBJ := $(patsubst %.xml,%.c,$(XML_SRC))
SRCS := $(sort $(wildcard *.c) $(XML_OBJ))
OBJS := $(patsubst %.c,%.o,$(SRCS))
TARGET := alsa-scarlett-gui
+DESKTOP_FILE := vu.b4.$(TARGET).desktop
GLIB_COMPILE_RESOURCES := $(shell $(PKG_CONFIG) --variable=glib_compile_resources gio-2.0)
-all: $(TARGET)
+all: $(TARGET) $(DESKTOP_FILE)
clean:
- rm -f $(TARGET) $(OBJS) $(XML_OBJ)
+ rm -f $(TARGET) $(DESKTOP_FILE) $(OBJS) $(XML_OBJ)
depclean:
rm -rf $(DEPDIR)
@@ -52,3 +53,28 @@ include $(wildcard $(DEPFILES))
$(TARGET): $(OBJS)
cc ${LDFLAGS} -lm -o $(TARGET) $(OBJS)
+
+ifeq ($(PREFIX),)
+ PREFIX := /usr/local
+endif
+
+BINDIR := $(DESTDIR)$(PREFIX)/bin
+ICONTOP := $(DESTDIR)$(PREFIX)/share/icons/hicolor
+ICONDIR := $(ICONTOP)/256x256/apps
+DESKTOPDIR := $(DESTDIR)$(PREFIX)/share/applications
+
+$(DESKTOP_FILE): $(DESKTOP_FILE).template
+ sed 's_PREFIX_$(PREFIX)_' < $< > $@
+
+install: all
+ install -d $(BINDIR)
+ install -m 755 $(TARGET) $(BINDIR)
+ install -d $(ICONDIR)
+ install -m 644 img/$(TARGET).png $(ICONDIR)
+ install -d $(DESKTOPDIR)
+ install -m 644 $(DESKTOP_FILE) $(DESKTOPDIR)
+
+uninstall:
+ rm -f $(BINDIR)/$(TARGET)
+ rm -f $(ICONDIR)/$(TARGET).png
+ rm -f $(DESKTOPDIR)/$(DESKTOP_FILE)
diff --git a/src/alsa-scarlett-gui-resources.xml b/src/alsa-scarlett-gui-resources.xml
index 23df2ce..117f1d6 100644
--- a/src/alsa-scarlett-gui-resources.xml
+++ b/src/alsa-scarlett-gui-resources.xml
@@ -4,12 +4,6 @@
img/alsa-scarlett-gui-logo.png
img/socket.svg
-
- img/alsa-scarlett-gui-48.png
-
-
- img/alsa-scarlett-gui-256.png
-
alsa-scarlett-gui.css
diff --git a/src/img/alsa-scarlett-gui-48.png b/src/img/alsa-scarlett-gui-48.png
deleted file mode 100644
index e885630..0000000
Binary files a/src/img/alsa-scarlett-gui-48.png and /dev/null differ
diff --git a/src/img/alsa-scarlett-gui-256.png b/src/img/alsa-scarlett-gui.png
similarity index 100%
rename from src/img/alsa-scarlett-gui-256.png
rename to src/img/alsa-scarlett-gui.png
diff --git a/src/main.c b/src/main.c
index 4c979a4..c206dd1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,7 +30,6 @@ static void load_css(void) {
// gtk init
static void startup(GtkApplication *app, gpointer user_data) {
- gtk_window_set_default_icon_name("alsa-scarlett-gui");
gtk_application_set_menubar(app, G_MENU_MODEL(create_app_menu(app)));
alsa_inotify_init();
diff --git a/src/vu.b4.alsa-scarlett-gui.desktop.template b/src/vu.b4.alsa-scarlett-gui.desktop.template
new file mode 100644
index 0000000..5aeb414
--- /dev/null
+++ b/src/vu.b4.alsa-scarlett-gui.desktop.template
@@ -0,0 +1,9 @@
+[Desktop Entry]
+
+Encoding=UTF-8
+Value=1.5
+Type=Application
+Name=ALSA Scarlett Gen 2/3 Control Panel
+Icon=alsa-scarlett-gui
+Exec=PREFIX/bin/alsa-scarlett-gui
+Categories=GTK;AudioVideo;Audio;Mixer;