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