You are not logged in.

#1 2005-10-28 10:35:45

mr_brightside
Member
Registered: 2005-09-01
Posts: 78

Conky - Lining up the bars perfectly

Right, this one's doing my head in. Below is my conkrc, and here is conky running on my desktop.

The problem is, despite fiddling around with the spacing in the text file, I can't get the bars displaying free space on various areas of my hard drive to line up (see pic near bottom; 4 bars visible). :?

Any ideas?

alignment top_right

## fork conky in background
#background true/false

# conky goes below all other apps
on_bottom true

# border_margin 10
# border_width 5

## no. of samples to average for the CPU data
cpu_avg_samples 5

## Default colors and border Colors yellow == #bbff55
default_color Black
default_shade_COLOR yellow
default_outline_color Black

## use Xdbe extension to eliminate flicker - enable own_window with this one
draw_borders false
draw_shades false
draw_outline false

## font
font nu

## Gap between borders of screen and text
gap_x 60
gap_y 150

## subtract file system buffers from used memory
no_buffers yes

## mail_spool (for mail checking)

#maximum_width
#maximum_size

## no. of samples to average for the net data
net_avg_samples 5

own_window false

own_window_transparent true

#own_window_colour (if not transparent)

pad_percents 0

## dashed borders
stippled_borders false

## no. of times for conky to update before quitting (0 = runs forever)
total_run_times 0

## how frequently conky updates
update_interval 1

## renders text in uppercase
uppercase true

## add spaces after certain objects, helps with mono fonts like Bitstream Vera Sans Mono
use_spacer no

## anti-aliased font and things - necessary to get some custom fonts working
use_xft yes

#######################################################
# // From here onwards begins text to go on screen // #
#######################################################

TEXT

${color #000000}$nodename$color      ${color #000000}$sysname $kernel on 
$machine$color

${color #000000}PROCESSING$color
   ${color #000000}CPU:$color            $cpu% 
   ${color #000000}$cpubar
   ${color #000000}${cpugraph 78af78 a3a3a3}

   ${color #98c2c7}NAME             PID       CPU%      MEM%
   ${color #e5e5e5}${top name 1} ${top pid 1}   ${top cpu 1}    ${top mem 1}
   ${color #c4c4c4}${top name 2} ${top pid 2}   ${top cpu 2}    ${top mem 2}
   ${color #a3a3a3}${top name 3} ${top pid 3}   ${top cpu 3}    ${top mem 3}
   ${color #828282}${top name 4} ${top pid 4}   ${top cpu 4}    ${top mem 4}

${color #ffcb48}DATA$color
   ${color #98c2c7}RAM:$color     $memperc%         ${color 
#78af78}${membar 6}${color}

   ${color #98c2c7}NAME             PID       CPU%      MEM%
   ${color #e5e5e5}${top_mem name 1} ${top_mem pid 1}   ${top_mem cpu 1} 
    ${top_mem mem 1}
   ${color #c4c4c4}${top_mem name 2} ${top_mem pid 2}   ${top_mem cpu 2} 
    ${top_mem mem 2}
   ${color #a3a3a3}${top_mem name 3} ${top_mem pid 3}   ${top_mem cpu 3} 
    ${top_mem mem 3}
   ${color #828282}${top_mem name 4} ${top_mem pid 4}   ${top_mem cpu 4} 
    ${top_mem mem 4}

   ${color #98c2c7}Swap:$color             $swapperc%            ${color #78af78}${swapbar 6}$color
   ${color #98c2c7}/:$color                 ${fs_free_perc /}%  $fs_free   ${color #78af78}${fs_bar 6 /}$color
   ${color #98c2c7}/home:$color            ${fs_free_perc /home/}%  ${fs_free /home}   ${color #78af78}${fs_bar 6 /home/}$color
   ${color #98c2c7}/mnt/warehouse:$color  ${fs_free_perc /mnt/warehouse/}%  ${fs_free /mnt/warehouse}  ${color #78af78}${fs_bar 6 /mnt/warehouse/}$color

   ${color #98c2c7}Upload:$color  ${upspeed eth0}kb/s${color #98c2c7} 
   Download:$color  ${downspeed eth0}kb/s

Offline

#2 2005-10-28 12:15:34

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Conky - Lining up the bars perfectly

Instead of messing with spacing, you could try the $offset variable:

${offset x}

Where x is the amount to push it over.

-=edit=-
Actually, I just realized there's an easier way.  Align the bars to right, and specify their width.  For example:

${color #78af78}${fs_bar 6 /home/}$color 

becomes

$alignr${color #78af78}${fs_bar 6,width /home/}$color 

Offline

#3 2005-10-28 12:36:45

smoon
Member
Registered: 2005-08-22
Posts: 468
Website

Re: Conky - Lining up the bars perfectly

You can also align your bars on the right side:

(...)
   ${color #98c2c7}Swap:$color             $swapperc%${color #78af78}${alignr 5}${swapbar 6}$color
   ${color #98c2c7}/:$color                 ${fs_free_perc /}%  $fs_free   ${color #78af78}${alignr 5}${fs_bar 6 /}$color
   ${color #98c2c7}/home:$color            ${fs_free_perc /home/}%  ${fs_free /home}   ${color #78af78}${alignr 5}${fs_bar 6 /home/}$color
   ${color #98c2c7}/mnt/warehouse:$color  ${fs_free_perc /mnt/warehouse/}%  ${fs_free /mnt/warehouse}  ${color #78af78}${alignr 5}${fs_bar 6 /mnt/warehouse/}$color
(...)

Or you could use a monospaced font and use spaces. There's also a way to align text (or bars) to the center (alignc). Just have a look at the manpage or other configs.

Offline

#4 2005-10-28 16:14:14

mr_brightside
Member
Registered: 2005-09-01
Posts: 78

Re: Conky - Lining up the bars perfectly

Excellent info, thanks a lot guys! big_smile

Offline

#5 2005-10-30 19:29:12

shadowhand
Member
From: MN, USA
Registered: 2004-02-19
Posts: 1,142
Website

Re: Conky - Lining up the bars perfectly

I've been using spacing too :oops: thanks for the info times two.


·¬»· i am shadowhand, powered by webfaction

Offline

Board footer

Powered by FluxBB