Sample Conky (system monitor) configuration file with weather, CPU graph, memory graph, network traffic graph and processes
Revision | 28695df76c13d84f831209dd50964d56def2c191 (tree) |
---|---|
Zeit | 2016-03-26 17:24:05 |
Autor | ![]() |
Commiter | shitamo |
- Change of Yahoo Weather API
- switch from cal to gcal
@@ -55,20 +55,20 @@ conky.text = [[ | ||
55 | 55 | # ${pre_exec /usr/sbin/smartctl --scan | awk '{print "/usr/sbin/hddtemp " $1 " -n -unit=C"}' > ~/.cache/hdddev.sh; chmod +x ~/.cache/hdddev.sh}\ |
56 | 56 | # https://weather.yahoo.com/japan/ -> Toyama Prefecture -> Toyama-shi |
57 | 57 | # https://weather.yahoo.com/japan/toyama-prefecture/toyama-shi-1118400/ |
58 | -${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=1118400&u=c" -o ${template1}} | |
58 | +${execi 300 curl -s 'https://query.yahooapis.com/v1/public/yql' -d q='select * from weather.forecast where woeid=1118400 and u="c"' -o ${template1}} | |
59 | 59 | \ |
60 | 60 | # Weather |
61 | 61 | \ |
62 | 62 | ${goto 36}${voffset 0}${font mono:size=36}${color1}${execi 300 ruby -ne 'if /yweather:condition .* temp="(.+?)"/ then printf("%s℃", $1 ); end' ${template1}}${font}${color} |
63 | 63 | ${goto 46}${voffset 14}${font mono:size=12}${color1}${execi 300 ruby -ne 'if /yweather:condition .* text="(.+?)"/ then print $1; end' ${template1}}${font}${color} |
64 | 64 | \ |
65 | -${color1}${alignr 55}${voffset -72}${execi 300 ruby -ne 'if /yweather:atmosphere .* pressure="(.+?)"/ then print $1; end' ${template1}}${execi 300 ruby -ne 'if /yweather:units .* pressure="(.+?)"/ then print $1; end' ${template1}} | |
66 | -${color1}${alignr 55}${voffset 7}${execi 300 ruby -ne 'if /yweather:atmosphere humidity="(.+?)"/ then print $1; end' ${template1}}%${color} | |
67 | -${color1}${alignr 55}${voffset 7}${execi 300 ruby -ne 'if /yweather:wind .* speed="(.+?)"/ then print $1; end' ${template1}}${execi 300 ruby -ne 'if /yweather:units .* speed="(.+?)"/ then print $1; end' ${template1}}${color} | |
65 | +${color1}${alignr 55}${voffset -72}${execi 300 ruby -ne 'if /yweather:atmosphere .* pressure="(.+?)"/ then print $1; end' ${template1}}${execi 300 ruby -ne 'if /yweather:units .*? pressure="(.+?)"/ then print $1; end' ${template1}} | |
66 | +${color1}${alignr 55}${voffset 7}${execi 300 ruby -ne 'if /yweather:atmosphere .* humidity="(.+?)"/ then print $1; end' ${template1}}%${color} | |
67 | +${color1}${alignr 55}${voffset 7}${execi 300 ruby -ne 'if /yweather:wind .* speed="(.+?)"/ then print $1; end' ${template1}}${execi 300 ruby -ne 'if /yweather:units .*? speed="(.+?)"/ then print $1; end' ${template1}}${color} | |
68 | 68 | \ |
69 | -${color3}${voffset 30}${alignc}${execi 300 ruby -ne 'cnt ||= 0; if (cnt < 3) && /day="(.+?)"/ then cnt+=1; printf(" %s ", $1 ); end' ${template1}}${color} | |
69 | +${color3}${voffset 30}${alignc}${execi 300 ruby -ne 'cnt ||= 0; $_.scan(/day="(.+?)"/){ if (cnt < 3) then cnt+=1; printf(" %s ", $1 ); end }' ${template1}}${color} | |
70 | 70 | \ |
71 | -${color2}${voffset 40}${alignc}${execi 300 ruby -ne 'cnt ||= 0; if (cnt < 3) && /low="(.+?)" high="(.+?)"/ then cnt+=1; printf("%3s℃/%3s℃ ", $1, $2); end' ${template1}}${color} | |
71 | +${color2}${voffset 40}${alignc}${execi 300 ruby -ne 'cnt ||= 0; $_.scan(/high="(.+?)" low="(.+?)"/){ if (cnt < 3) then cnt+=1; printf("%3s℃/%3s℃ ", $1, $2); end }' ${template1}}${color} | |
72 | 72 | ${hr 2} |
73 | 73 | \ |
74 | 74 | ${color #d8e698}System information :${color #eae5e3} |
@@ -79,7 +79,7 @@ ${color #d8e698}System information :${color #eae5e3} | ||
79 | 79 | ${color #ffffff}Swap Usage : ${color #eae5e3}${swap}/${swapmax} - ${swapperc}% - ${swapbar 5} |
80 | 80 | ${color #d8e698}${stippled_hr} |
81 | 81 | ${color #d8e698}Device temperature :${color #eae5e3} |
82 | -${execi 60 ~/.cache/hdddev.sh > ~/.cache/hddtemp.txt}\ | |
82 | +${execi 58 ~/.cache/hdddev.sh > ~/.cache/hddtemp.txt}\ | |
83 | 83 | ${color #ffffff} CPU0:${color #eae5e3}${execi 60 sensors | grep -A 0 'Core0' | cut -c 14-22} ${color #ffffff}HDD1: ${color #eae5e3}${execi 60 sed -e '1!d' ~/.cache/hddtemp.txt}.0℃ |
84 | 84 | ${color #ffffff} CPU1:${color #eae5e3}${execi 60 sensors | grep -A 0 'Core1' | cut -c 14-22} ${color #ffffff}HDD2: ${color #eae5e3}${execi 60 sed -e '2!d' ~/.cache/hddtemp.txt}.0℃ |
85 | 85 | ${color #ffffff} M/B :${color #eae5e3}${execi 60 sensors | grep -A 0 'MB' | cut -c 25-33} ${color #ffffff}HDD3: ${color #eae5e3}${execi 60 sed -e '3!d' ~/.cache/hddtemp.txt}.0℃ |
@@ -119,9 +119,9 @@ ${color #d8e698}Networking : | ||
119 | 119 | ${color #ffffff}Up speed : ${color #eae5e3}${upspeed eth0} |
120 | 120 | ${color #ffffff}Down speed : ${color #eae5e3}${downspeed eth0} |
121 | 121 | ${color #d8e698}${stippled_hr} |
122 | -${font mono:size=9}${execi 60 cal -h3 |sed -e "1s/^\(.\{16\}\).\{21\}/\1/" -e "2s/^\(.\{15\}\).\{15\}/\1/" -e "3,$ s/^\(.\{20\}\).\{22\}/\1/"} | |
123 | -${color #d8e698}${stippled_hr} | |
124 | -${font mono:size=12}${execi 60 cal -h} | |
122 | +${font mono:size=9}${execi 60 gcal -i -H no . |sed -e "1,5d" -e "6,$ s/^\(.\{21\}\).\{26\}/\1/"} | |
123 | +# ${color #d8e698}${stippled_hr} | |
124 | +${font mono:size=12}${execi 60 gcal -i | sed -e "1d" } | |
125 | 125 | # Various images including the icons of the forecast # |
126 | 126 | \ |
127 | 127 | ${image ~/.conky/images/pressure.png -p 350,24 -s 16x16}\ |