duttaprasanta / battery_alert

This program maintains a log of battery percentage and notify user using text and voice notifications
https://duttaprasanta.github.io/battery_alert/
MIT License
4 stars 1 forks source link

Flatpak support or installation instructions for immutable Systems #4

Closed S7venLights closed 1 year ago

S7venLights commented 1 year ago

Is your feature request related to a problem? Please describe. I can't install the program on Fedora Kionite based on the current instructions.

Describe the solution you'd like Ideally packaging as a flatpak would make the app easy to install on any system since Fedora Kionite/Silverblue and other immutable systems are particularly built around flatpak.

Describe alternatives you've considered A script for installing this on Kionite would work too. Since there are read only directories in Kionite, files need to be installed into writable directories.

Additional context I've tried a similar app here but have not been successful. In that case someone wrote a script to help install it, so you could use his script as a guide for what directories to use.

S7venLights commented 1 year ago

Or perhaps you can just help me out with install instructions for Fedora CLI?

duttaprasanta commented 1 year ago

Hi @S7venLights, Thanks for showing interest on battery_alert. I have installed Fedora Kinoite. Here are the installation instructions-

rpm-ostree install espeak
systemctl reboot
rpm-ostree install python-pip
systemctl reboot
rpm-ostree install gcc
systemctl reboot

I think single reboot will be enough instead of 3. But I followed those steps while resolving the dependency-related error. Then do

pip install --upgrade pip
pip install dbus-python pyttsx3 psutil plyer

Note: Don't try the above steps in a virtual environment as dbus-python is not installing properly there in Fedora Kinoite. Now first unplug the charger from your laptop and test the installation as -

git clone https://github.com/duttaprasanta/battery_alert.git
cd battery_alert
python battery_alert.py --alert_percentage=100 --sleep_time=0 --log_percentage=1

You should hear and see the notification as follows- Screenshot_20230601_234016 This will resolve your issue. I shall also update the README file. Please keep in touch with battery_alert.

S7venLights commented 1 year ago

Will try now, thank you!

S7venLights commented 1 year ago

Installed and working. I don't suppose it will start at boot? I see the alert is only at 100% and one user specified percentage. Is it possible to set an alert at multiple percentages? Setting a maximum and minimum alert, Alert when over x% and below x% That way I could keep the percentage between 50% and 80% for example, which is good for battery longevity.

Another nice option would be adding a custom sound.

S7venLights commented 1 year ago

Oh do I have to keep it open in terminal for it to work?

duttaprasanta commented 1 year ago

Installed and working. I don't suppose it will start at boot?

The app can start at boot. Please follow Step 3 of Installation Instruction in README

I see the alert is only at 100% and one user specified percentage. Is it possible to set an alert at multiple percentages? Setting a maximum and minimum alert, Alert when over x% and below x% That way I could keep the percentage between 50% and 80% for example, which is good for battery longevity.

You can easily keep the percentage between 50% and 80% by setting --alert_percentage=50 and by changing the line current_percent>=100%20or%20(-,current_percent%3E%3D100,-and%20plugged%3D%3DTrue)))%3A) to current_percentage>=80 in line number 66 and 79 in battery_alert.py.

Another nice option would be adding a custom sound.

You can add that functionality to this project. For contribution please follow Want to contribute? section

Oh do I have to keep it open in terminal for it to work?

No, you don't. Follow Step 3 of Installation Instruction in README for adding the app at startup.

S7venLights commented 1 year ago

Thanks for this!

duttaprasanta commented 6 months ago

My pleasure !