From: Maximilian Friedersdorff Date: Tue, 28 Apr 2020 10:22:32 +0000 (+0100) Subject: Allow mulitple network interfaces in conky X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=23402fb816511f32e8fa24b4e97a9c11fbb9f822;p=max%2Fsaltfiles.git Allow mulitple network interfaces in conky --- diff --git a/states/conky/files/conkyrc b/states/conky/files/conkyrc index 83c03a9..86d818b 100644 --- a/states/conky/files/conkyrc +++ b/states/conky/files/conkyrc @@ -1,17 +1,17 @@ -- vim: ts=4 sw=4 noet ai cindent syntax=lua {% if grains['host'] == 'magnesium' %} - {% set ifdev = 'br0' %} + {% set ifdev = ['br0'] %} {% elif grains['host'] == 'platinum' %} - {% set ifdev = 'wlp2s0' %} + {% set ifdev = ['wlp2s0'] %} {% elif grains['host'] == 'barium' %} - {% set ifdev = 'enp3s0f1' %} + {% set ifdev = ['enp3s0f1', 'wlp4s0'] %} {% elif grains['host'] == 'dubnium' %} - {% set ifdev = 'enp4s0' %} + {% set ifdev = ['enp4s0'] %} {% elif grains['host'] == 'rhenium' %} - {% set ifdev = 'wlp2s0' %} + {% set ifdev = ['wlp2s0'] %} {% else %} - {% set ifdev = 'eth0' %} + {% set ifdev = ['eth0'] %} {% endif %} conky.config = { @@ -32,23 +32,22 @@ conky.config = { conky.text = [[ [ - ${if_running mutt} - {"full_text": "${new_mails mail_aber/Inbox} new mails", "color": "\#ffa500"}, - ${endif} {"full_text": "Home ${fs_free /home} Free", "color": "\#ffffff"}, {"full_text": "Root ${fs_free /root} Free", "color": "\#ffffff"}, {"full_text": "Disk r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"}, {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"}, + {% for dev in ifdev %} { "full_text": - "d:${downspeed {{ ifdev }}} u:${upspeed {{ ifdev }}} ${addr {{ ifdev }}}", + "d:${downspeed {{ dev }}} u:${upspeed {{ dev }}} ${addr {{ dev }}}", "color": - ${if_match "${addr {{ ifdev }}}"=="No Address"} + ${if_match "${addr {{ dev }}}"=="No Address"} "\#ff0000" ${else} "\#00ff00" ${endif} }, + {% endfor %} ${if_match "${addr tun0}"!="No Address"} {"full_text": "VPN", "color": "\#00ff00"}, ${endif}