-- vim: ts=4 sw=4 noet ai cindent syntax=lua {% if grains['host'] == 'magnesium' %} {% set ifdev = ['br0'] %} {% elif grains['host'] == 'platinum' %} {% set ifdev = ['wlp2s0'] %} {% elif grains['host'] == 'barium' %} {% set ifdev = ['enp6s0'] %} {% elif grains['host'] == 'dubnium' %} {% set ifdev = ['enp4s0'] %} {% elif grains['host'] == 'rhenium' %} {% set ifdev = ['wlp2s0'] %} {% elif grains['host'] == 'baryte' %} {% set ifdev = ['enp0s20f0u4u2c2'] %} {% else %} {% set ifdev = ['eth0'] %} {% endif %} conky.config = { out_to_x = false, own_window = false, out_to_console = true, short_units = true, update_interval = 0.5, background = false, max_text_width = 0, total_run_times = 0, short_units = true, if_up_strictness = 'address', use_spacer = 'left', cpu_avg_samples = 2, }; conky.text = [[ [ ${if_match "${exec cat ~/.local/share/pomodoro}"!="done"} {"full_text": "Pomodoro: ${exec cat ~/.local/share/pomodoro}", "color": "\#ea0501"}, ${endif} {% if grains['host'] == 'barium' %} {"full_text": "Tea: ${execi 120 tail -n 1 ~/.local/share/teatimer.log}s", "color": "\#ffffff"}, {% endif %} {"full_text": "~ ${fs_free /home}", "color": "\#ffffff"}, {"full_text": "/ ${fs_free /root}", "color": "\#ffffff"}, {"full_text": "IO r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"}, {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"}, {% for dev in ifdev %} ${if_match "${addr {{ dev }}}"!="No Address"} { "full_text": "{{ dev }} d:${downspeed {{ dev }}} u:${upspeed {{ dev }}} ${addr {{ dev }}}", "color": ${if_match "${addr {{ dev }}}"=="No Address"} "\#ff0000" ${else} "\#00ff00" ${endif} }, ${endif} {% endfor %} ${if_match "${addr tun0}"!="No Address"} {"full_text": "VPN", "color": "\#00ff00"}, ${endif} { "full_text": "RAM ${memperc}%", "color": ${if_match ${memperc}<90} "\#ffffff" ${else} "\#ff0000" ${endif} }, {% if grains['host'] in ['platinum', 'rhenium', 'barium', 'baryte'] %} { "full_text": "BAT ${battery_short} ${battery_time}", "color": ${if_match ${battery_percent}<20} "\#ff0000" ${else} "\#00ff00" ${endif} }, {% endif %} {"full_text": "${time %Y-%m-%d %H:%M}", "color": "\#ffffff"} ], ]];