A bash script to generate custom Adwaita-styled folder icons by overlaying an SVG symbol onto the standard Adwaita folder base. It automatically adapts to all installed Adwaita color variants (Blue, Green, Red, etc.).
- Theme Aware: Automatically finds all Adwaita variants on your system.
- Smart Coloring: Extracts the "dark" theme color from the base icon to color your overlay.
- Stroke/Fill Support: Correctly handles both stroke-based and fill-based SVG overlays, propagating line attributes.
- Batch Installation: Efficiently installs icons with a single
sudoprompt. - Cache Updates: Automatically updates the icon cache after installation.
./generate_folder_icon.sh [options] <path_to_overlay.svg>| Flag | Description |
|---|---|
-i |
Install Mode. Automatically installs generated icons to their respective theme directories (requires sudo). |
-n <name> |
Custom Name. Specify the output filename suffix (e.g., -n myicon -> folder-myicon.svg). Default is the input filename. |
1. Generate icons locally (test run):
./generate_folder_icon.sh ~/Downloads/heart.svgGenerates output/Adwaita/folder-heart.svg, output/Adwaita-blue/folder-heart.svg, etc.
2. Install icons to system:
./generate_folder_icon.sh -i ~/Downloads/heart.svgInstalls to /usr/share/icons/... or ~/.local/share/icons/... depending on where themes are located.
3. Install with a custom name:
./generate_folder_icon.sh -i -n favorite ~/Downloads/heart.svgInstalls as folder-favorite.svg instead of folder-heart.svg.
4. Set generated icon for specified path
gio set <path> metadata::custom-icon-name <icon_name>example:
gio set ~/Documents metadata::custom-icon-name folder-heart- Linux OS with Adwaita icon themes installed.
- Standard utilities:
bash,sed,grep,awk,find. sudoaccess (only for installation mode).- Best works with simplest svg's without gradients, clip-paths or other weird things.