Skip to content

ram

Memory and swap usage.

Add it to your layout with ram:

toml
[[bar.layout]]
monitor = "*"
right = ["ram"]

General

FieldTypeDefaultDescription
poll-interval-msu645000Polling interval in milliseconds.
formatstring"{{ percent }}%"Format string for the label.
icon-namestring"ld-memory-stick-symbolic"Icon name.
border-showboolfalseDisplay border around button.
icon-showbooltrueDisplay module icon.
label-showbooltrueDisplay label.
label-max-lengthu320Max label characters before truncation. Set to 0 to disable.
thresholdsarray of ThresholdEntry[]Dynamic color thresholds based on RAM usage percentage.
More about poll-interval-ms

Faster polling increases CPU usage.

More about format

Memory Placeholders

  • {{ percent }} - Memory usage as integer (0-100)
  • {{ used_gib }} - Used memory in GiB (e.g., "7.2")
  • {{ total_gib }} - Total memory in GiB (e.g., "16.0")
  • {{ available_gib }} - Available memory in GiB (e.g., "8.8")

Swap Placeholders

  • {{ swap_percent }} - Swap usage as integer (0-100)
  • {{ swap_used_gib }} - Used swap in GiB
  • {{ swap_total_gib }} - Total swap in GiB

Examples

  • "{{ percent }}%" - "45%"
  • "{{ used_gib }}/{{ total_gib }} GiB" - "7.2/16.0 GiB"
  • "{{ percent }}% (Swap: {{ swap_percent }}%)" - "45% (Swap: 12%)"
More about thresholds

Entries are checked in order; the last matching entry wins for each color slot. Use above for high-value warnings (e.g., high memory usage).

Example

toml
[[modules.ram.thresholds]]
above = 80
icon-color = "status-warning"
label-color = "status-warning"

[[modules.ram.thresholds]]
above = 95
icon-color = "status-error"
label-color = "status-error"

Colors

FieldTypeDefaultDescription
border-colorColorValue"green"Border color token.
icon-colorColorValue"auto"Icon foreground color.
icon-bg-colorColorValue"green"Icon container background color token.
label-colorColorValue"green"Label text color token.
button-bg-colorColorValue"bg-surface-elevated"Button background color token.

Click actions

FieldTypeDefaultDescription
left-clickClickAction""Action on left click.
right-clickClickAction""Action on right click.
middle-clickClickAction""Action on middle click.
scroll-upClickAction""Action on scroll up.
scroll-downClickAction""Action on scroll down.

Default configuration

toml
[modules.ram]
poll-interval-ms = 5000
format = "{{ percent }}%"
icon-name = "ld-memory-stick-symbolic"
border-show = false
border-color = "green"
icon-show = true
icon-color = "auto"
icon-bg-color = "green"
label-show = true
label-color = "green"
label-max-length = 0
button-bg-color = "bg-surface-elevated"
left-click = ""
right-click = ""
middle-click = ""
scroll-up = ""
scroll-down = ""
thresholds = []

Released under the MIT License.