• Stars
    star
    1,142
  • Rank 40,813 (Top 0.9 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 13 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ“ Generate pixel-perfect macOS folder icons in the native style.

folderify

mask.png + folder = folderified!

Generate pixel-perfect macOS folder icons in the native style.

  • Automatically includes all icon sizes from 16x16 through 512x512@2x.
  • Light or dark mode (automatically selected by default).

Using folderify? Let me know or let me know and I'd love to feature some real-world uses!

Install

Install folderify using Homebrew:

brew install folderify

Homebrew install is recommended, and automatically installs folderify argument completions for your shell.

See below for other installation options.

Usage

Use a mask to assign an icon to a folder:

folderify mask.png /path/to/folder

Generate mask.icns and mask.iconset files:

folderify mask.png

By default, folderify uses your system's current light/dark mode. Use --color-scheme to override this:

folderify --color-scheme dark mask.png

Note:

  • There is currently no simple way to set an icon that will automatically switch between light and dark when you switch the entire OS. You can only assign one version of an icon to a folder.

Tips

For best results:

  • Use a .png mask.
  • Use a solid black design over a transparent background.
  • Make sure the corner pixels of the mask image are transparent. They are used for empty margins.
  • Pass the --no-trim flag and use a mask:
    • with a height of 384px,
    • with a width that is a multiple of 128px (up to 768px),
    • using a 16px grid.
    • Each 64x64 tile will exactly align with 1 pixel at the smallest icon size.

OS X (macOS 10)

Folder styles from OS X / macOS 10 are no longer supported by folderify as of v3:

  • Leopard-style (OS X 10.5 to OS X 10.9)
  • Yosemite-style (OS X 10.10 to macOS 10.15)

To generate these, please use folderify v2. For example:

pip3 install folderify
python3 -m folderify --macOS 10.5 path/to/icon.png

Other installation options

If you don't have Homebrew but you already have ImageMagick (the convert binary) on your system, you can use the following:

Install using Rust

cargo install folderify

From source

Or download the code directly:

git clone https://github.com/lgarron/folderify && cd folderify

# Run directly
cargo run -- --reveal examples/src/folder_outline.png .

# Install (assuming the `cargo` bin is in your path)
cargo install --path .
folderify --reveal examples/src/folder_outline.png .

The repository folder should now have a custom icon.

for file in examples/src/*.png; do cargo run -- $file; done
open examples/src/

You should see a bunch of new .iconset folders and .icns files that were automatically generated from the .png masks.

Dependencies

  • ImageMagick - for image processing (you should be able to run convert and identify on the commandline).
  • Included with macOS:
    • iconutil
  • sips, DeRez, Rez, SetFile (You need Xcode command line tools for some of these.)

Full options

Generate a native-style macOS folder icon from a mask file.

Usage: folderify [OPTIONS] [MASK] [TARGET]

Arguments:
  [MASK]
          Mask image file. For best results:
          - Use a .png mask.
          - Use a solid black design over a transparent background.
          - Make sure the corner pixels of the mask image are transparent. They are used for empty margins.
          - Make sure the non-transparent pixels span a height of 384px, using a 16px grid.
          If the height is 384px and the width is a multiple of 128px, each 64x64 tile will exactly align with 1 pixel at the smallest folder size.

  [TARGET]
          Target file or folder. If a target is specified, the resulting icon will
          be applied to the target file/folder. Else (unless --output-icns or
          --output-iconset is specified), a .iconset folder and .icns file will be
          created in the same folder as the mask (you can use "Get Info" in Finder
          to copy the icon from the .icns file).

Options:
      --output-icns <ICNS_FILE>
          Write the `.icns` file to the given path.
          (Will be written even if a target is also specified.)

      --output-iconset <ICONSET_FOLDER>
          Write the `.iconset` folder to the given path.
          (Will be written even if a target is also specified.)

  -r, --reveal
          Reveal either the target, `.icns`, or `.iconset` (in that order of preference) in Finder

      --macOS <MACOS_VERSION>
          Version of the macOS folder icon, e.g. "10.13". Defaults to the version currently running

      --color-scheme <COLOR_SCHEME>
          Color scheme β€” auto matches the current system value
          
          [default: auto]
          [possible values: auto, light, dark]

      --no-trim
          Don't trim margins from the mask.
          By default, transparent margins are trimmed from all 4 sides.

      --no-progress
          Don't show progress bars

  -v, --verbose
          Detailed output. Also sets `--no-progress`

      --completions <SHELL>
          Print completions for the given shell (instead of generating any icons).
          These can be loaded/stored permanently (e.g. when using Homebrew), but they can also be sourced directly, e.g.:
          
           folderify --completions fish | source # fish
           source <(folderify --completions zsh) # zsh
          
          [possible values: bash, elvish, fish, powershell, zsh]

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

Example

Example generated from the Apple logo: Icons from apple.iconset at resolutions from 16x16 up to 512x5125@2x, shown in Quicklook on macOS

More Repositories

1

clipboard-polyfill

πŸ“‹ Simple copying on the web, with maximum browser compatibility. (You probably don't need this anymore!)
TypeScript
897
star
2

crypto.graphics

crypto.graphics
HTML
24
star
3

chrome-devices-in-new-tab

πŸ“± Changes the new tab page in Chrome to be a list of tabs open on your other devices. Now with dark mode!
CSS
12
star
4

web-worker-compat

11
star
5

md2html

Yet another Markdown-to-HTML conversion tool
Shell
8
star
6

MagicWorker.js

πŸ’» Web workers in file:// pages for *all* browsers.
JavaScript
8
star
7

browser-security-reading-list

πŸ”’ Documents covering web security concepts, specifications, and findings.
8
star
8

barely-a-dev-server

A teeny-tiny alternative to bundlers that does just what you need (and nothing more), using `esbuild`.
JavaScript
6
star
9

inception-font

πŸ“ Font based inspired by the maze lettering used in some trailers and posters for the 2010 movie "Inception" by Christopher Nolan. (Using Inkscape and FontForge.)
CSS
6
star
10

main-branch

A tool to replace the main branch for your repository on GitHub safely and easily.
TypeScript
5
star
11

scripts

Some of my scripts.
Shell
5
star
12

ugly-http-extension

JavaScript
5
star
13

backup-airtable.py

Back up data from Airtable to JSON files.
Python
5
star
14

emoji2cat

😼
5
star
15

offline-bootstrap

Easy HTML5 Offline Caching
HTML
5
star
16

CubeExplorerVersion225

source code of Cube Explorer v2.25, Delphi
Component Pascal
4
star
17

servecert

πŸŒβ†”οΈπŸ”’ A small local HTTPS proxy using mkcert certificates. Please use with care.
Go
4
star
18

presentation-mode

Brings back presentation mode on OSX.
JavaScript
4
star
19

dance-hacking

Audio manipulation code to recast songs into beat patterns for different types of dance.
Python
4
star
20

unutil.h

A file to go alongside util.h - A collaboration between @lgarron and @bgwines
C
4
star
21

mak

`make`, but `mak` it shorter.
Rust
4
star
22

bpm-tap

A simple BPM calculation tool.
TypeScript
3
star
23

ios-lockscreensaver

πŸ’» My personal adaptations of the only OSX screensaver I actually like (iOS screensaver by bodysoulspirit).
3
star
24

bun-audit

A stopgap for the missing `bun audit` command.
Makefile
2
star
25

ksolve-js-svg

ksolve definition parser, state simulator, and SVG drawing, in JS.
JavaScript
2
star
26

cubing-rust-wasm

Learning to publish Rust for the web.
JavaScript
2
star
27

alg.cubing.net-stats

TypeScript
2
star
28

homebrew-lgarron

My personal Homebrew tap.
Ruby
2
star
29

unsafe-browser-aes

TypeScript
2
star
30

ios-background

iOS column background
2
star
31

webauthn-json-example

TypeScript
2
star
32

crypto-class

Materials from teaching cryptography to high school students at Stanford (SPCS, formerly EPGY).
TeX
2
star
33

minimal-html-style

✨ An HTML style snippet that looks nice on all devices while being as small as possible.
HTML
2
star
34

octocats

Octocats by lgarron, a lΓ‘ Octodex.
2
star
35

shuang-chen-projects

This is a repository for several cube projects created by Shuang Chen.
Java
2
star
36

parcel-library-template

Don't use this. Use `esbuild`.
TypeScript
2
star
37

dotfiles

πŸ“„ My dotfiles, with machine-specific subsets handled using `make` and `stow`.
Shell
2
star
38

Makefile-scripts

πŸ› πŸ“œ Generate and maintain a `Makefile` based on scripts in `package.json`.
Makefile
2
star
39

color-chrome-theme

A Chrome theme with a familiar color scheme.
Makefile
2
star
40

hash-oll

An OLL naming scheme.
TypeScript
1
star
41

parcel-issue-6284

TypeScript
1
star
42

publish-playlist

Easily publish an iTunes playlist to the internet using Dropbox.
Shell
1
star
43

snowpack-url-folders

HTML
1
star
44

lockscreen-algsheets

TypeScript
1
star
45

random-dance-moves

Random social dance move generator, in the style of Richard Powers move descriptions.
JavaScript
1
star
46

lgarron.github.io

Github page
HTML
1
star
47

project-euler

7 years later.
Mathematica
1
star
48

parcel-6192

TypeScript
1
star
49

scrambler-interface

Interface for tnoodle and Mark 2 to share.
1
star
50

OrdinalArithmetic

Ordinal Arithmetic Package for Mathematica
1
star
51

refcon

Origami construction program.
Java
1
star
52

math

Math.
1
star
53

lgsound2png

Command-line tool for generating waveforms from sound files without libraries
C
1
star
54

u2f-api-polyfill.d.ts

TypeScript definitions for `u2f-api-polyfill` package.
1
star
55

heise-sim-keylayout

Keyboard layout for typing Rubik's Cube algorithms (move sequences)
1
star
56

worker-execution-origin

JavaScript
1
star
57

webauthn-user-journeys

Test yourself some WebAuthn!
HTML
1
star
58

make_carpet_mod

Automatically assemble gnembon_mc's carpet_mod.
Makefile
1
star
59

map-log-zoom

JavaScript
1
star
60

clapperboard

🎬
TypeScript
1
star
61

wca_ical

WCA feed parser > iCal for viewing in calendar clients.
PHP
1
star
62

lgarron.sty

My custom LaTeX commands
1
star
63

hs-ma-dict

Haskell-Mathematica Dictionary
1
star
64

g4gx-lgarron

Extremely rough source code for my talk at G4GX. (Atlanta, March 30, 2012)
1
star
65

speedsolving.com-logo

Source files for the speedsolving.com logo and banner.
1
star
66

git-cloud

Keep your .git folder outside of Dropbox, but the working directories in it.
Shell
1
star
67

serendipity-logo

Serendipity logo.
1
star
68

random-uint-below.js

🎲 An unbiased way to pick random integers in Javascript. Uses `crypto.getRandomValues()`.
TypeScript
1
star
69

speedlife.games

speedlife
TypeScript
1
star
70

QML

Haskell
1
star
71

https-test-server

Python
1
star
72

web-worker-test

JavaScript
1
star
73

pink-chrome-theme

Want a pink Chrome theme? This one's for you!
1
star
74

pizza

A repository to demonstrate an issue with the `go vet` `-unusedresult ` feature.
Go
1
star
75

copy-text-as-html

Coded in literally under 6 minutes. Caveat emptor. πŸ˜›
Makefile
1
star
76

sq1.js

Javascript port of Walter Souza's Square-1 solver/MRSS scrambler. (Also see Mark 2: https://github.com/lgarron/mark2 )
JavaScript
1
star
77

watermelon-clarity-chrome-theme

Bold innovation in color design.
1
star
78

youtube-backup

Simple script to backup the YouTube videos of a user.
JavaScript
1
star
79

cross-step

Crosss-Step Waltz Variations with Richard Powers and Angela Amarillas
HTML
1
star
80

midi-cubing

HTML
1
star
81

readme-cli-help

Maintain the output of a help command in your `README` file.
TypeScript
1
star
82

hardware

Useful hardware for computing electronics and more, ready for any occasion.
1
star
83

ts-project-template

My TypeScript project template.
Makefile
1
star
84

pet-the-kitties

😸 A revolutionary new app that emulates the experience of petting cats. Best on touch screens.
JavaScript
1
star
85

git-freeze

❄️ Freeze and πŸ”₯ thaw.
Shell
1
star
86

web-worker-primes

Simple web worker example.
JavaScript
1
star