Browse Source

Merge branch 'master' into master

main
Joe Standring 4 years ago
committed by GitHub
parent
commit
2460c76843
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions
  1. +6
    -0
      README.md
  2. +26
    -0
      bar-functions/dwm_loadavg.sh
  3. +2
    -0
      dwm_bar.sh

+ 6
- 0
README.md View File

@ -23,6 +23,7 @@ A modular statusbar for dwm
- [dwm_transmission](#dwm_transmission)
- [dwm_backlight](#dwm_backlight)
- [dwm_connman](#dwm_connman)
- [dwm_loadavg](#dwm_loadavg)
- [Installation](#installation)
- [Reccomendations](#reccomendations)
- [Usage](#usage)
@ -147,6 +148,11 @@ Shows network information IP, SSID, WLan strength (if connected to WLan) using c
[🌐 192.169.189.12 HomeNetworkName 53%]
```
Dependencies: ```connman```
### dwm_loadavg
Displays the average system load
```
[⏱ 0.14 0.17 0.18]
```
## Installation
1. Clone and enter the repository:
```


+ 26
- 0
bar-functions/dwm_loadavg.sh View File

@ -0,0 +1,26 @@
#!/bin/sh
# A dwm_bar function to read the average system load
# Alvar Penning <post@0x21.biz>
# GNU GPLv3
dwm_loadavg () {
# LOAD_FIELDS specifies the load average values to be displayed. Values
# within 1-3 are allowed, passed as a range (-) or comma-separated.
# - 1: load average within the last minute
# - 2: load average within the last five minutes
# - 3: load average within the last fifteen minutes
LOAD_FIELDS=1,2,3
LOAD_AVG=$(cut -d " " -f ${LOAD_FIELDS} /proc/loadavg)
printf "%s" "$SEP1"
if [ "$IDENTIFIER" = "unicode" ]; then
printf "⏱ %s" "$LOAD_AVG"
else
printf "AVG %s" "$LOAD_AVG"
fi
printf "%s\n" "$SEP2"
}
dwm_loadavg

+ 2
- 0
dwm_bar.sh View File

@ -41,10 +41,12 @@ export SEP2="]"
. "$DIR/bar-functions/dwm_ccurse.sh"
. "$DIR/bar-functions/dwm_date.sh"
. "$DIR/bar-functions/dwm_connman.sh"
. "$DIR/bar-functions/dwm_loadavg.sh"
# Update dwm status bar every second
while true
do
xsetroot -name "$(dwm_connman)$(dwm_countdown)$(dwm_alarm.sh)$(dwm_transmission)$(dwm_cmus)$(dwm_mpc)$(dwm_spotify)$(dwm_resources)$(dwm_battery)$(dwm_mail)$(dwm_backlight)$(dwm_alsa)$(dwm_pulse)$(dwm_weather)$(dwm_vpn)$(dwm_networkmanager)$(dwm_keyboard)$(dwm_ccurse)$(dwm_date)"
xsetroot -name "$(dwm_countdown)$(dwm_alarm.sh)$(dwm_transmission)$(dwm_cmus)$(dwm_mpc)$(dwm_spotify)$(dwm_resources)$(dwm_battery)$(dwm_mail)$(dwm_backlight)$(dwm_alsa)$(dwm_pulse)$(dwm_weather)$(dwm_vpn)$(dwm_networkmanager)$(dwm_keyboard)$(dwm_ccurse)$(dwm_date)$(dwm_loadavg)"
sleep 1
done

Loading…
Cancel
Save