Massive Changes
This commit is contained in:
1 parent
ce221d2f95
commit
8ad7917c4f
39 files changed
+263
-402
No files matched your search
@@ -41,20 +41,20 @@ fn_notify () { # Send notification
|
||||
}
|
||||
fn_percentage () {
|
||||
if [[ "$battery_percentage" -ge "$unplug_charger_threshold" ]] && [[ "$battery_status" != "Discharging" ]] && [[ "$battery_status" != "Full" ]] && (( (battery_percentage - last_notified_percentage) >= $interval )); then if $verbose; then echo "Prompt:UNPLUG: $battery_unplug_threshold $battery_status $battery_percentage" ; fi
|
||||
fn_notify "-t 5000 " "CRITICAL" "Battery Charged" "Battery is at $battery_percentage%. You can unplug the charger!"
|
||||
fn_notify "-t 2000 " "CRITICAL" "Battery Charged" "Battery is at $battery_percentage%. You can unplug the charger!"
|
||||
last_notified_percentage=$battery_percentage
|
||||
elif [[ "$battery_percentage" -le "$battery_critical_threshold" ]]; then
|
||||
count=$(( timer > $mnt ? timer : $mnt )) # reset count
|
||||
while [ $count -gt 0 ] && [[ $battery_status == "Discharging"* ]]; do
|
||||
for battery in /sys/class/power_supply/BAT*; do battery_status=$(< "$battery/status") ; done
|
||||
if [[ $battery_status != "Discharging" ]] ; then break ; fi
|
||||
fn_notify "-t 5000 -r 69 " "CRITICAL" "Battery Critically Low" "$battery_percentage% is critically low. Device will execute $execute_critical in $((count/60)):$((count%60)) ."
|
||||
fn_notify "-t 2000 -r 69 " "CRITICAL" "Battery Critically Low" "$battery_percentage% is critically low. Device will execute $execute_critical in $((count/60)):$((count%60)) ."
|
||||
count=$((count-1))
|
||||
sleep 1
|
||||
done
|
||||
[ $count -eq 0 ] && fn_action
|
||||
elif [[ "$battery_percentage" -le "$battery_low_threshold" ]] && [[ "$battery_status" == "Discharging" ]] && (( (last_notified_percentage - battery_percentage) >= $interval )); then if $verbose; then echo "Prompt:LOW: $battery_low_threshold $battery_status $battery_percentage" ; fi
|
||||
fn_notify "-t 5000 " "CRITICAL" "Battery Low" "Battery is at $battery_percentage%. Connect the charger."
|
||||
fn_notify "-t 2000 " "CRITICAL" "Battery Low" "Battery is at $battery_percentage%. Connect the charger."
|
||||
last_notified_percentage=$battery_percentage
|
||||
fi
|
||||
}
|
||||
@@ -71,7 +71,7 @@ case "$battery_status" in # Handle the power supply status
|
||||
if [[ "$prev_status" != "Discharging" ]] || [[ "$prev_status" == "Full" ]] ; then
|
||||
prev_status=$battery_status
|
||||
urgency=$([[ $battery_percentage -le "$battery_low_threshold" ]] && echo "CRITICAL" || echo "NORMAL")
|
||||
fn_notify "-t 5000 -r 54321 " "$urgency" "Charger Plug OUT" "Battery is at $battery_percentage%."
|
||||
fn_notify "-t 2000 -r 54321 " "$urgency" "Charger Plug OUT" "Battery is at $battery_percentage%."
|
||||
$execute_discharging
|
||||
fi
|
||||
fn_percentage
|
||||
@@ -81,7 +81,7 @@ case "$battery_status" in # Handle the power supply status
|
||||
prev_status=$battery_status
|
||||
count=$(( timer > $mnt ? timer : $mnt )) # reset count
|
||||
urgency=$([[ "$battery_percentage" -ge $unplug_charger_threshold ]] && echo "CRITICAL" || echo "NORMAL")
|
||||
fn_notify "-t 5000 -r 54321 " "$urgency" "Charger Plug In" "Battery is at $battery_percentage%."
|
||||
fn_notify "-t 2000 -r 54321 " "$urgency" "Charger Plug In" "Battery is at $battery_percentage%."
|
||||
$execute_charging
|
||||
fi
|
||||
fn_percentage
|
||||
@@ -90,7 +90,7 @@ case "$battery_status" in # Handle the power supply status
|
||||
if [[ $battery_status != "Discharging" ]]; then
|
||||
now=$(date +%s)
|
||||
if [[ "$prev_status" == *"harging"* ]] || ((now - lt >= $((notify*60)) )); then
|
||||
fn_notify "-t 5000 -r 54321" "CRITICAL" "Battery Full" "Please unplug your Charger"
|
||||
fn_notify "-t 2000 -r 54321" "CRITICAL" "Battery Full" "Please unplug your Charger"
|
||||
prev_status=$battery_status lt=$now
|
||||
$execute_charging
|
||||
fi
|
||||
|
||||
@@ -20,6 +20,17 @@ blur (){
|
||||
fi
|
||||
}
|
||||
|
||||
animation() {
|
||||
STATE=$(hyprctl -j getoption animations:enabled | jq ".int")
|
||||
if [ "${STATE}" = "1" ]; then
|
||||
hyprctl keyword animations:enabled 0
|
||||
noti_n "Disable animation"
|
||||
else
|
||||
hyprctl keyword animations:enabled 1
|
||||
noti_n "Enable animation"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
rainbowborder() {
|
||||
function random_hex() {
|
||||
|
||||
@@ -23,6 +23,7 @@ declare -A menu_options=(
|
||||
["gm GameMode"]="$RunCMD gamemode"
|
||||
["bl ChangeBlur"]="$RunCMD blur"
|
||||
["flt Float all window"]="hyprctl dispatch workspaceopt allfloat"
|
||||
["hpa Toggle hyprland animation"]="$RunCMD animation"
|
||||
["op1 enable_opaque"]="$RunCMD enable_opaque"
|
||||
["op0 disable_opaque"]="$RunCMD disable_opaque"
|
||||
#wallpaper
|
||||
|
||||
Reference in new issue
Block a user