Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Added get_battery to display battery status #94

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pfetch
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,11 @@ get_wm() {
log wm "$wm" >&6
}

get_battery(){
battery_level=$(cat /sys/class/power_supply/BAT*/capacity)
battery_status=$(cat /sys/class/power_supply/BAT*/status)
log battery "${battery_level}% (${battery_status})" >&6
}

get_de() {
# This only supports Xorg related desktop environments though
Expand Down