Conky doesn't want to work with $swapgraph

For short, i have
${color}${swapgraph}
string in config file, but for some reason Conky seems to not know such var and does not render any graph… just raw string from .conf

I also tried to use something like

${color}${lua_graph $swapperc}
or
${color}${execgraph $swapperc}

which also gave 0 result

Can somebody suggest me working option please?

That doesn’t seem to exist, but ${swapbar} does.

That’s not what i need, i want some graph like ${memgraph}

${execgraph} takes a bash command or script.
${lua-graph} takes a lua function.

${swapperc} is a variable.


How about something like this?

${execgraph ~/.config/conky/swap.sh FF0000 FFFF00 1}

Save this as ~/.config/conky/swap.sh

#!/usr/bin/bash

total=$(grep SwapTotal /proc/meminfo | awk '{print $2}' )
free=$(grep SwapFree /proc/meminfo | awk '{print $2}' )

printf %.2f $(echo "scale=4; (($total - $free) / $total) * 100" | bc)

Make it executable.

chmod +x ~/.config/conky/swap.sh

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.