Mint Serena 64 bit using the Mate desktop environment. Most of the following scripts will run on this machine, although some have only been tested with the Gnome desktop. Extra software requirements can be met by the Ubuntu and safe PPA repositories. Scripts may be re-written or added to from time to time, the date serves as the version number. Syntax highlighting on these pages is provided by GVim's "Convert to HTML" option.

Conky Horizontal

# Conky configuration script.
# Filename: .conkyrc2
# Version: 020612
# Author: robz
# This config will give you a horizontal layout with a screen aspect ratio of
# 16:9 sized for 1920 x 1080 pixels resolution monitor.
# You'll need the lm-sensors & hddtemp packages from the repositories -
# sudo apt-get install lm-sensors hddtemp - follow the setup procedures in the
# man pages, you'll also need my rhythmbox-progbar script see below.
# The hard drive names and locations will probably need to be changed to suit
# your PC as will the lm-sensors cpu and motherboard temperatue names, maybe
# the name of your network interface as well :)
# To start, in a terminal - conky -d -c <path to .conkyrc2>
# Or as a startup application - conky -d -p15 -c <path to .conkyrc2>
# OK here - we - go!

# Locale, fonts and font sizes.
use_xft yes
xftfont Droid Sans:size=9
override_utf8_locale yes

# Conky performance
update_interval 2
total_run_times 0
double_buffer yes
no_buffers yes
net_avg_samples 2
text_buffer_size 1024
top_name_width 22

# Execute it in its own window
own_window yes
own_window_transparent yes
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Font colors
default_color 666666 # mid grey

# Header colors
color0 FFFF66 # pale yellow

# Minimum dimensions
minimum_size 1520 0
default_bar_size 100 10
default_graph_size 100 10

# Conky positioning, roughly centred.
alignment bottom_left
gap_x 200
gap_y 5

########### Stuff after "TEXT" will appear onscreen ###########################
TEXT
${goto 15}${font Ubuntu:style=Bold:size=20}${color0}ubuntu ${font}\
${kernel}${font Droid Sans:size=10}\
${goto 256}Memory & Disks:\
${goto 560}Network:\
${goto 785}Temperatures:\
${goto 960}Top Processes:\
${goto 1170}Activity:\
${goto 1370}Music:${font}${color}${voffset 5}
########### End of headings line ##############################################
${goto 15}${if_match ${cpu cpu0} > 50}CPU: Grafting!${goto 100}${color red}\
${cpubar cpu0}${color}  ${cpu cpu0}%${else}CPU Average:${goto 100}\
${cpubar cpu0}  ${cpu cpu0}%${endif}\
${goto 256}Flash SSD:${goto 330}${fs_used /}\
${goto 380}${fs_bar /}  ${fs_size /}\
${goto 560}Upspeed:\
${goto 635}${upspeedgraph ppp0 10,100 B7B2AD 0099FF}  ${upspeed ppp0}\
${goto 785}CPU Temp:\
${goto 900}${execi 10 echo $(sensors | grep -m 1 'CPUTIN:' | cut -c16-17)°C}\
${goto 960}${top name 1}${goto 1060}${top pid 1}${goto 1100}${top cpu 1}%\
${goto 1170}Processes:${goto 1265}${running_processes}  Running\
${goto 1370}${if_running rhythmbox}Rhythmbox Now Playing:\
${else}Put Some Music On Rob!${endif}
########### End of first line #################################################
${goto 15}${if_match ${cpu cpu1} > 70}Core 1: on fire!${goto 100}${color red}\
${cpubar cpu1}${color}  ${cpu cpu1}%${else}Core 1:${goto 100}\
${cpubar cpu1}  ${cpu cpu1}%${endif}\
${goto 256}Archive:${goto 330}${fs_used /media/Archive}\
${goto 380}${fs_bar /media/Archive}  ${fs_size /media/Archive}\
${goto 560}Downspeed:\
${goto 635}${downspeedgraph ppp0 10,100 B7B2AD FF0000}  ${downspeed ppp0}\
${goto 785}Motherboard:\
${goto 900}${execi 30 echo $(sensors | grep -m 1 'SYSTIN:' | cut -c16-17)°C}\
${goto 960}${top name 2}${goto 1060}${top pid 2}${goto 1100}${top cpu 2}%\
${goto 1170}Load Average: ${goto 1265}${loadavg}\
${goto 1370}${if_running rhythmbox}\
${exec rhythmbox-client --print-playing-format %tt}${endif}
########### End of second line ################################################
${goto 15}${if_match ${cpu cpu2} > 70}Core 2: on fire!${goto 100}${color red}\
${cpubar cpu2}${color}  ${cpu cpu2}%${else}Core 2:${goto 100}\
${cpubar cpu2}  ${cpu cpu2}%${endif}\
${goto 256}Backup:${goto 330}${fs_used /media/Backup}\
${goto 380}${fs_bar /media/Backup}  ${fs_size /media/Backup}\
${goto 560}Totals:${goto 635}${totalup ppp0}  -  ${totaldown ppp0}${font}\
${goto 785}Archive 1TB Drive:\
${goto 900}${execi 60 nc localhost 7634 | cut -c81-82}°C\
${goto 960}${top name 3}${goto 1060}${top pid 3}${goto 1100}${top cpu 3}%\
${goto 1170}Flash SDD I/O:${goto 1265}${diskio /dev/sda}/s\
${goto 1370}${if_running rhythmbox}By: \
${exec rhythmbox-client --print-playing-format %aa}${endif}
########### End of third line #################################################
${goto 15}${if_match ${cpu cpu3} > 70}Core 3: on fire!${goto 100}${color red}\
${cpubar cpu3}${color}  ${cpu cpu3}%${else}Core 3:${goto 100}\
${cpubar cpu3}  ${cpu cpu3}%${endif}\
${goto 256}Ram:${goto 330}${memmax}${goto 380}${membar 10,100}  $memperc%\
${goto 560}Today:${goto 635}${execi 120 vnstat -i ppp0 | \
awk '/today/{print $8 $9}'}\
${goto 785}Backup 1TB Drive:\
${goto 900}${execi 60 nc localhost 7634 | cut -c53-54}°C\
${goto 960}${top name 4} ${goto 1060}${top pid 4}${goto 1100}${top cpu 4}%\
${goto 1170}Archive I/O:${goto 1265}${diskio /dev/sdc}/s\
${goto 1370}${if_running rhythmbox}From: \
${alignc}${exec rhythmbox-client --print-playing-format %at}${endif}
########### End of forth line #################################################
${goto 15}${if_match ${cpu cpu4} > 70}Core 4: on fire!${goto 100}${color red}\
${cpubar cpu4}${color}  ${cpu cpu4}%${else}Core 4:${goto 100}\
${cpubar cpu4}  ${cpu cpu4}%${endif}\
${goto 256}Swap:${goto 330}${swapmax}\
${goto 380}${swapbar 10,100}  ${swapperc}%\
${goto 560}Month:${goto 635}${execi 120 vnstat -m -i ppp0| \
awk '/'$(date +"%b")'/{print $9 $10}'}\
${goto 785}Graphics Card:${goto 900}${nvidia temp}°C\
${goto 960}${top name 5}${goto 1060}${top pid 5}${goto 1100}${top cpu 5}%\
${goto 1170}Backup I/O:${goto 1265}${diskio /dev/sdb}/s\
${goto 1370}${if_running rhythmbox}\
${execbar /home/robz1/Scripts/conky_scripts/rhythmbox-progbar}${endif}
########### End of fifth line and this configuration ##########################



Progress Bar Script.

#!/bin/bash
# Filename: rhythmbox-progbar
# Author: robz
# Version: 060412
# Provide data for Conky to draw a progress bar for Rhythmbox music player.
# Update for Ubuntu 12.04 beta
# Now at this present date (see Version:) the call to "rhythmbox-client" for
# song duration doesn't appear to work anymore, you get a "divide by zero"
# error, so, to avoid the APOCALYPSE! use this instead.

DUR=$(qdbus org.mpris.MediaPlayer2.rhythmbox \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \
org.mpris.MediaPlayer2.Player Metadata | awk '/length/ {print $2/1000000}')
POS=$(qdbus org.mpris.MediaPlayer2.rhythmbox \
/org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get \
org.mpris.MediaPlayer2.Player Position)/1000000

echo $(echo "100*$POS/$DUR" | bc)                       # Convert to percent.


Desktop Screenshot.



3 comments:

Anonymous said...

Nice work!

Karthik Srivatsa said...

Can you explain in detail how does goto work? What is the position represented by the number there?

Rob said...

Hi Karthik, the goto refers to horizontal position in pixels from the left margin
see: http://conky.sourceforge.net/documentation.html for all info.