Skip to content

Commit

Permalink
Add app icon.
Browse files Browse the repository at this point in the history
  • Loading branch information
ershov committed Jun 7, 2023
1 parent 7fa63ed commit a5e013f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ app: $(BINARIES)
install_name_tool -add_rpath "@loader_path" InputMethodHinter.app/Contents/MacOS/InputMethodHinter-console
cp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/macosx/* InputMethodHinter.app/Contents/MacOS/
cp /Library/Developer/CommandLineTools/usr/lib/swift-5.0/macosx/* InputMethodHinter.app/Contents/MacOS/
./make-icon.sh
xattr -cr .
codesign -fs codesign --deep InputMethodHinter.app/Contents/MacOS/InputMethodHinter-console # have to do it after adding rpath
codesign -fs codesign InputMethodHinter.app # --deep?
Expand All @@ -51,6 +52,7 @@ clean:
InputMethodHinter-{console,launch}--* \
InputMethodHinter.app \
.ccls-cache \
icon.iconset \
#

.PHONY: all clean app zip
31 changes: 31 additions & 0 deletions logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions make-icon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

rm -rf icon.iconset || exit 1
mkdir icon.iconset || exit 1
mkdir -p InputMethodHinter.app/Contents/Resources || exit 1
perl -E '
for (qw/16 32 48 128 256 512/) {
system qq{sips -s format png -z $_ $_ logo.svg -o icon.iconset/icon_${_}x${_}.png};
$x = $_ * 2;
system qq{sips -s format png -z $x $x logo.svg -o icon.iconset/icon_${_}x${_}\@2x.png};
}
' || exit 1
iconutil -c icns icon.iconset -o InputMethodHinter.app/Contents/Resources/InputMethodHinter.icns || exit 1
rm -rf icon.iconset

0 comments on commit a5e013f

Please sign in to comment.