File tree Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Expand file tree Collapse file tree 3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,15 @@ Customize label
119
119
set -g @dracula-cpu-usage-label " CPU"
120
120
```
121
121
122
+ Show system load average instead of CPU usage percentage (default)
123
+
124
+ ``` bash
125
+ set -g @dracula-cpu-display-load true
126
+ ```
127
+
128
+ CPU usage percentage (default) - in percentage (output: %)
129
+ Load average – is the average system load calculated over a given period of time of 1, 5 and 15 minutes (output: x.x x.x x.x)
130
+
122
131
#### gpu-usage options
123
132
124
133
Customize label
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ Configuration and options can be found at [draculatheme.com/tmux](https://dracul
21
21
* Git branch and status
22
22
* Battery percentage and AC power connection status
23
23
* Refresh rate control
24
- * CPU usage
24
+ * CPU usage (percentage or load average)
25
25
* RAM usage
26
26
* GPU usage
27
27
* Color code based on if prefix is active or not
Original file line number Diff line number Diff line change @@ -27,13 +27,30 @@ get_percent()
27
27
esac
28
28
}
29
29
30
- main ()
31
- {
30
+ get_load () {
31
+ case $( uname -s) in
32
+ Linux | Darwin)
33
+ loadavg=$( uptime | awk -F' [a-z]:' ' { print $2}' | sed ' s/,//g' )
34
+ echo $loadavg
35
+ ;;
36
+
37
+ CYGWIN* | MINGW32* | MSYS* | MINGW* )
38
+ # TODO - windows compatability
39
+ ;;
40
+ esac
41
+ }
42
+
43
+ main () {
32
44
# storing the refresh rate in the variable RATE, default is 5
33
45
RATE=$( get_tmux_option " @dracula-refresh-rate" 5)
34
- cpu_label=$( get_tmux_option " @dracula-cpu-usage-label" " CPU" )
35
- cpu_percent=$( get_percent)
36
- echo " $cpu_label $cpu_percent "
46
+ cpu_load=$( get_tmux_option " @dracula-cpu-display-load" false)
47
+ if [ " $cpu_load " = true ]; then
48
+ echo " $( get_load) "
49
+ else
50
+ cpu_label=$( get_tmux_option " @dracula-cpu-usage-label" " CPU" )
51
+ cpu_percent=$( get_percent)
52
+ echo " $cpu_label $cpu_percent "
53
+ fi
37
54
sleep $RATE
38
55
}
39
56
You can’t perform that action at this time.
0 commit comments