Skip to content

Commit

Permalink
Merge pull request #8 from jfeist/add-osx-icon
Browse files Browse the repository at this point in the history
added icon to OSX app, which is also registered for .ipynb files
  • Loading branch information
takluyver committed Dec 4, 2014
2 parents 1c05b51 + e2fdbe8 commit 15829c1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion osx-install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set -e

#iconutil -c icns nbopen.iconset
./osx-make-iconset.sh

python3 setup.py install
python3 setup.py py2app
Expand Down
15 changes: 15 additions & 0 deletions osx-make-iconset.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

echo "generating .icns file for mac app..."
echo "NOTE: this will produce one warning message, because there is no"
echo " 1024x1024 icon that could be used to for the 'retina' 512x512 icon"

iconsetdir=nbopen.iconset
mkdir -p ${iconsetdir}
for size in 16 32 128 256 512; do
s2x=$((size*2))
cp icons/ipynb_icon_${size}x${size}.png ${iconsetdir}/icon_${size}x${size}.png
cp icons/ipynb_icon_${s2x}x${s2x}.png ${iconsetdir}/icon_${size}x${size}@2x.png
done
iconutil -c icns ${iconsetdir}
rm -r ${iconsetdir}
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def main(argv=None):
CFBundleDevelopmentRegion='English',
CFBundleDocumentTypes=[dict(CFBundleTypeExtensions=["ipynb"],
CFBundleTypeName="IPython Notebook",
CFBundleTypeIconFile="nbopen",
CFBundleTypeRole="Editor"),
]
)
Expand All @@ -27,7 +28,8 @@ def main(argv=None):
'argv_emulation': True,
'packages': ['nbopen'],
'alias': True,
'plist': Plist
'plist': Plist,
'iconfile': 'nbopen.icns'
}},
setup_requires=['py2app']
)
Expand Down

0 comments on commit 15829c1

Please sign in to comment.