yurtemre7 / mouse-battery

Get your mouse battery level in a windows system tray icon
MIT License
9 stars 0 forks source link

Congratulations and some improvements #2

Closed flozz closed 5 months ago

flozz commented 5 months ago

Hello,

I saw you message on https://github.com/flozz/rivalcfg/issues/199#issuecomment-1901346109. I am happy to see people using Rivalcfg as library from time to time! I think this project could be useful to people that just want to monitor the battery of their mouse. :)

This is a cool Windows app to retrieve the battery level of your Steelseries mouse and display it in the system tray.

I had a quick look at the code and and I think it should work out of the box on both Linux and macOS too. (I tested on Linux and it worked, I can test on macOS too if you want ;) ).


The only "problem" I see with you project is that is could be a bit difficult to install for non programmers (installing Python, dependencies, etc.)

You can easily provide a .exe file that contains everyting in it using tools like Nuitka or PyInstaller.

I prefer Nuitka as it compiles everything as native code, but it has a bit more requirements (on Windows you should installer VisualStudio, with C++ support etc.). PyInstaller will keep everything as Python bytecode but packed in a standalone and portable way.

Here is how you can build a redistribuable .exe file of your Python script using PyInstaller:

pip install pyinstaller
pyinstaller --onefile --noconsole --add-data images:images mouse.py

Result should goes into dist\mouse.exe:

Capture d’écran du 2024-01-20 11-25-27

And here is how to do the same with Nuitka (VisualStudio/MSVC required):

pip install nuitka
python -m nuitka --standalone --onefile --include-data-dir=images=images mouse.py

:)

yurtemre7 commented 5 months ago

Merci beaucoup!

You are great, I appreciate your time. I will create a release version with PyInstaller today and update my README accordingly. Keep up the great work. ^^