Remove .local/bin/dnd
Remove .local/bin/fishify-envs Remove .local/bin/fishify_envs Remove .local/bin/fix-loopback Remove .local/bin/hyprtoggle Remove .local/bin/localhost Remove .local/bin/low-battery-warn Remove .local/bin/make-pwa Remove .local/bin/niri-cycle Remove .local/bin/niri-event-handler Remove .local/bin/push-chezmoi Remove .local/bin/push_chezmoi Remove .local/bin/tmux-sessionizer Remove .local/bin/update_lsps Remove .local/bin/hooks/generic
This commit is contained in:
parent
917b479a94
commit
9c6f940eb1
15 changed files with 0 additions and 431 deletions
|
|
@ -1,26 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
THRESHOLD=15
|
||||
|
||||
# Find the battery device (first one found)
|
||||
BATTERY=$(upower -e | grep battery | head -n1)
|
||||
|
||||
# If no battery found, exit
|
||||
if [ -z "$BATTERY" ]; then
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') No battery found. Exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') Battery device: $BATTERY"
|
||||
|
||||
# Get battery state and percentage
|
||||
STATE=$(upower -i "$BATTERY" | awk '/state:/ {print $2}')
|
||||
PERCENT=$(upower -i "$BATTERY" | awk -F'[:%]' '/percentage:/ {gsub(/ /,"",$2); print $2}')
|
||||
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') Battery state: $STATE, percentage: $PERCENT"
|
||||
|
||||
# Only notify if discharging and below threshold
|
||||
if [ "$STATE" = "discharging" ] && [ "$PERCENT" -lt "$THRESHOLD" ]; then
|
||||
notify-send "Battery low" "Battery at ${PERCENT}% and discharging."
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') Notification sent: Battery at ${PERCENT}% and discharging."
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue