From 18 Jan, 2021 0:00 UTC: All services will be temporary unavailable for maintenance
  • R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythonwindowsphpgamebathyscaphegui翻訳comegattwitterframeworkbtronvb.net計画中(planning stage)testdomarduinodirectxpreviewerゲームエンジン

Sample Conky (system monitor) configuration file with weather, CPU graph, memory graph, network traffic graph and processes


Commit MetaInfo

Revision253ff932360ef9a43f24de0279c3e5cb429ed745 (tree)
Zeit2015-01-02 10:52:08
Autorshitamo <shitamo@user...>
Commitershitamo

Log Message

- °C -> ℃
- awk and grep -> ruby
- use template

Ändern Zusammenfassung

Diff

--- a/conkyrc
+++ b/conkyrc
@@ -64,28 +64,28 @@ override_utf8_locale yes
6464 use_xft yes
6565 xftfont TakaoGothic:style=Regular:size=11
6666
67+template1 ~/.cache/weather.xml
68+template2 ${color \\#eae5e3}${top name \1} ${top pid \1} ${top cpu \1} ${top mem \1} ${top time \1}
69+template3 ${execi 300 cp -f ~/.conky/icons/$(ruby -ne 'cnt ||= 0; if /yweather:forecast.*code="(.+?)"/ then cnt+=1; print $1 if cnt == \1; end' ${template1}).png ~/.cache/weather-\1.png}${image ~/.cache/weather-\1.png -p \2 -s 32x32}
70+template4 ${rss http://weather.livedoor.com/forecast/rss/warn/16.xml 60 item_title \1}
6771
6872 TEXT
6973 # https://weather.yahoo.com/japan/ -> Toyama Prefecture -> Toyama-shi
7074 # https://weather.yahoo.com/japan/toyama-prefecture/toyama-shi-1118400/
71-${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=1118400&u=c" -o ~/.cache/weather.xml}
75+${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=1118400&u=c" -o ${template1}}
7276 \
7377 # Weather
7478 \
75-${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°C${font}${color}
76-${goto 46}${voffset 14}${font Droid Sans :size=12}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
79+${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}
80+${goto 46}${voffset 14}${font mono:size=12}${color1}${execi 300 ruby -ne 'if /yweather:condition .* text="(.+?)"/ then print $1; end' ${template1}}${font}${color}
7781 \
78-${color1}${alignr 55}${voffset -72}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "pressure=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "pressure=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}
79-${color1}${alignr 55}${voffset 7}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} %${color}
80-${color1}${alignr 55}${voffset 7}${execi 300 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"} ${execi 300 grep "yweather:units" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${color}
82+${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}}
83+${color1}${alignr 55}${voffset 7}${execi 300 ruby -ne 'if /yweather:atmosphere humidity="(.+?)"/ then print $1; end' ${template1}}%${color}
84+${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}
8185 \
82-${color3}${voffset 30}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
83-${color3}${voffset -14}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
84-${color3}${voffset -14}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
86+${color3}${voffset 30}${alignc}${execi 300 ruby -ne '$cnt ||= 0; if ($cnt < 3) && /day="(.+?)"/ then $cnt+=1; printf(" %s ", $1 ); end' ${template1}}${color}
8587 \
86-${color2}${voffset 40}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
87-${color2}${voffset -14}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
88-${color2}${voffset -14}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${color}
88+${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}
8989 ${hr 2}
9090 \
9191 ${color #d8e698}System information :${color #eae5e3}
@@ -96,19 +96,19 @@ ${color #d8e698}System information :${color #eae5e3}
9696 ${color #ffffff}Swap Usage : ${color #eae5e3}${swap}/${swapmax} - ${swapperc}% - ${swapbar 5}
9797 ${color #d8e698}${stippled_hr}
9898 ${color #d8e698}Device temperature :${color #eae5e3}
99-${color #ffffff} CPU0:${color #eae5e3}${execi 60 sensors | grep -A 0 'Core0' | cut -c 14-22} ${color #ffffff}HDD1: ${color #eae5e3}${execi 60 /usr/sbin/hddtemp /dev/sde -n -unit=C}.0°C
100-${color #ffffff} CPU1:${color #eae5e3}${execi 60 sensors | grep -A 0 'Core1' | cut -c 14-22} ${color #ffffff}HDD2: ${color #eae5e3}${execi 60 /usr/sbin/hddtemp /dev/sdf -n -unit=C}.0°C
101-${color #ffffff} M/B :${color #eae5e3}${execi 60 sensors | grep -A 0 'MB' | cut -c 25-33} ${color #ffffff}HDD3: ${color #eae5e3}${execi 60 /usr/sbin/hddtemp /dev/sdg -n -unit=C}.0°C
99+${color #ffffff} CPU0:${color #eae5e3}${execi 60 sensors | grep -A 0 'Core0' | cut -c 14-22} ${color #ffffff}HDD1: ${color #eae5e3}${execi 60 /usr/sbin/hddtemp /dev/sde -n -unit=C}.0℃
100+${color #ffffff} CPU1:${color #eae5e3}${execi 60 sensors | grep -A 0 'Core1' | cut -c 14-22} ${color #ffffff}HDD2: ${color #eae5e3}${execi 60 /usr/sbin/hddtemp /dev/sdf -n -unit=C}.0℃
101+${color #ffffff} M/B :${color #eae5e3}${execi 60 sensors | grep -A 0 'MB' | cut -c 25-33} ${color #ffffff}HDD3: ${color #eae5e3}${execi 60 /usr/sbin/hddtemp /dev/sdg -n -unit=C}.0℃
102102 ${color #d8e698}${stippled_hr}
103103 ${color #d8e698}Weather report :${color #eae5e3}
104- 富山空港 ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ RJNT weather } ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ RJNT temperature} °C
104+ 富山空港 ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ RJNT weather } ${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ RJNT temperature} ℃
105105 ${color #d8e698}${stippled_hr}
106106 ${color #d8e698}Storm warning :${color #eae5e3}
107- ${rss http://weather.livedoor.com/forecast/rss/warn/16.xml 60 item_title 1}
108- ${rss http://weather.livedoor.com/forecast/rss/warn/16.xml 60 item_title 2}
109- ${rss http://weather.livedoor.com/forecast/rss/warn/16.xml 60 item_title 3}
110- ${rss http://weather.livedoor.com/forecast/rss/warn/16.xml 60 item_title 4}
111- ${rss http://weather.livedoor.com/forecast/rss/warn/16.xml 60 item_title 5}
107+ ${template4 1}
108+ ${template4 2}
109+ ${template4 3}
110+ ${template4 4}
111+ ${template4 5}
112112 ${color #d8e698}${stippled_hr}
113113 ${color #d8e698}File systems : ${color #eae5e3}
114114 / ${fs_used /}/${fs_size /} ${fs_bar 5 /}
@@ -120,11 +120,11 @@ ${color #d8e698}Disk IO : ${color #eae5e3}
120120 ${color #ffffff}${diskiograph_read /dev/sdg 20,190 fef4f4 eebbcb}${alignr}${color #ffffff}${diskiograph_write /dev/sdg 20,190 fef4f4 eebbcb}
121121 ${color #d8e698}${stippled_hr}
122122 ${color #d8e698}Name PID CPU% MEM% TIME
123- ${color #eae5e3}${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1} ${top time 1}
124- ${color #eae5e3}${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2} ${top time 2}
125- ${color #eae5e3}${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3} ${top time 3}
126- ${color #eae5e3}${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4} ${top time 4}
127- ${color #eae5e3}${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5} ${top time 5}
123+ ${template2 1}
124+ ${template2 2}
125+ ${template2 3}
126+ ${template2 4}
127+ ${template2 5}
128128 ${color #d8e698}${stippled_hr}
129129 ${color #d8e698}Networking :
130130 ${color #ffffff}Up size : ${color #eae5e3}${totalup}
@@ -137,9 +137,9 @@ ${color #d8e698}${stippled_hr}
137137 ${font mono:size=12}${execi 60 cal -h}
138138 # Various images including the icons of the forecast #
139139 \
140-${image ~/.conky/images/pressure.png -p 350,20 -s 16x16}\
141-${image ~/.conky/images/humidity.png -p 350,42 -s 16x16}\
142-${image ~/.conky/images/wind.png -p 350,64 -s 16x16}\
143-${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 107,128 -s 32x32}\
144-${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 185,128 -s 32x32}\
145-${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 261,128 -s 32x32}${font}\
140+${image ~/.conky/images/pressure.png -p 350,24 -s 16x16}\
141+${image ~/.conky/images/humidity.png -p 350,46 -s 16x16}\
142+${image ~/.conky/images/wind.png -p 350,68 -s 16x16}\
143+${template3 1 84,130}\
144+${template3 2 183,130}\
145+${template3 3 277,130}${font}