Sunday, 9 November 2014

Elementary OS Conky Theme (Script)

Update: You can get this script and more desktop customizations through a new Freya Config script here.

In the last month or so I've switched over to elementary OS Luna (I've tried the Freya beta as well, but it's still not polished enough for my every day work laptop).  The switch to elementary OS necessitated a good conky theme.

Below are light theme (blue/grey) and dark theme (orange/black) options for a nice simple conky script that displays all the info I want at any time.  The main formatting and icons were taken from the vinDSL theme, but I removed the weather, calendar, and fancy lua bars.  I wanted this conky script to be lightweight and easy on the eyes.

Elementary OS "Light" conky theme:

Conky Desktop (light theme)

Elementary OS "Dark" conky theme:

Conky Desktop (dark theme)


The first thing you need is conky itself and lm-sensors (for HD + GPU info):
sudo apt-get install conky lm-sensors

You might also need to run the following command to allow conky permission to pull wireless data:
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/conky

Now it's a simple matter of grabbing the conky script (light theme here, dark theme here) and saving it as ".conkyrc" in your home folder. You will also need to grab the DotMatrix, PizzaDude, OpenLogos, and StyleBats icon font sets and place them in your ~/.fonts folder.  You can do this by executing:
wget http://anjp.comlu.com/fonts/Dotmatrx.ttf
wget http://anjp.comlu.com/fonts/PIZZADUDEBULLETS.ttf
wget http://anjp.comlu.com/fonts/STYLBCC_.TTF
wget http://anjp.comlu.com/fonts/openlogos.ttf
wget http://anjp.comlu.com/fonts/weather.ttf
mkdir ~/.fonts/
mv ~/Downloads/Dotmatrx.ttf ~/.fonts/
mv ~/Downloads/PIZZADUDEBULLETS.ttf ~/.fonts/
mv ~/Downloads/STYLBCC_.TTF ~/.fonts/
mv ~/Downloads/openlogos.ttf ~/.fonts/
mv ~/Downloads/weather.ttf ~/.fonts/

You can run conky anytime by executing:
conky

If you made a mistake or need to close conky, it can be stopped using:
killall conky

NOTE #1: This conky config looks like a desktop panel but just runs on the desktop. If you want it to act as a panel, change the variable 'own_window_type' from 'desktop' to 'panel' and remove 'undecorated' from own_window_hints

NOTE #2: Most of the variables are dynamic, but a few at the top info area (hardware model, gpu model) are hardcoded. Others (processor type) truncate at certain string lengths and may need some tlc

Here's the full 'light theme' code:
####
## Prerequisites (required)
#
#  conky-all 1.8.0 or 1.8.1-5
#  cURL - Command Line Tool
#  xsltproc - Command Line Tool
#  UTF-8 Compatible Text Editor
#
## Tips n' Tricks
## Several ppl (including myself) have experienced issues with conky-all 1.8.1-6
## In every instance, downgrading to conky-all 1.8.1-5 has solved the problem(s).
## I recommend using (and pinning) conky-all 1.8.1-5 until things get sorted.
## conky-all 1.8.1-5 can be downloaded here: https://launchpad.net/ubuntu/+source/conky-all/1.8.1-5

####
## Installed fonts (required)
#
#  ConkyWeather (Stanko Metodiev)
#  Cut Outs for 3D FX (Fonts & Things)
#  Droid Font Family (Google Android SDK)
#  KR A Round (Kat's Fun Fonts)
#  OpenLogos (Icoma)
#  PizzaDude Bullets (Jakob Fischer)
#  Radio Space (Iconian Fonts)
#  StyleBats (Vinterstille)
#  Ubuntu Font Family (Canonical Ltd)
#  Ubuntu Title Bold (Paulo Silva - not included in link below)
#  Weather (Jonathan Macagba)
#
## Tips n' Tricks from Mr. Peachy, djyoung4, and 42dorian (Thanks!)
## Most necessary fonts can be downloaded here: http://ompldr.org/vOHdoag
## Unzip the fonts into your font folder, for example: /home/username/.fonts
## Run this command in a terminal (rebuilds font cache file): sudo fc-cache -fv

####
## Use XFT? Required to Force UTF8 (see below)
#
use_xft yes
xftfont DroidSans:size=8
xftalpha 0.1

####
## Force UTF8? Requires XFT (see above)
## Displays degree symbol, instead of °, etc.
#
override_utf8_locale yes

####
## This buffer is used for text, single lines, output from $exec, and other variables.
## Increasing the text buffer size (too high) will drastically reduce Conky's performance.
## Decreasing the size (too low) will truncate content and cause strange display output.
## Standard text buffer size is 256 bytes (cannot be less). Adjust YOUR buffer wisely!
#
text_buffer_size 640

####
## Daemonize Conky, aka 'fork to background'.
#
background yes

####
## Update interval in seconds.
#
update_interval 2.0

####
## The number of times Conky will update before quitting.
## Zero makes Conky run forever.
#
total_run_times 0

####
## Create own window in instead of using desktop?
#
own_window yes
own_window_transparent no
own_window_type desktop    ## (panel or desktop)
own_window_class conky-semi
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

####
## Background color IF own_window_transparent set to "no"
own_window_colour 323232          ######## Default background color

####
## Some distros also require the following 2 lines.
#
own_window_argb_visual yes
own_window_argb_value 160     # 0 - 255 where 255 is opaque

####
## Force images to redraw when they change.
#
imlib_cache_size 0
255255
####
## Use double buffering? Reduces flicker.
#
double_buffer yes

####
## Draw shades?
#
draw_shades yes
default_shade_color 292421  

####
## Draw outlines?
#
draw_outline no

####
## Draw borders around text?
#
draw_borders no

####
## Draw borders around graphs?
#
draw_graph_borders no

####
## Print text to stdout?
## Print text in console?
#
out_to_ncurses no
out_to_console no

####
## Text alignment.
#
alignment top_right

####
## Minimum size of the text area.
## Syntax: minimum_size [width] [height]
#
minimum_size 200 1200

####
## Maximum width of the text area.
## Syntax: maximum_width [width]
#
maximum_width 200

####
## Gap between text and screen borders.
#
gap_x 6  ## Left / Right
gap_y 2  ## Top / Bottom

####
## Shorten MiB/GiB to M/G in stats.
#
short_units yes

####
## Pad % symbol spacing after numbers.
#
pad_percents 0

####
## Pad spacing between text and borders.
#
border_inner_margin 4

####
## Limit the length of names in "Top Processes".
#
top_name_width 10

####
## Subtract file system -/+buffers/cache from used memory?
## Set to yes, to produce meaningful physical memory stats.
#
no_buffers yes

####
## Set to yes, if you want all text to be in UPPERCASE.
#
uppercase no

####
## Number of cpu samples to average.
## Set to 1 to disable averaging.
#
cpu_avg_samples 2

####
## Number of net samples to average.
## Set to 1 to disable averaging.
#
net_avg_samples 2

####
## Add spaces to keep things from moving around?
## Only affects certain objects.
#
use_spacer right

####
## My colors (suit yourself)
#
color0 White #FFFFFF    ---
color1 6b6b6b #6b6b6b    Icons
color2 6b6b6b #323232    System/Processors/Mem/HD text
color3 Ivory3 #CDCDC1    Text
color4 6db9d5 #6db9d5   Headings
color5 Tan2 #EE9A49    ---
color6 323232 #323232    PizzaDude Icons
color7 323232     #323232    Processes Icons
color8 323232 #323232    Heading Lines
color9 6b6b6b #6b6b6b    BarGraphs


#### Color Schemes
#
# elementary bkgnd = f5f5f5
# elementary grey  = d3d3d3
# dark grey        = 323232
# lighter grey     = 6b6b6b or a4a4a4
# light blue       = 6db9d5
#
####


TEXT
##################################
##             LOGO             ##
##################################
${voffset 36}${font RadioSpace:size=14}${color3}${alignc}${uid_name 1000}@${nodename}${font}
${voffset 3}${font DroidSans:size=8.6}${color3}${alignc}HP Pavilion dv6428ca
##################################
##            SYSTEM            ##
##################################
${voffset 7}${font DroidSans:bold:size=8.25}${color4}SYSTEM${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font OpenLogos:size=10}${color2}u${voffset -4}${font DroidSans:size=8.6}${color3}${offset 5}${pre_exec lsb_release -sd || cat /etc/*release}${alignr}${pre_exec lsb_release -r | cut -f 2| tr "[:upper:]" "[:lower:]"}${font}
${voffset 2}${offset -2}${font OpenLogos:size=12}${color2}Z${voffset -4}${font DroidSans:size=8.6}${color3}${offset 3}${sysname}${offset 3}${kernel}${alignr}${font DroidSans:size=8.3}${machine}${font}
${voffset 2}${font StyleBats:size=10}${color2}d${voffset -2}${font DroidSans:size=8.6}${color3}${offset 5}nVidia GeForce 6150 G0${alignr}${font DroidSans:size=8.3}${execi 60 nvidia-settings -query GPUCoreTemp | perl -ne 'print $1 if /GPUCoreTemp.*?: (\d+)./;'} °C
${voffset 2}${font StyleBats:size=10}${color2}A${voffset -1}${font DroidSans:size=8.6}${color3}${offset 5}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 1-20}${alignr 1}${font DroidSans:size=8.3}${freq_g cpu0}${offset 1}GHz${font}
${voffset 2}${font StyleBats:size=10}${color2}q${voffset -1}${font DroidSans:size=8.6}${color3}${offset 5}System${offset 3}Uptime${alignr}${font DroidSans:size=8.3}${uptime_short}${font}
##################################
##          PROCESSORS          ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}PROCESSORS${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font StyleBats:size=9.9}${color2}k${voffset -2}${font DroidSansFallback:size=8.39}${color3}${offset 2}CPU1${offset 5}${font DroidSans:size=8.3}${cpu cpu1}%${font}${color9}${alignr}${cpubar cpu1 6,120}
${voffset 2}${font StyleBats:size=9.9}${color2}k${voffset -2}${font DroidSansFallback:size=8.39}${color3}${offset 2}CPU2${offset 5}${font DroidSans:size=8.3}${cpu cpu2}%${font}${color9}${alignr}${cpubar cpu2 6,120}
${voffset 2}${font DroidSansFallback:size=8.39}${color3}${offset 4}Load  ${loadavg}${alignr}(${execi 5 cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor})
##################################
##            MEMORY            ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}MEMORY${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color2}l${voffset -2}${font DroidSansFallback:size=8.3}${color3}${offset 3}RAM${goto 97}${font DroidSans:size=8.3}${mem}${goto 133}/${offset 5}${memmax}${alignr}${memperc}%${font}
${voffset 2}${font}${color9}${alignc}${membar 6,194}
##################################
##             HDD              ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}HDD${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 6}${font StyleBats:size=9.9}${color2}x${voffset -2}${font DroidSansFallback:size=8.3}${color3}${offset 4}Root${goto 95}${font DroidSans:size=8.3}${fs_used /}${goto 133}/${offset 5}${fs_size /}${alignr}${fs_used_perc /}%${font}
${color9}${voffset 2}${alignc}${fs_bar 6,194}
${voffset 6}${font StyleBats:size=9.9}${color2}4${voffset -2}${font DroidSansFallback:size=8.3}${color3}${offset 4}Swap${goto 95}${font DroidSans:size=8.3}${swap}${goto 133}/${offset 5}${swapmax}${alignr}${swapperc}%${font}
${color9}${voffset 2}${alignc}${swapbar 6,194}
##################################
##             TIME             ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}TIME${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset -4}${font RadioSpace:size=32}${color3}${if_match ${time %l}<=9}${alignc 7}${time %H:%M}${else}${if_match ${time %l}>=10}${alignc -1}${time %H:%M}${endif}${endif}${font}
${voffset 2}${color3}${alignc}${time %A, %d %b %Y}
##################################
##         TOP PROCESSES        ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}TOP PROCESSES${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 6}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 1}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 1}${alignr}${top_mem mem 1}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 2}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 2}${alignr}${top_mem mem 2}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 3}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 3}${alignr}${top_mem mem 3}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 4}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 4}${alignr}${top_mem mem 4}%${font}
${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 5}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 5}${alignr}${top_mem mem 5}%${font}
# ${voffset 1}${font StyleBats:size=10}${color7}h${voffset -1}${font DroidSans:size=8.65}${color3}${offset 5}${top_mem name 6}${goto 120}${font DroidSans:size=8.3}${top_mem mem_res 6}${alignr}${top_mem mem 6}%${font}
##################################
##           NETWORK            ##
##################################
${voffset 8}${font DroidSans:bold:size=8}${color4}NETWORK${offset 8}${color8}${voffset -2}${hr 2}${font}
${voffset 4}${font StyleBats:size=10}${color6}l${font}${font DroidSans:size=8.65}${color3}${offset 5}SSID ${alignr}${wireless_essid eth1} @ ${wireless_bitrate eth1}
${voffset 0}${font PizzaDude Bullets:size=9.5}${color6}Z${font}${font DroidSans:size=8.65}${color3}${offset 5}Strength${font}${color9}${alignr}${wireless_link_bar 6,88 eth1}
${voffset 4}${font PizzaDudeBullets:size=9.5}${color6}T${font DroidSans:size=8.65}${color3}${offset 5}Download${goto 120}${font DroidSans:size=8.3}${totaldown eth1}${alignr}${font DroidSans:size=8.3}${downspeed eth1}${font}
${voffset 0}${font PizzaDudeBullets:size=9.5}${color6}N${font DroidSans:size=8.65}${color3}${offset 5}Upload${goto 120}${font DroidSans:size=8.3}${totalup eth1}${alignr}${font DroidSans:size=8.3}${upspeed eth1}${font}
${voffset 4}${font PizzaDudeBullets:size=9.5}${color6}a${font DroidSans:size=8.65}${color3}${offset 5}Private${offset 3}IP${goto 123}${alignr}${font DroidSans:size=8.3}${addr eth1}${font}
${voffset 0}${font PizzaDudeBullets:size=9.5}${color6}a${font DroidSans:size=8.65}${color3}${offset 5}Public${offset 7}IP${goto 121}${alignr}${font DroidSans:size=8.3}${execi 1800 wget -q -O - checkip.dyndns.org | sed -e 's/[^[:digit:]\|.]//g'}${font}
###
### Some of the wireless commands require the following command to be run in terminal (one-time) before they work: (it's a permissions issue)
### sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/conky


#################################
##             END             ##
#################################


Did this script work for you?  Did you add any other variables to monitor?  Share in the comments below...

0 comments:

  © Blogger template 'Isolation' by Ourblogtemplates.com 2008

Back to TOP