refactor(repo): most of these scripts are outdated, refactored desec
All checks were successful
/ test (push) Successful in 23s
All checks were successful
/ test (push) Successful in 23s
This commit is contained in:
parent
5b03adaaa9
commit
6682679493
18 changed files with 154 additions and 133 deletions
11
archived/notifs/battery-status
Executable file
11
archived/notifs/battery-status
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
BATTERY=$(acpi | grep -vwE "(unavailable)" | grep -o '[0-9]' | head -n 1)
|
||||
BAT_PERCENT=$(acpi -b | grep "Battery $BATTERY" | grep -P -o "[0-9]+(?=%)")
|
||||
DISCHARGING_COUNT=$(acpi -b | grep "Battery $BATTERY" | grep -E "until|remaining" | grep -c "Discharging")
|
||||
NOTCHARGING_COUNT=$(acpi -b | grep "Battery $BATTERY" | grep -c "Not Charging")
|
||||
|
||||
if [[ $DISCHARGING_COUNT -eq 0 ]] || [[ $NOTCHARGING_COUNT -eq 1 ]]; then
|
||||
dunstify "Battery Status" "Battery is currently charging at ${BAT_PERCENT}%" -i "battery-level-50-charging-symbolic" -r 9991 -t 5000
|
||||
else
|
||||
dunstify "Battery Status" "Battery is currently discharging at ${BAT_PERCENT}%" -i "battery-level-50-symbolic" -r 9991 -t 5000
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue