mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-19 02:55:12 +00:00
cf8e51e7ab
This fixes: 1. A startup crash on macOS when using the `--tray` option; see #527. ![image](https://user-images.githubusercontent.com/22625791/115987741-99544600-a5b6-11eb-866a-dadb5640eecb.png) 2. Invisible tray icon on macOS; see #942 and #668. ![image](https://user-images.githubusercontent.com/22625791/115988276-24364000-a5b9-11eb-80c3-561a8a646754.png) Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
33 lines
540 B
Bash
Executable File
33 lines
540 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# USAGE
|
|
|
|
# ./convertToTrayIcon <input png or icns> <outfilename>.png
|
|
# Example
|
|
# ./convertToTrayIcon ~/sample.icns ~/converted.png
|
|
|
|
set -e
|
|
|
|
SOURCE=$1
|
|
DEST=$2
|
|
|
|
if [ -z "${SOURCE}" ]; then
|
|
echo "No source image specified"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "${DEST}" ]; then
|
|
echo "No destination specified"
|
|
exit 1
|
|
fi
|
|
|
|
NAME=$(basename "${SOURCE}")
|
|
EXT="${NAME##*.}"
|
|
|
|
if [ "${EXT}" == "png" ]; then
|
|
cp "${SOURCE}" "${DEST}"
|
|
exit 0
|
|
fi
|
|
|
|
sips --setProperty format png --resampleHeightWidth "256" "256" "${SOURCE}" --out "${DEST}"
|