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