You can use an app like Platypus.
Platypus is a developer tool for creating application wrappers around scripts. In other words, it creates Mac OS X applications that execute a script which is bundled within the application. Command line scripts can thus be run transparently from the graphical window environment, integrating seamlessly with the user interface.
Building off of cksum's answer, if you can get ahold of the mask, overlay and shadow images at high enough resolution (@2x
images are still only about 140px square,) and you're comfortable with the command line/shell scripting, you can use ImageMagick, a nice command line image processor, to actually mask and compose the icon.
Once you've installed ImageMagick (They have installation instructions here) you should be able to process your image with the mask, overlay and shadow:
convert YourImage.png overlay.png -composite YourImage_overlay.png
convert YourImage_overlay.png mask.png -alpha off -compose CopyOpacity -composite YourImage2.png
convert shadow.png YourImage2.png -composite YourImage_largest.png
convert YourImage_largest.png -geometry 512 Icon512.png
convert YourImage_largest.png -geometry 256 Icon256.png
This assumes that Your_Image is large and square (1024x1024) and that the mask.png, overlay.png and shadow.png are the same size.
Ideally, you wouldn't just resample the largest icon down to get the smaller versions, but you could instead use normal icon making software (e.g. IconBuilder) and use it to make YourImage at each size, then do the above to each one individually.
As for getting the mask, overlay and shadow images to the correct size, my best recommendation would be to enlarge them and then build them back (i.e. drawing a new roundrect and gradients) at full resolution with Photoshop or GIMP.
Once you have the image at each resolution, you can throw it into Apples own Icon Composer (in the iOS/Mac SDK) to create the .icns
It's not the easiest solution, but it provides you the flexibility of specifying the exact mask and other effects and of the command line.
Best Answer
Not really. What you seek isn't something shells try to support. Shells are really about open access to a system, not hidden access.
Some shell commands and functions will ignore directories and files that are prefixed with a
.
by default. For example,ls
does this:But the
.
-prefixed file in the above example isn't considered "hidden". Just "not displayed in the default view". Any sort of hiding like this would necessitate you rename your files and folders so they're prefixed with a.
and then they'd also disappear by default from Finder.As you can see from answers on other SE sub-sites (1, 2, 3), the prefix-with-a-dot is really the only consistent way to keep a file or folder out of the normal view of most shell functions and commands.