Open rogeruiz opened 9 years ago
Yeah the pngs were blurry for me but svgs worked OOTB for me. I don't follow what you mean by terminal-notify
. I wonder if svgs working is an OS-dependent thing.
Hmmmm. Sounds like it.
I'm on Mac OS X 10.10.3. So maybe it's just on a Mac that they don't show up properly.
Sorry I didn't link to this earlier, terminal-notifier
is the module that node-notifier
will use on Mac OS X 10.8+.
We could leverage the notifiers here to set up some custom options. Here's a look at the docs – you'll need to scroll down a bit. That way we don't even serve the SVGs to Mac or any other platforms that don't support them.
As for the conversion, here's the sketch of what I wrote up to convert everything from SVG to PNG.
#!/bin/sh
cd ./\!SVG/
for file in ./*.svg
do
if [ -f "$file" ]; then
name=$(echo $file | grep -o '[^\.\/].\+[^\.svg]')
convert -density 4000 -background transparent "$file" -resize 450x450 ../\!PNG/"${name}.png"
fi
done
I'd hate to add ImageMagick as a project dependency, so I could just do this locally and check it in for now or make it a dev dependency and include a script. I don't see these icons updating too often, but I would hate to see Issues open up here for icons that were added to the devicons
project. ¯(ツ)/¯
As for the Octicons. Was there anything in particular that you were planning for that? They're all there in the svg/
directory so converting them like the devicons would be a snap.
I'll look into the SVG/PNG issues across platforms and see what I can do to test a bit more using the notifier's options for Mac OS X 10.8+ available in node-notifiers.
Yeah I looked through node-notifer
and it makes no mention of whether svgs would work. Looking over terminal-notifier
, I can't find anything either but I don't really have any experience with Objective C. I can't decide what the best route is for this plugin:
node-notifer
. This might work but would add some os-specific code to index.js
which I can't debug (Linux user). However, this might mean we could avoid doing any image conversion.icon
string, check the OS, if OSX
it would convert to png and serve that, otherwise it just serves SVG. This could be cleaner or it could just be unecessary complexity.postinstall
. This way, npm could download the latest devicons/octicons and gather and convert into fly-notify
's dir. Users will always get the latest version of icons and index.js
will stay really concise.It would be helpful if we had a Windows user too. If it doesn't work on Windows with SVG, then it might make more sense to do a more heavy-handed approach.
From what I see here, the
devicons
function is culling the file from the!SVG
directory in thedevicons
. I tested usingterminal-notify
with SVG icons and had no luck. I also tried the!PNG
directory instead, and the icons were very blurry on my display. I wrote up a script that'll convert thedevicons
SVG files to450x450
PNGs using ImageMagick'sconvert
, but since it's a dependency, I wasn't sure of the best way to include this in the project.I'd also like to add the Octicon's mentioned in the Readme too. That'd be rad! ✌️