4

I'm grabbing the output of u1sdtool --cur to be reported in my conky. The output is:

u1sdtool --cur
Current uploads: 0
Current downloads: 0

This text is grabbed in the TEXT part of my conkyrc config file as:

${goto 55}${font Ubuntu:size=10,weight:normal}${color}U1 SYNC 
${goto 55}${font Ubuntu:size=10,weight:normal}${color1}${exec u1sdtool --cur }

Given that the text returned from u1sdtool --cur has two lines, the first line will be offset by 55 but the second will not.

See the bottom of the image. I would like to see the 'Current downloads' line be offset at 55 as well. Any idea how to do this?

conky screenlet

This conky config file is my customized version of hardball's orange theme

Edit: What I would like to have, ideally, is the correct alignment and, once I do have uploads, see a list of file names. Such as eg.

U1 SYNC 
Current uploads: 3
  filename.txt 
  filename.jpg 
  filename.zip
Current downloads: 0

1 Answer 1

1

One solution is to split the output of u1sdtool --cur with grep:

u1sdtool --cur | grep 'Current uploads:'
u1sdtool --cur | grep 'Current downloads:'

Your conkyrc would look like:

${goto 55}${font Ubuntu:size=10,weight:normal}${color}U1 SYNC 
${goto 55}${font Ubuntu:size=10,weight:normal}${color1}${exec u1sdtool --cur | grep 'Current uploads:' }
${goto 55}${font Ubuntu:size=10,weight:normal}${color1}${exec u1sdtool --cur | grep 'Current downloads:' }

I will suggest to use execi instead to exec because exec is resource hungry. for more details:

man conky
1
  • Thanks for that hint. I experimented with that. The problem is that once I do have up- or downloads going on, it will only report the one line with 'Current uploads'. I changed the grep statement to "grep -e 'Current uploads:' -e path" but then it mixes the up- and downloads up and I only get to see the initial part of the path. One could also add the -c option to get a count. I restated in my original question what I would like to have. Still, your answer was good, so +1 - but not exactly what I was looking for. Cheers!
    – Philippe
    Apr 5, 2013 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .