1 2 3 4 5 6 7 8
#!/bin/sh state=$(acpi | cut -d ' ' -f 3 | sed -r 's/,//g') output=$(acpi | cut -d' ' -f 4,5 | sed -r 's/,//g') if [ "$state" == "Charging" ]; then echo " $output" else echo " $output" fi
You can clone a snippet to your computer for local editing. Learn more.