Skip to content

Commit

Permalink
Add icon to executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Veras-D committed Dec 30, 2023
1 parent c06676d commit 74e1866
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
pip install pyinstaller
- name: Build with pyinstaller for ${{ matrix.config.os }}
run: pyinstaller scripts/main.py --onefile --noconsole
run: pyinstaller scripts/main.py --onefile --noconsole --icon=img/icon.ico

- name: Rename builded app
run: mv ./dist ./dist-${{ matrix.config.os }}
Expand Down
Binary file added img/icon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def led_pulse():
root.geometry("300x120")
root.resizable(False, False)
ctk.set_appearance_mode("dark")
icon = get_base64_encoded_image("../img/icon.png")
root.iconphoto(True, PhotoImage(data=icon))
# icon = get_base64_encoded_image("../img/icon.png")
# root.iconphoto(True, PhotoImage(data=icon))


selected_port = StringVar()
Expand Down
8 changes: 4 additions & 4 deletions scripts/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import serial.tools.list_ports
from tkinter import *
import webbrowser
import base64
# import base64


arduino = None
Expand All @@ -12,9 +12,9 @@ def callback(url):
webbrowser.open_new_tab(url)


def get_base64_encoded_image(image_path):
with open(image_path, "rb") as img_file:
return base64.b64encode(img_file.read()).decode('utf-8')
# def get_base64_encoded_image(image_path):
# with open(image_path, "rb") as img_file:
# return base64.b64encode(img_file.read()).decode('utf-8')


def find_arduino():
Expand Down

0 comments on commit 74e1866

Please sign in to comment.