#1 Le 07/11/2013, à 13:54
- Endash
[Résolu] Premiers pas avec Conky: décalage avec Goto
Bonjour,
Je fais mes premiers pas avec Conky et je rencontre mon premier bug.
Mon conkyrc contient (entre autres) les lignes suivantes:
Mem Usage: $memperc% ${goto 1015} $membar
CPU Usage: ${cpu}% ${goto 1015} ${cpubar}
J'utilise le goto pour forcer l'alignement des barres, indépendamment du nombre de chiffres affichés dans les valeurs en pourcentage $memperc et ${cpu}.
Je l'utilise certainement mal, car quand Conky se lance au démarrage de session (par la commande suivante):
/usr/bin/conky -p 10 -d
le résultat est catastrophique:
Mais, si je change la valeur des goto, de 1015:
Mem Usage: $memperc% ${goto 1015} $membar
CPU Usage: ${cpu}% ${goto 1015} ${cpubar}
à 10 (ou n'importe quoi d'autre):
Mem Usage: $memperc% ${goto 10} $membar
CPU Usage: ${cpu}% ${goto 10} ${cpubar}
puis que je sauve le .conkyrc, puis que je reviens à 1015 comme avant:
Mem Usage: $memperc% ${goto 1015} $membar
CPU Usage: ${cpu}% ${goto 1015} ${cpubar}
alors j'obtiens le résultat désiré:
Quelqu'un saurait-il m'expliquer ce que je fais mal ?
Mon .conkyrc complet:
# set to yes if you want Conky to be forked in the background
background yes
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
# X font when Xft is disabled, you can pick one with program xfontsel
#font 7x12
#font 6x10
#font 7x13
#font 8x13
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1
# Use Xft?
use_xft yes
# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=8
own_window_transparent yes
own_window_colour hotpink
# Text alpha when using Xft
xftalpha 0.8
#~ on_bottom yes
# mail spool
mail_spool $MAIL
# Update interval in seconds
update_interval 1
# Create own window instead of using desktop (required in nautilus)
own_window no
show_graph_scale yes
# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes
# Minimum size of text area
#minimum_size 280 5
#maximum_width 150
# Draw shades?
draw_shades no
# Draw outlines?
draw_outline no
# Draw borders around text
draw_borders no
# Stippled borders?
stippled_borders 10
# border margins
#~ border_margin 4
# border width
border_width 1
# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white
# Text alignment, other possible values are commented
#alignment top_left
#minimum_size 10 10
alignment top_right
gap_x 130
gap_y 70
#alignment bottom_left
#alignment bottom_right
# Gap between borders of screen and text
# Add spaces to keep things from moving about? This only affects certain objects.
use_spacer none
# Subtract file system buffers from used memory?
no_buffers yes
# set to yes if you want all text to be in uppercase
uppercase no
# Use G instead of GiB
short_units yes
# boinc (seti) dir
# seti_dir /opt/seti
TEXT
${color #ddaa00}$nodename${color #888}: $sysname $kernel on $machine
${color #888}Uptime: $uptime - Load: $loadavg
Network: ${color #ddaa00}${wireless_essid wlan0}${color #888} ${wireless_link_qual_perc wlan0}% Down: ${downspeed wlan0} ${color #444}| Up: ${upspeed wlan0}${color 888}
${downspeedgraph wlan0 32,150} $alignr${color #444}${upspeedgraph wlan0 32,150}${color #888}
File system
/home: ${fs_used /home} / ${fs_size /home} ${fs_bar /home}
/ : ${fs_used /} / ${fs_size /} ${fs_bar /}
/data: ${fs_used /data} / ${fs_size /data} ${fs_bar /data}
Temperature: ${acpitemp}°C
Mem usage PID CPU% MEM%
${color #ddaa00} ${top_mem name 1} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${color #888} ${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}
Mem Usage: $memperc% ${goto 1015} $membar
CPU Usage: ${cpu}% ${goto 1015} ${cpubar}
${cpugraph lightgrey lightgrey}
CPU usage PID CPU% MEM%
${color #ddaa00} ${top name 1} ${top pid 1} ${top cpu 1} ${top mem 1}
${color #888} ${top name 2} ${top pid 2} ${top cpu 2} ${top mem 2}
${top name 3} ${top pid 3} ${top cpu 3} ${top mem 3}
${time %A %d %B} - semaine ${time %V}
${font Bitstream Vera Sans Mono:size=24}${time %T %Z}${font Bitstream Vera Sans Mono:size=8}
*** EDIT ***
Problème réglé en imposant les dimensions de la zone de texte:
# Minimum size of text area
minimum_size 308 5
maximum_width 308
Dernière modification par Endash (Le 07/11/2013, à 14:13)
Acer Aspire 3 sous Xubuntu 24.04
Asus Zenbook UX305F sous Xubuntu 24.04
Hors ligne