diff --git a/README.md b/README.md index b29397c..3ead78b 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,14 @@ Adjust `~/.config/i3blocks/config` to control i3 status bar output. Finally relo # Requirements The following shows the requirements for each script: ```bash -audio amixer +audio,mic amixer battery none, searches in /sys/class/power_supply/BAT... cpu top datetime date ip curl -ram none, searches in /proc/meminfo +ram,swap none, searches in /proc/meminfo storage df +backlight none, searches in /sys/class/backlight, intel and ati/amd supported ``` # Roadmap @@ -33,7 +34,7 @@ storage df - [x] cpu - [x] backlight - [x] microphone -- [ ] swap +- [x] swap - [ ] wifi/ethernet/bluetooth - [ ] external storage with mount - [ ] ethernet bandwith diff --git a/config b/config index 9f29348..f59034e 100644 --- a/config +++ b/config @@ -14,6 +14,10 @@ label=storage [ram] label=ram +[ram] +label=swap +instance=swap + [cpu] label=cpu diff --git a/ram b/ram index e3ba25b..5b44118 100755 --- a/ram +++ b/ram @@ -1,6 +1,7 @@ #!/bin/bash -gawk ' - /^MemAvailable:/ { +[[ ${BLOCK_INSTANCE} == 'swap' ]] && TYPE="SwapFree" || TYPE="MemAvailable" +gawk -v type="$TYPE" ' + $0 ~ type { mfg=$2/1024^2 mfm=$2/1024 }