Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
71df4ffd
Unverified
Commit
71df4ffd
authored
Jul 17, 2018
by
Dylan Araps
Committed by
GitHub
Jul 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1056 from julianaito/master
battery/OpenBSD: improved charge%, adds status
parents
22df76c3
13328742
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
neofetch
neofetch
+11
-4
No files found.
neofetch
View file @
71df4ffd
...
...
@@ -3176,12 +3176,19 @@ get_battery() {
;;
"OpenBSD"* | "Bitrig"*)
battery0full="$(sysctl -n hw.sensors.acpibat0.watthour0)"
battery0full="${battery0full/ Wh*}"
battery0full="$(sysctl -n hw.sensors.acpibat0.watthour0\
hw.sensors.acpibat0.amphour0)"
battery0full="${battery0full%% *}"
battery0now="$(sysctl -n hw.sensors.acpibat0.watthour3)"
battery0now="${battery0now/ Wh*}"
battery0now="$(sysctl -n hw.sensors.acpibat0.watthour3\
hw.sensors.acpibat0.amphour3)"
battery0now="${battery0now%% *}"
state="$(sysctl -n hw.sensors.acpibat0.raw0)"
state="${state##? (battery }"
state="${state%)*}"
[[ "${state}" == "charging" ]] && battery_state="charging"
[[ "$battery0full" ]] && \
battery="$((100 * ${battery0now/\.} / ${battery0full/\.}))%"
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment