LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Conky offsets shades with different sized fonts (https://www.linuxquestions.org/questions/linux-software-2/conky-offsets-shades-with-different-sized-fonts-927688/)

Weapon S 02-05-2012 02:54 AM

Conky offsets shades with different sized fonts
 
2 Attachment(s)
Hi everybody, Conky changes the shades if a different sized font is added. I'm using Conky 1.8 on Debian Squeeze. This is what the shades normally look like (and I prefer):
Attachment 9015
And this happens when I use a text with a larger font.
Attachment 9014
I have now also tried it with a simple plain text, and the problem persists. This is the conkyrc file I use. To be sure, I had removed all redundant formatting. The last couple of lines make the difference.
Code:

alignment top_right
background yes
border_width 1
cpu_avg_samples 3
default_color green
default_outline_color white
default_shade_color black
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades yes
use_xft yes
xftfont DejaVu Sans Mono:size=8
# X font when Xft is disabled, you can pick one with program xfontsel

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 15
gap_y 15
minimum_size 220 5
net_avg_samples 2

# Subtract file system buffers from used memory?
no_buffers no

out_to_console no
out_to_stderr no
#?
extra_newline no

own_window yes
#X window class. Sort of a title.
own_window_class Conky
own_window_type desktop
own_window_transparent yes
# If own_window is yes, these window manager hints may be used
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

stippled_borders 0
update_interval 5.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range yes

TEXT
${font}${color goldenrod}Hostname: $nodename
${color goldenrod}Linux Kernel: $kernel
${color goldenrod}CPU Details:  $machine, $freq(MHz)
${color}CPU History:  ${color darkgreen}${cpugraph 30,0 404040 5577ff}
${color}CPU Usage:${color magenta2} $cpu% ${cpubar 11,0}
RAM Usage: $mem ($memperc%) ${membar 11,0}
Available RAM: $memmax
$stippled_hr
$alignc Processes:$color $processes  ${color grey}Running:$color $running_processes
$alignc${color}(top 5 sorted by CPU usage)
${color goldenrod} NAME              PID    CPU%  MEM%
${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${top name 4} ${top pid 4} ${top cpu 4} ${top mem 4}
${top name 5} ${top pid 5} ${top cpu 5} ${top mem 5}

$alignc(top 5 sorted by MEM usage)
${color goldenrod} NAME              PID    CPU%  MEM%
${color} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${top_mem name 2} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${top_mem name 3} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${top_mem name 4} ${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${top_mem name 5} ${top_mem pid 5} ${top_mem cpu 5} ${top_mem mem 5}
$stippled_hr
$aligncSystem Uptime:${color DarkOrange1} $uptime
# http://sethjust.com/2009/08/03/a-useful-calendar-in-conky/
${hr 2}
${font DejaVu Sans Mono : size=16}${color white}${execpi 7200 DJS=`date +%_d`; cal | sed s/"\(^\|[^0-9]\)$DJS"'\b'/'\1${color orange}'"$DJS"'${color white}$alignc'/}

I have tried using offset and voffset, but the shades move along with the output. Is this shade offset a bug or a feature? Can I revert to the normal (1 or 2 pixels wide) offset of the shades? Any advice welcome. I have searched the net, but if you know a good resource for Conky info, that's welcome too. Thanks for reading.

ukiuki 02-05-2012 04:56 AM

One small mistake here line 75
Code:

Conky: unknown variable aligncsystem
Need space between $alignc and System
Code:

$alignc System Uptime:${color DarkOrange1} $uptime
The last line is what is causing the problem with the shades,
Code:

${font DejaVu Sans Mono : size=16}${color white}${execpi 7200 DJS=`date +%_d`; cal | sed s/"\(^\|[^0-9]\)$DJS"'\b'/'\1${color orange}'"$DJS"'${color white}$alignc'/}
And as the autor said:
Quote:

...actually getting the date highlighted is somewhat hard, and all of the articles I found suggested methods that broke in various situations...
I would just disable the shades.

Regards

Weapon S 02-05-2012 07:01 AM

Not there yet...
 
Thank you for taking a serious look at my conkyrc. There could be a couple of small mistakes in the files I post, however I am very sure it is the changing of the size of the font alone that causes trouble.
[Update]
I realized Conky outputs the shadows after it has outputted the foreground. The linear way in which Conky works thus requires the font to be reset at the end of the output.
Adding ${font} at the end of the file solved the issue.


All times are GMT -5. The time now is 01:47 AM.