Configuration file for dwm-bar on macbook air
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
709 B

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