Skip to content

Plugin for waybar that displays system info as vertical bars

License

Notifications You must be signed in to change notification settings

acidnik/waybar-sysinfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waybar sysinfo plugin

This is a plugin for waybar that displays system information as vertical bars. Inspired by xfce-systemload plugin

This plugin can display following information:

  • cpu load, including average load, most loaded core and all cores
  • used memory and swap
  • network activity
  • temperature - max of chosen sensors or all

With reasonable settings

screenshot

With unreasonable settings

screenshot, wild mode

Installation

For now only manual installation

cargo build --release
cp target/release/libwaybar_sysinfo.so ~/.local/lib/

Config

"modules-right": [
    "cffi/sysinfo",
]
"cffi/sysinfo": {
    "module_path": "/home/USER/.local/lib/libwaybar_sysinfo.so",
    // refresh interval in milliseconds
    "interval_ms": 5000,
    "cpu": {
        "label": "cpu", // "cpu" is default; you could change this to an icon
        // show most loaded core, avg of all cores or all cores
        "show": ["max_core", "avg_core", "all_cores"]
    },
    "mem": {
        "label": "ram", // "ram" is default
        "show": ["mem", "swap"]
    },
    "net": {
        "label": "net", // "net" is default
        // show all networks that match this regexes
        "show": ["eno\\d+", "wlan\\d+"],
        // set a floor for the maximum throughput value
        // ("100%" on the bars, automatically adjusted upwards
        // within a sliding window)
        "floor": 1048576 // in bytes per second, default 5000
    },
    "temp": {
        "label": "temp", // "temp" is default
        // show sensor with this name. you can see the list by running `sensors`
        "show": ["Core 1"]
        // show max value for each regex
        "show_max": ["Core .*"]
    },
},

Style

This is the default config

#sysinfo .sysinfo-bar {
    padding-left: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
}

/* progress bar */
#sysinfo trough {
    min-height: 3px;
    min-width: 7px;
    border: none;
}

/* colored part of progress bar */
#sysinfo progress {
    border: none;
    min-width: 7px;
}

#sysinfo .cpu progress {
  background-color: #d20f39;
}

#sysinfo .mem progress {
  background-color: #40a02b;
}

#sysinfo .net progress {
  background-color: #1e66f5;
}

#sysinfo .temp progress {
  background-color: #df8e1d;
}

Other useful information and examples for styling:

/**
 * The whole module is selectable with `#sysinfo`
 */
#sysinfo {
  background-color: green;
}

/**
 * The separate widgets are selectable with `.sysinfo-module`
 */
#sysinfo .sysinfo-module + .sysinfo-module {
  margin-left: 10px;
}

/**
 * The separate widgets also have a class for their type
 */
#sysinfo .sysinfo-module.cpu progress {
  background-color: blue;
}

/**
 * The separate widgets also have a class for their custom label
 */
#sysinfo .sysinfo-module.my-label progress { ... }

/**
 * Bars are given classes `gte-10`...`gte-90` for how full they are,
 * allowing colors or other styling to change accordingly
 */
#sysinfo .sysinfo-bar.gte-70 progress { background-color: yellow; }
#sysinfo .sysinfo-bar.gte-80 progress { background-color: orange; }
#sysinfo .sysinfo-bar.gte-90 progress { background-color: red; }

/**
 * Bars might be rounded by default; radius can be adjusted,
 * separately for `trough` and `progress`
 */
#sysinfo trough, #sysinfo progress {
  border-radius: 0px; /* for no rounding */
  border-radius: 2px; /* for a fixed radius */
  border-radius: 1000px; /* or some other high number for as close to circular as possible */

  /* Or you can control the different corners separately */
  border-top-radius: 1000px 1000px 0px 0px; /* for curved tops and flat bottoms */
}

About

Plugin for waybar that displays system info as vertical bars

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published