diff --git a/FreeDesktop/sameboy.xml b/FreeDesktop/sameboy.xml
new file mode 100644
index 0000000..6c0df37
--- /dev/null
+++ b/FreeDesktop/sameboy.xml
@@ -0,0 +1,17 @@
+
+
+
+ Game Boy ROM
+
+
+
+
+
+
+ Game Boy Color ROM
+
+
+
+
+
+
diff --git a/FreeDesktop/x-gameboy-color-rom.xml b/FreeDesktop/x-gameboy-color-rom.xml
new file mode 100644
index 0000000..0a42874
--- /dev/null
+++ b/FreeDesktop/x-gameboy-color-rom.xml
@@ -0,0 +1,10 @@
+
+
+
+ YOUR MOM
+
+
+
+
+
+
diff --git a/Makefile b/Makefile
index 5335f33..d065750 100644
--- a/Makefile
+++ b/Makefile
@@ -434,23 +434,33 @@ libretro:
# If you somehow find a reasonable way to make associate an icon with an extension in this dumpster
# fire of a desktop environment, open an issue or a pull request
ifneq ($(CAN_INSTALL),)
-ICON_NAMES := apps/sameboy
+ICON_NAMES := apps/sameboy mimetypes/x-gameboy-rom mimetypes/x-gameboy-color-rom
ICON_SIZES := 16x16 32x32 64x64 128x128 256x256 512x512
ICONS := $(foreach name,$(ICON_NAMES), $(foreach size,$(ICON_SIZES),$(DESTDIR)$(PREFIX)/share/icons/hicolor/$(size)/$(name).png))
-install: sdl $(DESTDIR)$(PREFIX)/share/applications/sameboy.desktop $(ICONS)(PREFIX)/share/mime/application/x-gameboy-color-rom.xml
+install: sdl $(DESTDIR)$(PREFIX)/share/applications/sameboy.desktop $(ICONS) FreeDesktop/sameboy.xml
mkdir -p $(DESTDIR)$(PREFIX)/share/sameboy/
cp -rf $(BIN)/SDL/* $(DESTDIR)$(PREFIX)/share/sameboy/
mv $(DESTDIR)$(PREFIX)/share/sameboy/sameboy $(DESTDIR)$(PREFIX)/bin/sameboy
ifeq ($(DESTDIR),)
+ -update-mime-database -n $(PREFIX)/mime
+ -xdg-desktop-menu install --mode system FreeDesktop/sameboy.xml
-xdg-icon-resource forceupdate --mode system
-xdg-desktop-menu forceupdate --mode system
+ -su $(SUDO_USER) -c "xdg-desktop-menu forceupdate --mode system"
endif
$(DESTDIR)$(PREFIX)/share/icons/hicolor/%/apps/sameboy.png: FreeDesktop/AppIcon/%.png
-@$(MKDIR) -p $(dir $@)
cp -f $^ $@
-
+$(DESTDIR)$(PREFIX)/share/icons/hicolor/%/mimetypes/x-gameboy-rom.png: FreeDesktop/Cartridge/%.png
+ -@$(MKDIR) -p $(dir $@)
+ cp -f $^ $@
+
+$(DESTDIR)$(PREFIX)/share/icons/hicolor/%/mimetypes/x-gameboy-color-rom.png: FreeDesktop/ColorCartridge/%.png
+ -@$(MKDIR) -p $(dir $@)
+ cp -f $^ $@
+
$(DESTDIR)$(PREFIX)/share/applications/sameboy.desktop: FreeDesktop/sameboy.desktop
-@$(MKDIR) -p $(dir $@)
cp -f $^ $@