Skip to content

Instantly share code, notes, and snippets.

@saagarjha
Last active December 1, 2016 06:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saagarjha/c58d567f2e0245957a7ea2ac9d8aec42 to your computer and use it in GitHub Desktop.
Save saagarjha/c58d567f2e0245957a7ea2ac9d8aec42 to your computer and use it in GitHub Desktop.
A (modified) Google Now-inspired .conkyrc
# If you haven't already, download Conky Google Now from http://satya164.deviantart.com/art/Conky-Google-Now-366545753 and unzip it to your home folder; then copy this .conkyrc over the one you just extracted
# Requires lm-sensors and inxi (and conky) to be installed:
# sudo apt-get install lm-sensors inxi
# Adapted from these:
# http://satya164.deviantart.com/art/Conky-Google-Now-366545753
# https://gist.github.com/anonymous/6666594
# Conky Google Now style #
# Conky settings #
background no
update_interval 1
double_buffer yes
no_buffers yes
# Window specifications #
own_window yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_title conky
own_window_colour FFFFFF
# Alignment #
alignment tr
gap_x 15
gap_y 56
border_inner_margin 15
border_outer_margin 0
# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# Text settings #
use_xft yes
xftalpha 0
xftfont Open Sans Light:size=10
override_utf8_locale yes
imlib_cache_size 0
# Color scheme #
default_color 666666
color1 0099CC
color2 9933CC
color3 669900
color4 FF8800
color5 CC0000
color6 AAAAAA
color7 DDDDDD
TEXT
# WEATHER
# Replace the numbers two lines down with your appropriate values, which are in [brackets] in the template below
# ${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%22[Your WOEID]%22%20and%20u%3D%22[Units, either "c" or "f"]%22&format=xml&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}${font Open Sans Light:size=15}${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "region=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}
${execi 300 curl -s "https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20%3D%222388327%22%20and%20u%3D%22c%22&format=xml&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys" -o ~/.cache/weather.xml}${font Open Sans Light:size=15}${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "city=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "region=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}, ${execi 300 grep "yweather:location" ~/.cache/weather.xml | grep -o "country=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}
${voffset -10}${font Open Sans Light:size=70}${alignr}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${voffset -25}
${execi 300 cp -f ~/.conky-google-now/$(grep "yweather:condition" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather.png}${image ~/.cache/weather.png -p 0,45 -s 60x60}
${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tr '[a-z]' '[A-Z]' | awk 'NR==1'}
# You may change the call to date -d to change the time format for sunrise/sunset
${image ~/.conky-google-now/wind.png -p 0,135 -s 15x15}${goto 35}${execi 60 grep "yweather:wind" ~/.cache/weather.xml | grep -o "speed=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n 1} km/h ${alignr}${execi 60 date -d "$(grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunrise=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n 1)" +%H:%m}
${image ~/.conky-google-now/humidity.png -p 0,155 -s 15x15}${goto 35}${execi 300 grep "yweather:atmosphere" ~/.cache/weather.xml | grep -o "humidity=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}% ${alignr}${execi 60 date -d "$(grep "yweather:astronomy" ~/.cache/weather.xml | grep -o "sunset=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | tail -n 1)" +%H:%m}${voffset 5}
${goto 18}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${goto 88}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${goto 158}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${goto 228}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4' | tr '[a-z]' '[A-Z]'}${goto 298}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5' | tr '[a-z]' '[A-Z]'}
${execi 300 cp -f ~/.conky-google-now/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 0,200 -s 30x30}${execi 300 cp -f ~/.conky-google-now/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 70,200 -s 30x30}${execi 300 cp -f ~/.conky-google-now/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 140,200 -s 30x30}${execi 300 cp -f ~/.conky-google-now/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5').png ~/.cache/weather-4.png}${image ~/.cache/weather-4.png -p 210,200 -s 30x30}${execi 300 cp -f ~/.conky-google-now/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==6').png ~/.cache/weather-5.png}${image ~/.cache/weather-5.png -p 280,200 -s 30x30}${voffset 20}
${goto 20}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 90}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${goto 160}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${goto 230}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${goto 300}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°
${goto 20}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${goto 90}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${goto 160}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°${goto 230}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==4'}°${goto 300}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==5'}°
# CPU/RAM
${color7}${hr}${color}
# Modify the cut commands to display the appropriate processor name
# ${font Open Sans Light:size=15}Processors/Memory${font Open Sans Light:pixelsize=10} ${pre_exec inxi -c 0 | [Your cut command]}${alignr}${memmax}
${font Open Sans Light:size=15}Processors/Memory${font Open Sans Light:pixelsize=10} ${pre_exec inxi -c 0 | cut -c 15-36 | cut --complement -c 15-18}${alignr}${memmax}
${color}${font Open Sans Light:pixelsize=10}CPU: ${color1}${color2}${cpu cpu0}${color1}%${color}${font Open Sans Light:pixelsize=10}${alignr}RAM: ${color3}${memperc}%
${cpugraph 50,135 FF8800 FF8800}${alignr}${memgraph 50,135 FF8800 FF8800}
${font Open Sans Light:pixelsize=10}${color1}CPU TEMP: ${color3}${execp sensors coretemp-isa-0000 | grep 'Physical id 0' | cut -c18-19}${color1}°C${color2} ${color3}${font Open Sans Light:pixelsize=10}${color}${alignr}${loadavg}
${color7}${hr}${color}
# NETWORK
${if_existing /proc/net/route wlan0}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10} ${wireless_essid wlan0} ${addr wlan0}
${color1}Up:${color} ${color3}${upspeed wlan0}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed wlan0}/s${color}
${upspeedgraph wlan0 75,135 FF8800 FF8800}${alignr}${downspeedgraph wlan0 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup wlan0}${color}${alignr}${color1}Received:${color} ${color2}${totaldown wlan0}${color}${voffset -20}
#
${else}${if_existing /proc/net/route wlan4}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10} ${wireless_essid wlan4} ${addr wlan4}
${color1}Up:${color} ${color3}${upspeed wlan4}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed wlan4}/s${color}
${upspeedgraph wlan4 75,135 FF8800 FF8800}${alignr}${downspeedgraph wlan4 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup wlan4}${color}${alignr}${color1}Received:${color} ${color2}${totaldown wlan4}${color}${voffset -20}
#
${else}${if_existing /proc/net/route eth0}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10} ${addr eth0}
${color1}Up:${color} ${color3}${upspeed eth0}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed eth0}/s${color}
${upspeedgraph eth0 75,135 FF8800 FF8800}${alignr}${downspeedgraph eth0 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup eth0}${color}${alignr}${color1}Received:${color} ${color2}${totaldown eth0}${color}${voffset -20}
#
${else}${if_existing /proc/net/route eth2}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10} ${wireless_essid eth2} ${addr eth2}
${color1}Up:${color} ${color3}${upspeed eth2}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed eth2}/s${color}
${upspeedgraph eth2 75,135 FF8800 FF8800}${alignr}${downspeedgraph eth2 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup eth2}${color}${alignr}${color1}Received:${color} ${color2}${totaldown eth2}${color}${voffset -20}
#
${else}${if_existing /proc/net/route ppp0}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10}
${color1}Up:${color} ${color3}${upspeed ppp0}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed ppp0}/s${color}
${upspeedgraph ppp0 75,135 FF8800 FF8800}${alignr}${downspeedgraph ppp0 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup ppp0}${color}${alignr}${color1}Received:${color} ${color2}${totaldown ppp0}${color}${voffset -20}
#
${else}${if_existing /proc/net/route ppp1}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10}
${color1}Up:${color} ${color3}${upspeed ppp1}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed ppp1}/s${color}
${upspeedgraph ppp1 75,135 FF8800 FF8800}${alignr}${downspeedgraph ppp1 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup ppp1}${color}${alignr}${color1}Received:${color} ${color2}${totaldown ppp1}${color}${voffset -20}
#
${else}${if_existing /proc/net/route usb0}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10}
${color1}Up:${color} ${color3}${upspeed usb0}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed usb0}/s${color}
${upspeedgraph usb0 75,135 FF8800 FF8800}${alignr}${downspeedgraph usb0 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup usb0}${color}${alignr}${color1}Received:${color} ${color2}${totaldown usb0}${color}${voffset -20}
#
${else}${if_existing /proc/net/route usb1}\
${font Open Sans Light:size=15}Network${color}${font Open Sans Light:pixelsize=10}
${color1}Up:${color} ${color3}${upspeed usb1}/s${color}${alignr}${color1}Down:${color} ${color3}${downspeed usb1}/s${color}
${upspeedgraph usb1 75,135 FF8800 FF8800}${alignr}${downspeedgraph usb1 75,135 FF8800 FF8800}
${color1}Sent:${color} ${color2}${totalup usb1}${color}${alignr}${color1}Received:${color} ${color2}${totaldown usb1}${color}${voffset -20}
#
${else}
${font Open Sans Light:size=15}Network disconnected${font Open Sans Light:pixelsize=15}
${color6}Connect to a network to see statistics${color}
${voffset 75}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${voffset -30}${voffset -20}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment