Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(application) Updated with customtkinter; Volume Controls and major-minor improvements #34

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

Sayad-Uddin-Tahsin
Copy link
Contributor

@Sayad-Uddin-Tahsin Sayad-Uddin-Tahsin commented Apr 3, 2024

  • Added Volume Mute on Session Break (Windows Only)
  • Added Fade in and out transition to sound (Windows Only)
  • Fixed Skip this time timer issue-
    Previously in the case of skip the remaining 20 seconds used to add with the next 20 minute on interval.
  • Removed blink-eye-reminder-btn.png and used Button instead with 2 skip images (for dark and light mode)
  • Changed fonts on Break Screen
  • Changed the spacing on the links at the bottom of break screen
  • Break screen now synced with System Theme (dark and light) as well as the widgets color on it
  • Modified links to once clickable in one break screen
  • Added hold_the_program instead of time.sleep to wait the program in order to exclude remaining time in the case of skip
  • Removed --icon for Fedora, as Refactor Code, Update .gitignore, Add Fallback Installation Command #29 (review)
  • Added logo and text Blink Eye on the top right side in the Break Screen

@fluentmoheshwar Please consider reviewing Fedora related files (especially, ./application/BlinkEye_Fedora.spec) once again, as some lines were deleted while merging #26!

…pdate README

The changes include:
- Replace tkinter with customtkinter for the GUI
- Add a fade to black effect when skipping reminders
- Update the README file with revised instructions and images
- Make minor bug fixes and improvements
… REQUIREMENTS.txt to include pycaw

The changes include:

* Importing necessary modules from comtypes and pycaw
* Adding methods to get and set the volume level
* Adding a method to create a sequence of volume fade values
* Modifying the fade_to_black method to include volume fading
* Adding an icon to the application window
* Updating REQUIREMENTS.txt to include pycaw

The blink-eye-reminder-btn.png image file was removed without a replacement.
Copy link

vercel bot commented Apr 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blink-eye ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2024 2:53pm

@fluentmoheshwar
Copy link
Contributor

Please don't merge until I review it. I have to wait until the electricity comes back to test it.

@fluentmoheshwar
Copy link
Contributor

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

@fluentmoheshwar
Copy link
Contributor

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

Helvatica isn't pre-installed on Fedora. The ideal solution would be

  • Segoe UI on Windows
  • Cantarell on Fedora/Debian/Opensuse and others
  • Ubuntu on Ubuntu
  • SF Pro on macOS

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

Helvatica isn't pre-installed on Fedora. The ideal solution would be

  • Segoe UI on Windows
  • Cantarell on Fedora/Debian/Opensuse and others
  • Ubuntu on Ubuntu
  • SF Pro on macOS

In that case use of which would be ideal? Helvetica was used before!

@fluentmoheshwar
Copy link
Contributor

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

Helvatica isn't pre-installed on Fedora. The ideal solution would be

  • Segoe UI on Windows
  • Cantarell on Fedora/Debian/Opensuse and others
  • Ubuntu on Ubuntu
  • SF Pro on macOS

In that case use of which would be ideal? Helvetica was used before!

is there any way to add fallback fonts like we do in CSS? I never really worked with tkinter.

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

Helvatica isn't pre-installed on Fedora. The ideal solution would be

  • Segoe UI on Windows
  • Cantarell on Fedora/Debian/Opensuse and others
  • Ubuntu on Ubuntu
  • SF Pro on macOS

In that case use of which would be ideal? Helvetica was used before!

is there any way to add fallback fonts like we do in CSS? I never really worked with tkinter.

Maybe we can import font from .ttf file! I'll commit the changes with the modification later. Can you just review Fedora things, especially the spec file?

@fluentmoheshwar
Copy link
Contributor

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

Helvatica isn't pre-installed on Fedora. The ideal solution would be

  • Segoe UI on Windows
  • Cantarell on Fedora/Debian/Opensuse and others
  • Ubuntu on Ubuntu
  • SF Pro on macOS

In that case use of which would be ideal? Helvetica was used before!

is there any way to add fallback fonts like we do in CSS? I never really worked with tkinter.

Maybe we can import font from .ttf file! I'll commit the changes with the modification later. Can you just review Fedora things, especially the spec file?

Okay! I have reviewed it. But I want to run the script and test but I don't have electricity right now. I will test and review immediately after the electricity come back. Anyway if you want to use ".ttf" files don't use something like Segoe UI. It will cause licensing issues. Use a font that's open source like Noto Sans or Ubuntu.

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Anyway, I have read the code with my phone. Can we add multiple fonts? As we don't have Segoe UI in fedora.

What font you're trying to mean?

Do we have Helvetica on Fedora? Segoe UI seems really cool to see so added, it's changeable obviously!

Helvatica isn't pre-installed on Fedora. The ideal solution would be

  • Segoe UI on Windows
  • Cantarell on Fedora/Debian/Opensuse and others
  • Ubuntu on Ubuntu
  • SF Pro on macOS

In that case use of which would be ideal? Helvetica was used before!

is there any way to add fallback fonts like we do in CSS? I never really worked with tkinter.

Maybe we can import font from .ttf file! I'll commit the changes with the modification later. Can you just review Fedora things, especially the spec file?

Okay! I have reviewed it. But I want to run the script and test but I don't have electricity right now. I will test and review immediately after the electricity come back. Anyway if you want to use ".ttf" files don't use something like Segoe UI. It will cause licensing issues. Use a font that's open source like Noto Sans or Ubuntu.

Roger that! 🫡

@fluentmoheshwar
Copy link
Contributor

Build script needs to be changed and comtypes isn't available on linux

@fluentmoheshwar
Copy link
Contributor

Update BlinkEye_Fedora.spec to this:

Name:           BlinkEye
Version:        1.4.0
Release:        1%{?dist}
Summary:        Blink Eye is a minimalist eye care reminder app designed to reduce eye strain during extended screen usage.

License:        MIT
URL:            https://github.com/nomandhoni-cs/blink-eye

%description
Blink Eye is a minimalist eye care reminder app designed to reduce eye strain during extended screen usage. It provides customization timers, full-screen popups, audio mute functionality for a seamless user experience.

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp dist/%{name} $RPM_BUILD_ROOT/%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/%{name}
%license LICENSE.txt

%changelog
* Mon Apr 01 2024 Moheshwar Amarnath Biswas
- First Linux Version

and build_fedora.sh to this:

#!/usr/bin/env bash

ver="1.4.0"

echo Installing Dependencies...
sudo dnf install -y rpmdevtools rpmlint python3-devel python3-pip python3-tkinter
pip install wheel
pip install -r REQUIREMENTS.txt
pip install pyinstaller
echo Building the executable...
pyinstaller --name BlinkEye --onefile --windowed --add-data="./Assets/*:./Assets" --hidden-import plyer.platforms.linux.notification --clean blink-eye.py
echo Building the installer...
rpmdev-setuptree
cp -r ./* ~/rpmbuild/BUILD
cp ../LICENSE.txt ~/rpmbuild/BUILD/LICENSE.txt
rpmbuild -bb ./BlinkEye_Fedora.spec
rm -rf ~/rpmbuild/BUILD
mkdir -p ./ExecutableFile/
mv ~/rpmbuild/RPMS/x86_64/BlinkEye-$ver-1.fc39.x86_64.rpm ./ExecutableFile/BlinkEye-$ver-1.fc39.x86_64.rpm

and if else block to stop importing comtypes on macOS and Linux

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Build script needs to be changed and comtypes isn't available on linux

In that case, volume feature might not be available for Linux! Is there any way you know which is OS Independent? I can't find any actually...

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Update BlinkEye_Fedora.spec to this:

Name:           BlinkEye
Version:        1.4.0
Release:        1%{?dist}
Summary:        Blink Eye is a minimalist eye care reminder app designed to reduce eye strain during extended screen usage.

License:        MIT
URL:            https://github.com/nomandhoni-cs/blink-eye

%description
Blink Eye is a minimalist eye care reminder app designed to reduce eye strain during extended screen usage. It provides customization timers, full-screen popups, audio mute functionality for a seamless user experience.

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp dist/%{name} $RPM_BUILD_ROOT/%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/%{name}
%license LICENSE.txt

%changelog
* Mon Apr 01 2024 Moheshwar Amarnath Biswas
- First Linux Version

and build_fedora.sh to this:

#!/usr/bin/env bash

ver="1.4.0"

echo Installing Dependencies...
sudo dnf install -y rpmdevtools rpmlint python3-devel python3-pip python3-tkinter
pip install wheel
pip install -r REQUIREMENTS.txt
pip install pyinstaller
echo Building the executable...
pyinstaller --name BlinkEye --onefile --windowed --add-data="./Assets/*:./Assets" --hidden-import plyer.platforms.linux.notification --clean blink-eye.py
echo Building the installer...
rpmdev-setuptree
cp -r ./* ~/rpmbuild/BUILD
cp ../LICENSE.txt ~/rpmbuild/BUILD/LICENSE.txt
rpmbuild -bb ./BlinkEye_Fedora.spec
rm -rf ~/rpmbuild/BUILD
mkdir -p ./ExecutableFile/
mv ~/rpmbuild/RPMS/x86_64/BlinkEye-$ver-1.fc39.x86_64.rpm ./ExecutableFile/BlinkEye-$ver-1.fc39.x86_64.rpm

and if else block to stop importing comtypes on macOS and Linux

The spec file won't be able to access the LINCENSE.txt as it's one step back in PATH, I think? Should I still edit it?

@fluentmoheshwar
Copy link
Contributor

fluentmoheshwar commented Apr 3, 2024

Update BlinkEye_Fedora.spec to this:

Name:           BlinkEye
Version:        1.4.0
Release:        1%{?dist}
Summary:        Blink Eye is a minimalist eye care reminder app designed to reduce eye strain during extended screen usage.

License:        MIT
URL:            https://github.com/nomandhoni-cs/blink-eye

%description
Blink Eye is a minimalist eye care reminder app designed to reduce eye strain during extended screen usage. It provides customization timers, full-screen popups, audio mute functionality for a seamless user experience.

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_bindir}
cp dist/%{name} $RPM_BUILD_ROOT/%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%{_bindir}/%{name}
%license LICENSE.txt

%changelog
* Mon Apr 01 2024 Moheshwar Amarnath Biswas
- First Linux Version

and build_fedora.sh to this:

#!/usr/bin/env bash

ver="1.4.0"

echo Installing Dependencies...
sudo dnf install -y rpmdevtools rpmlint python3-devel python3-pip python3-tkinter
pip install wheel
pip install -r REQUIREMENTS.txt
pip install pyinstaller
echo Building the executable...
pyinstaller --name BlinkEye --onefile --windowed --add-data="./Assets/*:./Assets" --hidden-import plyer.platforms.linux.notification --clean blink-eye.py
echo Building the installer...
rpmdev-setuptree
cp -r ./* ~/rpmbuild/BUILD
cp ../LICENSE.txt ~/rpmbuild/BUILD/LICENSE.txt
rpmbuild -bb ./BlinkEye_Fedora.spec
rm -rf ~/rpmbuild/BUILD
mkdir -p ./ExecutableFile/
mv ~/rpmbuild/RPMS/x86_64/BlinkEye-$ver-1.fc39.x86_64.rpm ./ExecutableFile/BlinkEye-$ver-1.fc39.x86_64.rpm

and if else block to stop importing comtypes on macOS and Linux

The spec file won't be able to access the LINCENSE.txt as it's one step back in PATH, I think? Should I still edit it?

The spec file isn't reading from current directory it's reading from ~/rpmbuild/BUILD don't edit it

As you can see I copied the LICENSE.txt file to ~/rpmbuild/BUILD

@fluentmoheshwar
Copy link
Contributor

Build script needs to be changed and comtypes isn't available on linux

In that case, volume feature might not be available for Linux! Is there any way you know which is OS Independent? I can't find any actually...

I can't find any either.

Copy link
Contributor

@fluentmoheshwar fluentmoheshwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! You should add if else statement to comtype imports and merge it we can make that feature cross platform later

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

LGTM! You should add if else statement to comtype imports and merge it we can make that feature cross platform later

Yeah thinking to do so, trying to figure out the exception type!

@Sayad-Uddin-Tahsin Sayad-Uddin-Tahsin changed the title (application) Updated with customtkinter; Volume Controls and major-minor improvements [WIP] (application) Updated with customtkinter; Volume Controls and major-minor improvements Apr 3, 2024
@fluentmoheshwar
Copy link
Contributor

fluentmoheshwar commented Apr 3, 2024

LGTM! You should add if else statement to comtype imports and merge it we can make that feature cross platform later

Yeah thinking to do so, trying to figure out the exception type!

You should try something like this

import platform
if platform.system() == "Windows":
  # import comtypes and implement volume feature

- Import platform module to determine the operating system
- Add a flag 'isWindows' to store the result of the platform check
- Add a check for the operating system before attempting to control the volume
- If the operating system is not Windows, the volume control functions return None
- Add a check for None before attempting to set the volume

Update .gitignore

- Add various files and directories related to package building, testing, and distribution
- Add PyInstaller files and directories
- Add Installer logs
- Add Unit test / coverage reports
- Add Translations
- Add Django, Flask, Scrapy, and Sphinx files and directories
- Add PyBuilder files and directories
- Add Jupyter Notebook files and directories
- Add IPython files and directories
- Add pyenv files and directories
- Add pipenv files and directories
- Add PEP 582 files
- Add Celery files and directories
- Add SageMath files and directories
- Add Environments files and directories
- Add Spyder and Rope project settings
- Add mkdocs documentation
- Add mypy files and directories
- Add Pyre type checker files and directories
- Add Replit files and directories
- Add Other Files
- Remove specific references to blink-eye.exe and /build and /dist directories from .gitignore

Remove unused imports

- Remove unused 'ctypes' import from blink-eye.py
- Remove unused 'datetime' import from blink-eye.py
Modified Uninstaller icon path
@fluentmoheshwar
Copy link
Contributor

@fluentmoheshwar, on the latest commit, tried to add font import mechanism but failed miserably. But added the font path everywhere the font to be used, so that it could easily be identifiable what are meant to be used. Currently it should use the default OS font.

I hope it's totally ok!

Let it use default os font

* Added `NotoSans-Regular` and `Consolas` as Fonts for GUI and to be imported from `.ttf`
* Fixed font path on import
@Sayad-Uddin-Tahsin
Copy link
Contributor Author

@fluentmoheshwar Done! It will import NotoSans-Regular and Consolas font on use!

@fluentmoheshwar
Copy link
Contributor

@fluentmoheshwar Done! It will import NotoSans-Regular and Consolas font on use!

Awesome!

application/blink-eye.py Outdated Show resolved Hide resolved
application/blink-eye.py Outdated Show resolved Hide resolved
@nomandhoni-cs
Copy link
Owner

nomandhoni-cs commented Apr 5, 2024

Screenshot_36

I have tested your changes.
This was the major problem, this wasn't creating a full screen reminder.
this was most probably because of customtkinter

Issues with the new changes you made,

  • Not creating a fullscreen popup
  • Remove the app name and logo from the popup, our target is keep it as minimal as possible
  • Change the new skip this time btn to match the previous theme

Here is our figma file, you can get color code and icon and spacing from here

https://www.figma.com/file/8GenlMVGFGTpo2dLzVkyh0/Blink-Eye?type=design&node-id=21%3A7&mode=design&t=q3WCB2XnOM7sgfMC-1

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Screenshot_36

I have tested your changes. This was the major problem, this wasn't creating a full screen reminder. this was most probably because of customtkinter

Issues with the new changes you made,

  • Not creating a fullscreen popup
  • Remove the app name and logo from the popup, our target is keep it as minimal as possible
  • Change the new skip this time btn to match the previous theme

Here is our figma file, you can get color code and icon and spacing from here

https://www.figma.com/file/8GenlMVGFGTpo2dLzVkyh0/Blink-Eye?type=design&node-id=21%3A7&mode=design&t=q3WCB2XnOM7sgfMC-1

• Full screen pop up will be fixed soon in new commit from my PC and it's totally not a customtkinter issue I think.
• In my opinion, on the break screen, there is no way to get which app is showing the popup. In order to aware the user of the software's existence and some sort of promote as someone sees the break screen, they might be curious and they'll get the name of the software automatically.
• Using Image as Button, doesn't seems professional as we can create rounded buttons with hovering colors which can't be done in Image. Will it be ok, if I match the color and icon? And use a darkish color as hover_color?

@Sayad-Uddin-Tahsin
Copy link
Contributor Author

Screenshot_36

I have tested your changes. This was the major problem, this wasn't creating a full screen reminder. this was most probably because of customtkinter

Issues with the new changes you made,

  • Not creating a fullscreen popup
  • Remove the app name and logo from the popup, our target is keep it as minimal as possible
  • Change the new skip this time btn to match the previous theme

Here is our figma file, you can get color code and icon and spacing from here

https://www.figma.com/file/8GenlMVGFGTpo2dLzVkyh0/Blink-Eye?type=design&node-id=21%3A7&mode=design&t=q3WCB2XnOM7sgfMC-1

I really don't know how and why it's happening, seems everything is perfect here:
BlinkEye Screenshot
While running .py and .exe, both working perfectly! Can you just try running on different PC? or just try re-executing? if both fails, can you please run .py and see what happens?

@Sayad-Uddin-Tahsin Sayad-Uddin-Tahsin changed the title (application) Updated with customtkinter; Volume Controls; Website Update and major-minor improvements (application) Updated with customtkinter; Volume Controls and major-minor improvements Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants