Code Sample |
#!/bin/bash # Simple battery script called from torsmo # modprobe battery needs to be done somewhere 1st # installing beep is one way to make a noise from the background MAXCAP=$(awk '/^last full capacity:/ {print $4}' /proc/acpi/battery/BAT0/info) REMAINING=$(awk '/^remaining capacity:/ {print $3}' /proc/acpi/battery/BAT0/state) CHARGING=$(awk '/^charging state:/ {print $3}' /proc/acpi/battery/BAT0/state) (( TEST = REMAINING * 5 )) if [ $CHARGING = discharging ]; then echo "$REMAINING/$MAXCAP mAh" if [ $TEST -le $MAXCAP ]; then beep -l 400 -r 2 popup.lua "LOW BATTERY ALERT! Charge remaining = $REMAINING mAh Less than 20 per cent full. Recharge now!" fi else echo "AC" fi |
Code Sample |
${color #ddd}Battery: $color ${execi 60 ~/.battery_script} |
Code Sample |
${color #ddd}Battery: $color ${battery} |
Code Sample |
${color #ddd}Battery: $color ${battery} ${execi 60 ~/.battery_sh} |
Code Sample |
${color #ddd}Temp: $color ${acpitemp}degC |
Code Sample |
cat /proc/acpi/battery/BAT0/info present: yes design capacity: 42000 mWh last full capacity: 20740 mWh battery technology: rechargeable design voltage: 11100 mV design capacity warning: 4200 mWh design capacity low: 1272 mWh capacity granularity 1: 420 mWh capacity granularity 2: 420 mWh model number: DELL 0006T0 serial number: 404 battery type: LION OEM info: Sanyo |
Quote |
Do you mean to modify it to read as follows? |