MadcapJake / fly-notify

Native notifications for Fly.
Other
7 stars 1 forks source link

Icons not showing up, issue related to devicons dependency, + Octicon support #4

Open rogeruiz opened 9 years ago

rogeruiz commented 9 years ago

From what I see here, the devicons function is culling the file from the !SVG directory in the devicons. I tested using terminal-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 the devicons SVG files to 450x450 PNGs using ImageMagick's convert, 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! ✌️

MadcapJake commented 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.

rogeruiz commented 9 years ago

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.

MadcapJake commented 9 years ago

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:

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.