Skip to content

Build your personal knowledge base with Trilium Notes

feat(tray): higher DPI icon

Elian Doran0f2e50d26598
diff --git a/bin/tray-icons/build-icons.sh b/bin/tray-icons/build-icons.sh
index b3fb388597..cb0bb99be5 100644
--- a/bin/tray-icons/build-icons.sh
+++ b/bin/tray-icons/build-icons.sh
@@ -11,16 +11,26 @@ if ! command -v inkscape &> /dev/null; then
fi
script_dir=$(realpath $(dirname $0))
-output_dir="$script_dir/../../images/app-icons/tray"
+images_dir="$script_dir/../../images"
+output_dir="$images_dir/app-icons/tray"
+
+function generateDpiScaledIcons {
+ file=$1
+ name=$(basename $file .svg)
+ inkscape -w 16 -h 16 "$file" -o "$output_dir/$name.png"
+ inkscape -w 20 -h 20 "$file" -o "$output_dir/[email protected]"
+ inkscape -w 24 -h 24 "$file" -o "$output_dir/[email protected]"
+ inkscape -w 32 -h 32 "$file" -o "$output_dir/[email protected]"
+}
+
+generateDpiScaledIcons "$images_dir/icon-color.svg"
for file in *.svg; do
name=$(basename $file .svg)
- inkscape -w 16 -h 16 "$file" -o "$output_dir/$name.png"
- inkscape -w 20 -h 20 "$file" -o "$output_dir/[email protected]"
- inkscape -w 24 -h 24 "$file" -o "$output_dir/[email protected]"
- inkscape -w 32 -h 32 "$file" -o "$output_dir/[email protected]"
+ generateDpiScaledIcons "$file"
magick "$output_dir/$name.png" -channel RGB -negate "$output_dir/$name-inverted.png"
magick "$output_dir/[email protected]" -channel RGB -negate "$output_dir/[email protected]"
magick "$output_dir/[email protected]" -channel RGB -negate "$output_dir/[email protected]"
magick "$output_dir/[email protected]" -channel RGB -negate "$output_dir/[email protected]"
-done
\ No newline at end of file
+done
+
diff --git a/images/app-icons/tray/icon-color.png b/images/app-icons/tray/icon-color.png
new file mode 100644
index 0000000000..4645fe0568
Binary files /dev/null and b/images/app-icons/tray/icon-color.png differ
diff --git a/images/app-icons/tray/[email protected] b/images/app-icons/tray/[email protected]
new file mode 100644
index 0000000000..4c90e875b0
Binary files /dev/null and b/images/app-icons/tray/[email protected] differ
diff --git a/images/app-icons/tray/[email protected] b/images/app-icons/tray/[email protected]
new file mode 100644
index 0000000000..4681c5ad15
Binary files /dev/null and b/images/app-icons/tray/[email protected] differ
diff --git a/images/app-icons/tray/[email protected] b/images/app-icons/tray/[email protected]
new file mode 100644
index 0000000000..dbe57df0ec
Binary files /dev/null and b/images/app-icons/tray/[email protected] differ
diff --git a/src/services/tray.ts b/src/services/tray.ts
index b2e7eb0a87..0adc8d1351 100644
--- a/src/services/tray.ts
+++ b/src/services/tray.ts
@@ -35,7 +35,7 @@ function getTrayIconPath() {
const iconSize = getIconSize();
const suffix = isDev ? "-dev" : "";
- return path.join(path.dirname(fileURLToPath(import.meta.url)), "../..", "images", "app-icons", "png", `${iconSize}x${iconSize}${suffix}.png`);
+ return path.join(path.dirname(fileURLToPath(import.meta.url)), "../..", "images", "app-icons", "tray", `icon-color.png`);
}
function getIconPath(name: string) {