You are currently viewing archive for May 2011

Conky with Awesome3

I've managed to get Conky configured as a bar at the bottom of my screen in Awesome3, while keeping windows from overlapping with it. In Awesome2 it was possible to pipe Conky's output into awesome-wm, in Awesome3 this isn't the case any more.

The solution is to create a very horizontal Conky configuration and combine that with a one-pixel-wide wibox at the place where you place your Conky bar. The wibox will prevent windows from hiding your conky, and with the right colour configurations it will look like part of your AwesomeWM.

The Awesome configuration ( ~/.config/awesome/rc.lua ) looks like this:

mystatusbar = awful.wibox({ position = "bottom", screen = 1, ontop = false, width = 1, height = 16 })

  • position = "bottom" puts the wibox at the bottom of the screen
  • screen = 1 places the wibox on screen 1
  • ontop = false means it doesn't have to be on top of other windows (it'll be empty anyway)
  • width = 1: one pixel wide is enough
  • height = 16: in my case, this is exactly the height of my Conky, so windows will touch it without overlapping

And the Conky configuration( ~/.conkyrc ).

In the TEXT block, notice the \ at the end of every line - this is equivalent to putting the whole thing on one line, only it's easier to read and maintain. There should be no blank lines after the last configuration line, because Conky will draw them.

Of course, if you want {n} lines, you can. Just make sure to adjust the height of your wibox accordingly.

alignment bottom_middle
background yes
border_width 1
cpu_avg_samples 2
default_color 222222
default_outline_color 222222
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
#xftfont DejaVu Sans Mono:size=12
xftfont Sans Mono:size=8
gap_x 5
gap_y 0
minimum_size 1260 6
maximum_width 1260
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no
own_window no
own_window_class Conky
own_window_type desktop
own_window_transparent yes
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer left
show_graph_scale no
show_graph_range no
format_human_readable yes

color1 666666
color2 888888
color3 444444


${if_mpd_playing} [${mpd_status} - ${mpd_elapsed}/${mpd_length}] ${scroll 35 5 ${mpd_smart}} ${else} \
${color1}Activity on /dev/sda:${color} ${diskiograph 10,50 000000 ff0000 -t}${endif} \
${alignr}${color1}br0 [${color3}${addr br0}${color}]: ${color1}Up:${color} ${upspeed br0} ${color1} - Down:${color} ${downspeed br0} \
${alignr}${color1}Battery: [${color3}${acpiacadapter}${color1}] ${color}${battery_percent BAT1}% ${battery_bar 5,50 BAT1} | \
${color1}CPU: ${color} ${cpu}% ${cpubar cpu0 5,50} ${color2}CPU1: ${cpubar cpu1 5,50} CPU2: ${cpubar cpu2 5,50} ${color}| \
${color1}RAM:${color} ${memperc}% ${membar 5,50}

SNMP trap forwarding to multiple destinations

It's quite simple, really... I'm not sure why it didn't work sooner. All that's needed in /etc/snmp/snmptrapd.conf is this:

disableAuthorization yes

forward default :162
forward default :2162

Ubuntu frustrations

I'm installing an Ubuntu 10.04 server at work. Because of proxy and internet configurations I'm installing packages from the CD instead of using the online repo's. No problem, I've done this before on virtual test machines without internet connectivity, it worked flawlessly.

Only those machines were 8.04. Not 10.04.

First problem: apt-cdrom add. For some reason it insists that the cd-rom can be found on /dev/sr1. Why it ignores /dev/sr0, which is where the cd-rom actually lives, is beyond me. The solution to this one is to configure a mountpoint in /etc/fstab (to /mnt/cdrom or so), and use

apt-cdrom -d /mnt/cdrom add

If you're lucky, apt will mount the cd-rom in /media/apt. If not, try a few more times until it works. If it's going to ignore the mountpoint anyway, shouldn't I be able to just tell apt-cdrom what device to use instead of what mountpoint?

Of course, after commenting out the online repos in /etc/apt/sources.list and running apt-get update, installing packages still doesn't work. No sirree, that would be too easy.

Failed to fetch cdrom:[Ubuntu-Server 10.04.2 LTS _Lucid Lynx_ - Release amd64(20110211.1)]/pool/main/p/patchutils/patchutils_0.3.1-2build1_amd64.deb File not found

And so on and so forth... not a single file can be cound, even though they do exist under /media/apt/pool/main/blablablablabla. You know, the point where apt actually mounted the cd-rom while ignoring my mountpoint?

The solution turns out to be really simple:

ln -s /media/apt /cdrom

Yes, you need a /cdrom directory or symlink in which the files on the cd-rom can be found, because the configured mountpoint in /etc/fstab and the one apt chose all by itself aren't enough.

User-friendly distro my ass...