Saturday, August 21, 2010

Productivity in Linux

In the spirit of the coming school year, I thought I would share something linux can do for productivity.

Calender on your Desktop:

Recently I happened upon a tutorial on how to embedd google calender on to your linux desktop. The full tutorial is on Make Tech Easier, and involves several linux applications, but they all come together to be quite cool. 
Conky on my computer, with system stats and calender.

The first required application is called Conky, and is a framework that allows for many combinations of system monitoring.  It can be displayed either on the desktop, or in it's own window.  

To get conky, if you have some form of Ubuntu, the simplest way is to run in a terminal: 

sudo aptitude install conky

The main file for configuring the display is .conkyrc,  and it needs to be created in the home folder.  There are many example .conkyrc files out there, and I will post the contents of mine at the end of this article, for those interested.  

The next main part for this to work is the google calender command line interface, which can also be found in aptitude.  

sudo aptitude install gcalcli 

The important file here is .gcalclirc, also found/created in your home directory.  

Inside .gcalcli there needs to be three lines:
[gcalcli]
user: <google user>
pw: <google password>

After this file is configured, you can run several commands from the bash terminal  without entering your calender username and password.  

Some example commands are: 
 
gcalcli calm   (displays the month)
gcalcli agenda (displays the dates and times of the next 3 events)
gcalcli calw 2 (displays the next 2 weeks)

To display it in a conky file, the line is

${execi 300 gcalcli --nc --cals=owner calw 4}

Which runs the gcalcli command once every few minutes.  And thats all you should need.  As promised, my .conkrc file follows this paragraph.  I like the way it ended up because it should be able to move between installs of Ubuntu without modification because it doesn't call on hardware specific status indications. 


.conkyrc:
 
alignment top_right
background no
border_width 0
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=10
gap_x 5
gap_y 60
minimum_size 5 5
net_avg_samples 2
double_buffer yes
out_to_console no
out_to_stderr no
extra_newline no
own_window yes
own_window_class Conky
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no
text_buffer_size 8096
   
TEXT
${color #00ff00}$alignc$sysname $kernel on $machine --- ${color #00ff00}$alignc${exec whoami} @ $nodename
${color #ff0000}$stippled_hr
${color #ff0000}Date: ${color #00ff00}${time %A,%d %B} ${color #ff0000}Time: ${color #00ff00}${time %k:%M:%S}${alignr}${color #ff0000}Uptime: ${color #00ff00}$uptime
${color #ff0000}$stippled_hr
${color #ff0000}CPU: ${color white} ${cpu cpu1}% ${cpubar cpu1}
${color #ff0000}RAM: ${color white} $memperc%  $mem/$memmax $membar
${color #ff0000}Swap: ${color white}$swapperc% $swap/$swapmax ${swapbar}
${execi 300 gcalcli --nc --cals=owner calw 4}

 

No comments:

Post a Comment