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

Add low battery notification #1445

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShahramMohammed
Copy link

  • Make a flag file to track if a low battery notification has been sent.
  • Send a critical notification if the battery is discharging and has less than 25% capacity.
  • Remove the flag file when the battery status changes from discharging to another state.

- Make a flag file to track if a low battery notification has been sent.
- Send a critical notification if the battery is discharging and has less than 25% capacity.
- Remove the flag file when the battery status changes from discharging to another state.
@sudo-Tiz
Copy link
Contributor

sudo-Tiz commented Jan 5, 2025

why does your script need a file in /tmp ?

Here is what i'll do instead:

[ "$status" = "🔋" ] && [ "$capacity" -le 10 ] && (notify-send "🔋❗ Battery low 🔋❗" "Please charge the computer ASAP"; ring /home/$USER/.local/share/larbs/ringtone/low-battery.mp3 >/dev/null 2>&1)

[ "$status" = "🔋" ] && [ "$capacity" -le 5 ] && (ring /home/$USER/.local/share/larbs/ringtone/wasted.mp3 >/dev/null 2>&1 ; sudo systemctl hibernate)

@ShahramMohammed
Copy link
Author

@sudo-Tiz because it is inside a loop and it will keep sending the notification over and over without that file

@aartoni
Copy link
Contributor

aartoni commented Jan 25, 2025

@ShahramMohammed this used to be a feature, I remember having it a few years ago. You might be able to find the original script by looking at the commit history. I was wondering whether this was the script, however I don't remember having to enable it manually.

@ShahramMohammed
Copy link
Author

@aartoni why was it removed?

@aartoni
Copy link
Contributor

aartoni commented Jan 27, 2025

I've asked @LukeSmithxyz myself in the past but haven't received any answer.

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.

3 participants