Conky 设置会话数据使用

Conky 设置会话数据使用

在此处输入图片描述

如上图所示,数据使用的集成通过以下代码实现

    ${color orange}${voffset 2}${hr 1}
    ${color1}Network using vnStat "-i", "-w" and "-m"
    ${color}${goto 5}Today ${goto 100}Yesterday ${goto 225}Week ${goto 325}Month ${color 
    green}
    ${execi 300 vnstat -i eth0 | grep "today" | awk '{print $8" "substr ($9, 1, 1)}'} ${goto 
    110}${execi 300 vnstat -i eth0 | grep "yesterday" | awk '{print $8" "substr ($9, 1, 
    1)}'} ${goto 220}${execi 300 vnstat -i eth0 -w | grep "current week" | awk '{print $9" 
    "substr ($10, 1, 1)}'} ${goto 315}${execi 300 vnstat -i eth0 -m | grep "`date +"%b 
    '%y"`" | awk '{print $9" "substr ($10, 1, 1)}'}
    ${color orange}${voffset 2}${hr 1}

参考-https://askubuntu.com/questions/1459/how-can-you-monitor-total-internet-data-usage-across-reboots

现在我想要做的是将其中一个边界替换为“会话”数据使用情况,以便我可以实时监控当前会话中消耗的数据量

到目前为止我只能使用

vnstat -l 1 -i wlp3s0

监控来自我的网络(在终端上)的实时会话数据。有人能帮我把这段代码集成到 conky 中吗?谢谢。

相关内容