Skip to content

Commit

Permalink
osu-mime: rename icons to "osu!mime"
Browse files Browse the repository at this point in the history
  • Loading branch information
dixslyf committed Feb 12, 2024
1 parent 479f15b commit 372526e
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 6 deletions.
17 changes: 12 additions & 5 deletions pkgs/osu-mime/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ in
url = "https://raw.githubusercontent.com/ppy/osu-web/${osu-web-rev}/public/images/layout/osu-logo-white.svg";
sha256 = "XvYBIGyvTTfMAozMP9gmr3uYEJaMcvMaIzwO7ZILrkY=";
})
(fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/osu-file-extensions.xml?h=osu-mime&id=${osu-mime-spec-rev}";
sha256 = "MgQNW0RpnEYTC0ym6wB8cA6a8GCED1igsjOtHPXNZVo=";
(stdenvNoCC.mkDerivation {
name = "osu-file-extensions";
src = fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/osu-file-extensions.xml?h=osu-mime&id=${osu-mime-spec-rev}";
sha256 = "MgQNW0RpnEYTC0ym6wB8cA6a8GCED1igsjOtHPXNZVo=";
};
unpackPhase = "cp $src ./osu-file-extensions.xml";
installPhase = "cp osu-file-extensions.xml $out";
# Patch to change the icon names from "osu!" to "osu!mime".
patches = [./osu-mime-change-icon.patch];
})
];

Expand Down Expand Up @@ -51,10 +58,10 @@ in
# Generate icon
rsvg-convert -w "$size" -h "$size" -f png -o "osu-logo-triangles.png" "''${srcs[0]}"
rsvg-convert -w "$size" -h "$size" -f png -o "osu-logo-white.png" "''${srcs[1]}"
convert -composite "osu-logo-triangles.png" "osu-logo-white.png" -gravity center 'osu!.png'
convert -composite "osu-logo-triangles.png" "osu-logo-white.png" -gravity center 'osu!mime.png'
mkdir -p "$icon_dir"
mv 'osu!.png' "$icon_dir"
mv 'osu!mime.png' "$icon_dir"
done
cp "''${srcs[2]}" "$mime_dir/osu.xml"
Expand Down
48 changes: 48 additions & 0 deletions pkgs/osu-mime/osu-mime-change-icon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/osu-file-extensions.xml b/osu-file-extensions.xml
index 9270d15..43add11 100644
--- a/osu-file-extensions.xml
+++ b/osu-file-extensions.xml
@@ -6,37 +6,37 @@
<magic priority="60">
<match type="string" offset="0" value="osu file format v"/>
</magic>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! beatmap</comment>
</mime-type>
<mime-type type="application/x-osu-storyboard">
<glob pattern="*.osb"/>
<sub-class-of type="text/plain"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! storyboard</comment>
</mime-type>
<mime-type type="application/x-osu-skin-archive">
<glob pattern="*.osk"/>
<sub-class-of type="application/zip"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! skin archive</comment>
</mime-type>
<mime-type type="application/x-osu-replay">
<glob pattern="*.osr"/>
<sub-class-of type="application/octet-stream"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! replay</comment>
</mime-type>
<mime-type type="application/x-osu-beatmap-archive">
<glob pattern="*.osz"/>
<sub-class-of type="application/zip"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! beatmap archive</comment>
</mime-type>
<mime-type type="application/x-osu-beatmap-archive">
<glob pattern="*.osz2"/>
<sub-class-of type="application/zip"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! beatmap archive</comment>
</mime-type>
</mime-info>
2 changes: 1 addition & 1 deletion pkgs/osu-stable/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
desktopItems = makeDesktopItem {
name = pname;
exec = "${script}/bin/${pname} %U";
icon = "osu!"; # icon comes from the osu-mime package
icon = "osu!mime"; # icon comes from the osu-mime package
comment = "Rhythm is just a *click* away";
desktopName = "osu!stable";
categories = ["Game"];
Expand Down

0 comments on commit 372526e

Please sign in to comment.