Skip to content
This repository was archived by the owner on Oct 26, 2025. It is now read-only.

Commit c108a41

Browse files
author
BeatLink
committed
Add code to generate icns icon files in branding folder
1 parent 5032a00 commit c108a41

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

browser/build.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,42 @@ printf "\nSetting up script variables\n";
99
SCRIPT_FOLDER=$(realpath $(dirname $0));
1010
REPOSITORY_FOLDER=$(realpath $SCRIPT_FOLDER/../);
1111
BRANDING_FOLDER=$SCRIPT_FOLDER/resources/source_files/browser/branding/librewolf;
12-
ICON_FILE=$REPOSITORY_FOLDER/branding/icon/icon.svg;
12+
ICON_FOLDER=$REPOSITORY_FOLDER/branding/icon/;
1313
PACKAGE_FILE="librewolf*.tar.bz2";
1414
APPIMAGE_RESOURCE_FOLDER=$SCRIPT_FOLDER/resources/appimage;
1515
printf "SCRIPT_FOLDER: $SCRIPT_FOLDER\n";
1616
printf "REPOSITORY_FOLDER: $REPOSITORY_FOLDER\n";
1717
printf "BRANDING_FOLDER: $BRANDING_FOLDER\n";
18-
printf "ICON_FILE: $ICON_FILE\n";
18+
printf "ICON_FOLDER: $ICON_FOLDER\n";
1919
printf "PACKAGE_FILE: $PACKAGE_FILE\n";
2020
printf "APPIMAGE_RESOURCE_FOLDER: $APPIMAGE_RESOURCE_FOLDER\n";
2121

2222
# Installs some needed dependencies
2323
printf "\nInstalling script dependencies\n";
2424
apt update;
25-
apt install sudo python python3 inkscape wget -y;
25+
apt install sudo python python3 inkscape icnsutils wget -y;
2626

2727
printf "\n\n---------------------------------- ICON GENERATION ------------------------------------------\n";
2828

29-
printf "\nGenerating icons from $ICON_FILE and moving to $BRANDING_FOLDER\n";
29+
printf "\nGenerating icons from $ICON_FOLDER and moving to $BRANDING_FOLDER\n";
3030

3131
# Linux Icons
32-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/default16.png -w 16 -h16;
33-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/default32.png -w 32 -h32;
34-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/default48.png -w 48 -h48;
35-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/default64.png -w 64 -h64;
36-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/default128.png -w 128 -h128;
32+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/default16.png -w 16 -h 16;
33+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/default32.png -w 32 -h 32;
34+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/default48.png -w 48 -h 48;
35+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/default64.png -w 64 -h 64;
36+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/default128.png -w 128 -h 128;
3737

3838
# Windows Icons
39-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/VisualElements_70.png -w 70 -h70;
40-
inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/VisualElements_150.png -w 150 -h150;
39+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/VisualElements_70.png -w 70 -h70;
40+
inkscape -z -f $ICON_FOLDER/icon.svg -e $BRANDING_FOLDER/VisualElements_150.png -w 150 -h150;
4141

4242
# TODO: Add Apple Icons
43+
png2icns $BRANDING_FOLDER/firefox.icns $BRANDING_FOLDER/default128.png;
4344

45+
inkscape -z -f $ICON_FOLDER/document-icon.svg -e $BRANDING_FOLDER/document-icon.png -w 128 -h 128;
46+
png2icns $BRANDING_FOLDER/document.icns $BRANDING_FOLDER/document-icon.png;
47+
rm -r $BRANDING_FOLDER/document-icon.png
4448
printf "\n\n-------------------------------------- PREBUILD ---------------------------------------------\n";
4549

4650
# Downloads and runs bootstrapper to install dependencies.
@@ -109,7 +113,7 @@ printf "\n\n------------------------------------ APPIMAGE BUILD ----------------
109113

110114
# Copy and generate icons
111115
printf "\nGenerating AppImage Icons\n";
112-
cp $ICON_FILE $APPIMAGE_RESOURCE_FOLDER/librewolf.svg;
116+
cp $ICON_FOLDER/icon.svg $APPIMAGE_RESOURCE_FOLDER/librewolf.svg;
113117
ln -rs $APPIMAGE_RESOURCE_FOLDER/librewolf.svg $SCRIPT_FOLDER/resources/appimage/.DirIcon;
114118

115119
# Copy appimage resources to main tarball

0 commit comments

Comments
 (0)