diff --git a/assets/app_icon.icns b/assets/app_icon.icns index b3af25e8..f6feee4f 100644 Binary files a/assets/app_icon.icns and b/assets/app_icon.icns differ diff --git a/assets/damus-app-icon.png b/assets/damus-app-icon.png new file mode 100644 index 00000000..be33bba3 Binary files /dev/null and b/assets/damus-app-icon.png differ diff --git a/assets/damus-app-icon.svg b/assets/damus-app-icon.svg new file mode 100644 index 00000000..ee3688af --- /dev/null +++ b/assets/damus-app-icon.svg @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/damus_rounded_256.png b/assets/damus_rounded_256.png deleted file mode 100644 index ec72d00a..00000000 Binary files a/assets/damus_rounded_256.png and /dev/null differ diff --git a/scripts/svg_to_icns.sh b/scripts/svg_to_icns.sh new file mode 100755 index 00000000..3d0fcc2c --- /dev/null +++ b/scripts/svg_to_icns.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +# Exit on error +set -e + +# Check dependencies +if ! command -v inkscape &> /dev/null; then + echo "Error: Inkscape is required but not installed. Install it and try again." + exit 1 +fi + +if ! command -v iconutil &> /dev/null; then + echo "Error: iconutil is required but not installed. This tool is available only on macOS." + exit 1 +fi + +# Check input arguments +if [ "$#" -ne 2 ]; then + echo "Usage: $0 input.svg output.icns" + exit 1 +fi + +INPUT_SVG=$1 +OUTPUT_ICNS=$2 +TEMP_DIR=$(mktemp -d) + +# Create the iconset directory +ICONSET_DIR="$TEMP_DIR/icon.iconset" +mkdir "$ICONSET_DIR" + +# Define sizes and export PNGs +SIZES=( + "16 icon_16x16.png" + "32 icon_16x16@2x.png" + "32 icon_32x32.png" + "64 icon_32x32@2x.png" + "128 icon_128x128.png" + "256 icon_128x128@2x.png" + "256 icon_256x256.png" + "512 icon_256x256@2x.png" + "512 icon_512x512.png" + "1024 icon_512x512@2x.png" +) + +echo "Converting SVG to PNGs..." +for size_entry in "${SIZES[@]}"; do + size=${size_entry%% *} + filename=${size_entry#* } + inkscape -w $size -h $size "$INPUT_SVG" -o "$ICONSET_DIR/$filename" +done + +# Convert to ICNS +echo "Generating ICNS file..." +iconutil -c icns -o "$OUTPUT_ICNS" "$ICONSET_DIR" + +# Clean up +rm -rf "$TEMP_DIR" + +echo "Done! ICNS file saved to $OUTPUT_ICNS" diff --git a/src/app_creation.rs b/src/app_creation.rs index 80e72562..db74bacf 100644 --- a/src/app_creation.rs +++ b/src/app_creation.rs @@ -47,8 +47,8 @@ fn generate_native_options_with_builder_modifiers( } } -pub fn app_icon() -> &'static [u8; 192739] { - std::include_bytes!("../assets/damus_rounded_256.png") +pub fn app_icon() -> &'static [u8; 271986] { + std::include_bytes!("../assets/damus-app-icon.png") } pub fn generate_mobile_emulator_native_options() -> eframe::NativeOptions {