summaryrefslogtreecommitdiffstats
path: root/build/pyinstaller/setup_icons.applescript
diff options
context:
space:
mode:
Diffstat (limited to 'build/pyinstaller/setup_icons.applescript')
-rw-r--r--build/pyinstaller/setup_icons.applescript20
1 files changed, 20 insertions, 0 deletions
diff --git a/build/pyinstaller/setup_icons.applescript b/build/pyinstaller/setup_icons.applescript
new file mode 100644
index 00000000000..8bbce2b5471
--- /dev/null
+++ b/build/pyinstaller/setup_icons.applescript
@@ -0,0 +1,20 @@
+use framework "Foundation"
+use framework "AppKit"
+use scripting additions
+
+-- Get script location
+tell application "Finder"
+ set current_path to POSIX path of (container of (path to me) as alias)
+end tell
+
+-- Set OpenBB Terminal folder icon relative to script location
+set sourcePath to current_path & "../../images/openbb_folder_icon.icns"
+set destPath to current_path & "macOS_package_assets/OpenBB Terminal"
+set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:sourcePath)
+(current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2)
+
+-- Set OpenBB Terminal launcher icon relative to script location
+set sourcePath to current_path & "../../images/openbb.icns"
+set destPath to current_path & "macOS_package_assets/OpenBB Terminal/OpenBB Terminal"
+set imageData to (current application's NSImage's alloc()'s initWithContentsOfFile:sourcePath)
+(current application's NSWorkspace's sharedWorkspace()'s setIcon:imageData forFile:destPath options:2)