mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2024-11-10 02:39:40 +00:00
Add commented quick controls to test/show battety status
This commit is contained in:
parent
56140d624f
commit
10f0e3eb91
|
@ -1,5 +1,5 @@
|
|||
(defpoll battery
|
||||
:interval "2s"
|
||||
:interval "1s"
|
||||
:initial '{"percent":"0","plugged":"false","status":"N/A","capacity_icon":"","extra_icon":"","manufacturer":"N/A","model_name":"N/A","technology":"N/A","energy_now":"0","enerfy_full":"0","enerfy_full_design":"0","cycle_count":"0","critical":"false","full":"false"}'
|
||||
`scripts/battery`)
|
||||
|
||||
|
|
|
@ -45,6 +45,14 @@ capacity="$(get_bat_info capacity)"
|
|||
status="$(get_bat_info status)"
|
||||
[ "$(get_adp_info online)" -eq 1 ] && adp_connected="true" || adp_connected="false"
|
||||
|
||||
# Quick overrides to showcase how battery works
|
||||
# capacity=100
|
||||
# adp_connected="true"
|
||||
# status="Charging"
|
||||
# status="Not charging"
|
||||
# status="Discharging"
|
||||
|
||||
|
||||
full="false"
|
||||
capacity_icon="$(pick_icon "$capacity" 0 100 "${CAPACITY_ICONS[@]}")"
|
||||
|
||||
|
@ -61,6 +69,7 @@ fi
|
|||
|
||||
[ "$capacity" -le "$CRITICAL_PERCENTAGE" ] && critical="true" || critical="false"
|
||||
|
||||
|
||||
jq -n -c --monochrome-output \
|
||||
--arg percent "$capacity" \
|
||||
--arg plugged "$adp_connected" \
|
||||
|
|
Loading…
Reference in a new issue