alpha
Login
or
Join now
shuuji3.xyz
/
bitbar-plugins
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/shuuji3/bitbar-plugins. Personal plugins and settings for BitBar (menubar extension for macOS)
getbitbar.com/
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Remove cpu-load plugin.
author
TAKAHASHI Shuuji
date
6 years ago
(Apr 27, 2020, 1:04 AM +0900)
commit
fce6b5cc
fce6b5cc39ac01cb49cf202ac5c2fdf7f8784516
parent
cfbc8bd0
cfbc8bd0bc6623bbaa465442e695374ff89cbbe4
-19
1 changed file
Expand all
Collapse all
Unified
Split
cpu-load.5s.sh
-19
cpu-load.5s.sh
Reviewed
···
1
1
-
#!/usr/bin/env bash
2
2
-
3
3
-
# <bitbar.title>CPU Load</bitbar.title>
4
4
-
# <bitbar.version>v1.0</bitbar.version>
5
5
-
# <bitbar.author>Paul W. Rankin</bitbar.author>
6
6
-
# <bitbar.author.github>rnkn</bitbar.author.github>
7
7
-
# <bitbar.desc>Shows CPU load as a percentage (without using top).</bitbar.desc>
8
8
-
# <bitbar.image>http://photos.paulwrankin.com/screenshots/cpu-load.png</bitbar.image>
9
9
-
# <bitbar.dependencies>bash</bitbar.dependencies>
10
10
-
11
11
-
# BitBar CPU Load plugin
12
12
-
13
13
-
ncpu=$(sysctl -n hw.logicalcpu)
14
14
-
total=$(ps -Ao %cpu= | paste -sd+ - | bc)
15
15
-
usage=$(echo "scale = 2; $total / $ncpu" | bc)
16
16
-
17
17
-
printf "%0.1f%%\n" "$usage"
18
18
-
echo "---"
19
19
-
echo "Refresh | refresh=true"