]> git.friedersdorff.com Git - max/saltfiles.git/blob - states/conky/files/conkyrc
Merge branch 'master' of https://git.friedersdorff.com/max/saltfiles
[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' %}
9 {% elif grains['host'] == 'rhenium' %}
10         {% set ifdev = 'wlp2s0' %}
11 {% else %}
12         {% set ifdev = 'eth0' %}
13 {% endif %}
14
15 conky.config = {
16         out_to_x = false,
17         own_window = false,
18         out_to_console = true,
19         short_units = true,
20         update_interval = 0.5,
21         background = false,
22         max_text_width = 0,
23         total_run_times = 0,
24         short_units = true,
25         if_up_strictness = 'address',
26         use_spacer = 'left',
27
28         cpu_avg_samples = 2,
29 };
30
31 conky.text = [[
32 [
33   ${if_running mutt} 
34     {"full_text": "${new_mails mail_aber/Inbox} new mails", "color": "\#ffa500"},
35   ${endif}
36   {"full_text": "Home ${fs_free /home} Free", "color": "\#ffffff"},
37   {"full_text": "Root ${fs_free /root} Free", "color": "\#ffffff"},
38   {"full_text": "Disk r:${diskio_read} w:${diskio_write}", "color": "\#ffffff"},
39   {"full_text": "CPU ${cpu cpu0}%", "color": "\#ffffff"},
40   {
41       "full_text": 
42                 "d:${downspeed {{ ifdev }}} u:${upspeed {{ ifdev }}} ${addr {{ ifdev }}}", 
43       "color":
44         ${if_match "${addr {{ ifdev }}}"=="No Address"}
45           "\#ff0000"
46         ${else}
47           "\#00ff00"
48         ${endif}
49   },
50   ${if_match "${addr tun0}"!="No Address"}
51         {"full_text": "VPN", "color": "\#00ff00"},
52   ${endif}
53   {
54         "full_text": "RAM ${memperc}%", 
55         "color": 
56           ${if_match ${memperc}<90}
57             "\#ffffff"
58           ${else}
59                 "\#ff0000"
60           ${endif} 
61   },
62 {% if grains['host'] == 'platinum' or grains['host'] == 'rhenium' or grains['host'] == 'barium' %}
63         {
64           "full_text": "BAT ${battery_short} ${battery_time}", 
65           "color": 
66           ${if_match ${battery_percent}<20}
67             "\#ff0000"
68           ${else}
69                 "\#00ff00"
70           ${endif}
71         },
72 {% endif %}
73   {"full_text": "${time}", "color": "\#ffffff"}
74 ],
75 ]];
76