11 lines
363 B
Text
11 lines
363 B
Text
|
#!/bin/sh
|
||
|
|
||
|
# battery percentage
|
||
|
battpct="$(upower --show-info $(upower --enumerate | grep -i 'BAT') | grep -E "percentage" | awk '{print $2}')"
|
||
|
battpct="${battpct%\%}"
|
||
|
|
||
|
# battery status (charging/charged/etc)
|
||
|
batstat="$(upower --show-info $(upower --enumerate | grep -i 'BAT') | grep -E "state" | awk '{print $2}')"
|
||
|
|
||
|
notify-send "Battery: ${battpct}% ($batstat)"
|