Compare commits
1
Commits
main
...
1b4bfa3e7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b4bfa3e7e |
@@ -23,7 +23,7 @@
|
||||
"network",
|
||||
"power-profiles-daemon",
|
||||
"cpu",
|
||||
//"memory",
|
||||
"custom/memtmp",
|
||||
//"temperature",
|
||||
"backlight",
|
||||
//"sway/language",
|
||||
@@ -169,6 +169,13 @@
|
||||
"tooltip": false,
|
||||
"on-click": "alacritty -e /home/tgrosinger/.local/share/mise/shims/btop"
|
||||
},
|
||||
"custom/memtmp": {
|
||||
"exec": "bash $HOME/.config/waybar/memtmp.sh",
|
||||
"return-type": "json",
|
||||
"interval": 5,
|
||||
"format": "{}",
|
||||
"on-click": "alacritty -e /home/tgrosinger/.local/share/mise/shims/btop"
|
||||
},
|
||||
"memory": {
|
||||
"format": "{}% "
|
||||
},
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
# Waybar custom module: available RAM (GiB) and current /tmp usage.
|
||||
#
|
||||
# Available RAM uses MemAvailable, the kernel's honest "allocatable without
|
||||
# swapping" figure. /tmp is tmpfs, so its used space is live RAM consumption;
|
||||
# df -h auto-scales the unit (it is usually in the MB range).
|
||||
set -euo pipefail
|
||||
|
||||
MEM_ICON=$''
|
||||
TMP_ICON=$''
|
||||
|
||||
avail_gib=$(awk '/^MemAvailable:/ {printf "%.1f", $2/1048576}' /proc/meminfo)
|
||||
read -r tmp_used tmp_size < <(df -h --output=used,size /tmp | awk 'NR==2 {print $1, $2}')
|
||||
|
||||
printf '{"text":"%sG %s %s %s","tooltip":"RAM available: %s GiB\\n/tmp used: %s of %s"}\n' \
|
||||
"$avail_gib" "$MEM_ICON" "$tmp_used" "$TMP_ICON" \
|
||||
"$avail_gib" "$tmp_used" "$tmp_size"
|
||||
@@ -1,7 +1,7 @@
|
||||
@import "latte.css";
|
||||
|
||||
* {
|
||||
font-family: 'JetBrainsMono';
|
||||
font-family: 'JetBrainsMono Nerd Font';
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ button:hover {
|
||||
#battery,
|
||||
#cpu,
|
||||
#memory,
|
||||
#custom-memtmp,
|
||||
#disk,
|
||||
#temperature,
|
||||
#backlight,
|
||||
|
||||
Reference in New Issue
Block a user