]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/conky/files/conkyrc
Make conky output more space efficient
[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 {% if grains['host'] == 'barium' %}
36   {"full_text": "Last Tea: ${execi 120 tail -n 1 ~/.local/share/teatimer.log}s", "color": "\#ffffff"},
37 {% endif %}
38   {"full_text": "Home ${fs_free /home}", "color": "\#ffffff"},
39   {"full_text": "Root ${fs_free /root}", "color": "\#ffffff"},
40   {"full_text": "Disk r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"},
41   {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"},
42   {% for dev in ifdev %}
43   ${if_match "${addr {{ dev }}}"!="No Address"}
44   {
45       "full_text": 
46                 "{{ dev }} d:${downspeed {{ dev }}} u:${upspeed {{ dev }}} ${addr {{ dev }}}", 
47       "color":
48         ${if_match "${addr {{ dev }}}"=="No Address"}
49           "\#ff0000"
50         ${else}
51           "\#00ff00"
52         ${endif}
53   },
54   ${endif}
55   {% endfor %}
56   ${if_match "${addr tun0}"!="No Address"}
57         {"full_text": "VPN", "color": "\#00ff00"},
58   ${endif}
59   {
60         "full_text": "RAM ${memperc}%", 
61         "color": 
62           ${if_match ${memperc}<90}
63             "\#ffffff"
64           ${else}
65                 "\#ff0000"
66           ${endif} 
67   },
68 {% if grains['host'] == 'platinum' or grains['host'] == 'rhenium' or grains['host'] == 'barium' %}
69         {
70           "full_text": "BAT ${battery_short} ${battery_time}", 
71           "color": 
72           ${if_match ${battery_percent}<20}
73             "\#ff0000"
74           ${else}
75                 "\#00ff00"
76           ${endif}
77         },
78 {% endif %}
79   {"full_text": "${time %Y-%m-%d %H:%M}", "color": "\#ffffff"}
80 ],
81 ]];
82