I was trying to apply these instructions on how to automatically dim brightness when battery is low, but in the answer, this command didn't work with me
> percent_left=$((100 * `cat /sys/class/power_supply/BAT0/charge_now` / ` cat /sys/class/power_supply/BAT0/charge_full`))
It said
cat: /sys/class/power_supply/BAT0/charge_now: No such file or directory
cat: /sys/class/power_supply/BAT0/charge_full: No such file or directory
bash: 100 * / : syntax error: operand expected (error token is "/ ")
Any solution!! I'm a beginner Ubuntu user
Install acpi:
View the battery percentage:
Automatically dim brightness if battery is low:
Here, VGA-1 is the screen. Value of brightness is 50%. (--brightness .5)
I need your feedback ;)
I have the same problem on my system:
The reason is sometimes it is
BAT0
and sometimes it isBAT1
. The solution is to search for either one like this:The
BAT*
wildcard lets it find eitherBAT0
orBAT1
.The complete command then: