]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/conky/files/conkyrc
Allow mulitple network interfaces in conky
[max/saltfiles.git] / states / conky / files / conkyrc
1 -- vim: ts=4 sw=4 noet ai cindent syntax=lua
2
3 {% if grains['host'] == 'magnesium' %}
4         {% set ifdev = ['br0'] %}
5 {% elif grains['host'] == 'platinum' %}
6         {% set ifdev = ['wlp2s0'] %}
7 {% elif grains['host'] == 'barium' %}
8         {% set ifdev = ['enp3s0f1', 'wlp4s0'] %}
9 {% elif grains['host'] == 'dubnium' %}
10         {% set ifdev = ['enp4s0'] %}
11 {% elif grains['host'] == 'rhenium' %}
12         {% set ifdev = ['wlp2s0'] %}
13 {% else %}
14         {% set ifdev = ['eth0'] %}
15 {% endif %}
16
17 conky.config = {
18         out_to_x = false,
19         own_window = false,
20         out_to_console = true,
21         short_units = true,
22         update_interval = 0.5,
23         background = false,
24         max_text_width = 0,
25         total_run_times = 0,
26         short_units = true,
27         if_up_strictness = 'address',
28         use_spacer = 'left',
29
30         cpu_avg_samples = 2,
31 };
32
33 conky.text = [[
34 [
35   {"full_text": "Home ${fs_free /home} Free", "color": "\#ffffff"},
36   {"full_text": "Root ${fs_free /root} Free", "color": "\#ffffff"},
37   {"full_text": "Disk r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"},
38   {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"},
39   {% for dev in ifdev %}
40   {
41       "full_text": 
42                 "d:${downspeed {{ dev }}} u:${upspeed {{ dev }}} ${addr {{ dev }}}", 
43       "color":
44         ${if_match "${addr {{ dev }}}"=="No Address"}
45           "\#ff0000"
46         ${else}
47           "\#00ff00"
48         ${endif}
49   },
50   {% endfor %}
51   ${if_match "${addr tun0}"!="No Address"}
52         {"full_text": "VPN", "color": "\#00ff00"},
53   ${endif}
54   {
55         "full_text": "RAM ${memperc}%", 
56         "color": 
57           ${if_match ${memperc}<90}
58             "\#ffffff"
59           ${else}
60                 "\#ff0000"
61           ${endif} 
62   },
63 {% if grains['host'] == 'platinum' or grains['host'] == 'rhenium' or grains['host'] == 'barium' %}
64         {
65           "full_text": "BAT ${battery_short} ${battery_time}", 
66           "color": 
67           ${if_match ${battery_percent}<20}
68             "\#ff0000"
69           ${else}
70                 "\#00ff00"
71           ${endif}
72         },
73 {% endif %}
74   {"full_text": "${time}", "color": "\#ffffff"}
75 ],
76 ]];
77