You are not logged in.

#1 2011-03-02 14:55:29

thedude85
Member
From: Berlin
Registered: 2011-02-24
Posts: 16

[SOLVED]Problems with Calendar in Conky

I'm using OpenBox with Conky, the conkyrc config file it's almost done but i'm having problems trying to configure a calendar, if i center the cal all the numbers will be centererd, the same if i align to right o left:

screenshota.jpg

This is the part of the script:

CALENDARIO ${hr 1}

${alignc}${exec cal -m -1}

I want it to see the calendar with the number under the correct day, not everything centered, or everything right...

Last edited by thedude85 (2011-03-15 09:49:41)


Grid

Offline

#2 2011-03-02 15:14:49

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: [SOLVED]Problems with Calendar in Conky

Are you using a monspaced font?

Offline

#3 2011-03-02 15:22:37

thedude85
Member
From: Berlin
Registered: 2011-02-24
Posts: 16

Re: [SOLVED]Problems with Calendar in Conky

This is mine conkyrc file:

I think MS is monospaced font?

# Use Xft?
use_xft yes
xftfont Trebuchet MS:size=7
xftalpha 0.7
text_buffer_size 1024

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
    own_window no
    own_window_transparent yes
    own_window_type desktop
    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

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

# Minimum size of text area
minimum_size 0 0

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color 000000
own_window_colour 000000

# Text alignment, other possible values are commented
alignment top_right

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

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none

TEXT
SISTEMA ${hr 1}

${cpugraph 20,210 000000 000000}
CPU0: ${cpu cpu0}% ${alignr}CPU1: ${cpu cpu1}% 
${cpubar 8,100 cpu} ${alignr}${cpubar 8,100 cpu}
RAM: $memperc% ${alignr}${membar 8,100}
Uptime: ${alignr}${uptime}
Kernel:  ${alignr}${kernel}
#CPU Temp1:$alignr${acpitemp}°C
#CPU0 Temp:$alignr${acpi -t}°C
#CPU1 Temp:$alignr${acpi -V cpu1}°C

HD ${hr 1}

${fs_used /home} / ${fs_size /home} ${alignr}${fs_bar 8,100 /home}

RED ${hr 1}

Velocidad subida: ${upspeed wlan0}k/s 
${upspeedgraph wlan0 9,170 789E2D A7CC5C}             
   
Velocidad bajada: ${downspeed wlan0}k/s 
${downspeedgraph wlan0 9,170 789E2D A7CC5C}

BATERIA ${hr 1}

Estado: ${battery_short BAT0} ${alignr}${battery_bar 9,100 BAT0}

FECHA ${hr 1}
${alignc 35}${font Trebuchet MS:size=26}${time %H:%M}${font}
${alignc}${time %a %d %b %Y}

CALENDARIO ${hr 1}

${alignc}${exec cal -m -1}

#End conkyrc file

Grid

Offline

#4 2011-03-02 15:26:43

SuNjACk
Member
Registered: 2011-02-27
Posts: 102

Re: [SOLVED]Problems with Calendar in Conky

Try using monospace

Offline

#5 2011-03-02 16:11:59

thedude85
Member
From: Berlin
Registered: 2011-02-24
Posts: 16

Re: [SOLVED]Problems with Calendar in Conky

Where do i change to monospace font in conkyrc?


Grid

Offline

#6 2011-03-13 20:53:15

kyla
Member
From: Arlington, VA
Registered: 2011-03-12
Posts: 112
Website

Re: [SOLVED]Problems with Calendar in Conky

Line 3:

xftfont Trebuchet MS:size=7

Replace Trebuchet with Monospace

Offline

#7 2011-03-14 15:14:29

Arpione
Member
From: Pécs, Hungary
Registered: 2010-09-13
Posts: 31

Re: [SOLVED]Problems with Calendar in Conky

This is my calendar rendering line for conky:

${font Inconsolata:size=13}${offset 40}${exec cal -m|head -n -1}${font}

Replace Inconsolata with your chosen fixed width font and change the font size and offset value to your liking. I used offset instead of alignc because the last line from the cal output is missing the trailing spaces, so it's narrower than the rest thus they can't be centered properly. head -n -1 is used to cut the last empty line from cal output.

Edit: If you change the default font with xftfont, you can omit the font tags.

Last edited by Arpione (2011-03-14 15:20:44)

Offline

#8 2011-03-15 09:49:16

thedude85
Member
From: Berlin
Registered: 2011-02-24
Posts: 16

Re: [SOLVED]Problems with Calendar in Conky

Thanks, fixed!


Grid

Offline

Board footer

Powered by FluxBB