]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/conky/files/conkyrc
Create dirs
[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 = ['enp6s0'] %}
9 {% elif grains['host'] == 'dubnium' %}
10         {% set ifdev = ['enp4s0'] %}
11 {% elif grains['host'] == 'rhenium' %}
12         {% set ifdev = ['wlp2s0'] %}
13 {% elif grains['host'] == 'baryte' %}
14         {% set ifdev = ['enp0s20f0u2u2c2'] %}
15 {% else %}
16         {% set ifdev = ['eth0'] %}
17 {% endif %}
18
19 conky.config = {
20         out_to_x = false,
21         own_window = false,
22         out_to_console = true,
23         short_units = true,
24         update_interval = 0.5,
25         background = false,
26         max_text_width = 0,
27         total_run_times = 0,
28         short_units = true,
29         if_up_strictness = 'address',
30         use_spacer = 'left',
31
32         cpu_avg_samples = 2,
33 };
34
35 conky.text = [[
36 [
37   ${if_match "${exec cat ~/.local/share/pomodoro}"!="done"}
38     {"full_text": "Pomodoro: ${exec cat ~/.local/share/pomodoro}", "color": "\#ea0501"},
39   ${endif}
40 {% if grains['host'] in ['barium', 'baryte'] %}
41   {"full_text": "Tea: ${execi 60 tail -n 1 ~/.local/share/teatimer.log}s", "color": "\#ffffff"},
42 {% endif %}
43   {"full_text": "~ ${fs_free /home}", "color": "\#ffffff"},
44   {"full_text": "/ ${fs_free /root}", "color": "\#ffffff"},
45   {"full_text": "IO r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"},
46   {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"},
47   {% for dev in ifdev %}
48   ${if_match "${addr {{ dev }}}"!="No Address"}
49   {
50       "full_text": 
51                 "{{ dev }} d:${downspeed {{ dev }}} u:${upspeed {{ dev }}} ${addr {{ dev }}}", 
52       "color":
53         ${if_match "${addr {{ dev }}}"=="No Address"}
54           "\#ff0000"
55         ${else}
56           "\#00ff00"
57         ${endif}
58   },
59   ${endif}
60   {% endfor %}
61   ${if_match "${addr tun0}"!="No Address"}
62         {"full_text": "VPN", "color": "\#00ff00"},
63   ${endif}
64   {
65         "full_text": "RAM ${memperc}%", 
66         "color": 
67           ${if_match ${memperc}<90}
68             "\#ffffff"
69           ${else}
70                 "\#ff0000"
71           ${endif} 
72   },
73 {% if grains['host'] in ['platinum', 'rhenium', 'barium', 'baryte'] %}
74         {
75           "full_text": "BAT ${battery_short} ${battery_time}", 
76           "color": 
77           ${if_match ${battery_percent}<20}
78             "\#ff0000"
79           ${else}
80                 "\#00ff00"
81           ${endif}
82         },
83 {% endif %}
84   {"full_text": "${time %Y-%m-%d %H:%M}", "color": "\#ffffff"}
85 ],
86 ]];
87