Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#2551 Le 06/08/2010, à 06:51

chepioq

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

[quote=Fenouille84

Edit :
De plus, il est préférable que ton script se termine par exit 0
Ce qui, au final, devrait te faire un script lancer-conky.sh du genre :

#!/bin/bash

sleep 5
conky -c ~/conky/conkyrc1 &
sleep 5
conky -c ~/conky/conkyrc2 &

exit 0

Quel est l'avantage (ou le problème) que l'on a si on ne met pas exit 0 à la fin du script.
Dans mon script je ne l'ai pas et cela fonctionne.


Tout est dans tout et réciproquement....

Hors ligne

#2552 Le 06/08/2010, à 11:25

Fenouille84

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

DarthWound a écrit :

Je pensais à un truc, totalement gadget, mais que j'aimerais intégrer à mon Conky : de l'ASCII Art.
Une idée pour ça?

Essaye de rediriger la sortie vers un fichier... hmm
Comme sa, dans conky, tu lis ce fichier, et pas directement le code ASCII.

chepioq a écrit :

mais tu verras, c'est un faisant des erreurs que l'on progresse

+1 !! smile


Ma page Deviant Art : conky inside ;-)
.
-- DropBox (online backup) : 2Go + 250 Mo pour vous et moi par parrainage --

Hors ligne

#2553 Le 06/08/2010, à 11:25

wlourf

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

et

conky -c ~/conky/conkyrc1 -p 5

devrait t'éviter d'écrire le "sleep 5", non ?

Hors ligne

#2554 Le 06/08/2010, à 11:27

Fenouille84

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

D'après la doc de conky, oui sa devrait le faire.
Jamais essayé cela dit... hmm


Ma page Deviant Art : conky inside ;-)
.
-- DropBox (online backup) : 2Go + 250 Mo pour vous et moi par parrainage --

Hors ligne

#2555 Le 06/08/2010, à 11:32

DarthWound

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Fenouille84 a écrit :
DarthWound a écrit :

Je pensais à un truc, totalement gadget, mais que j'aimerais intégrer à mon Conky : de l'ASCII Art.
Une idée pour ça?

Essaye de rediriger la sortie vers un fichier... hmm
Comme sa, dans conky, tu lis ce fichier, et pas directement le code ASCII.

Hmmmm pas bête ! Merci tongue

#2556 Le 06/08/2010, à 19:06

maaduck

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Fenouille84 a écrit :
maaduck a écrit :

Hello.
Je cherche un script...

Va plutôt voir par là wink

Merci Fenouille84  smile j'viens de voir le code vnstat de DJipey  smile faut que j'essai ça

Dernière modification par maaduck (Le 06/08/2010, à 19:21)

Hors ligne

#2557 Le 06/08/2010, à 19:13

Mario_26

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

salut

mini_557167Capture1.jpg   mini_794447Capture.png    mini_869086Capture_4.png


mini_910730Capture_1.png    mini_803710Capture_2.png    mini_666210Capture_3.png


Dell Vostro 3700 | 4 Gib DDR | Geforce GT 330M | Intel Core I5 | Precise Pangolin -> I like ubuntu (-;
Communauté Devosi
Open Source Informatique

Hors ligne

#2558 Le 06/08/2010, à 19:45

mycke88

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

alor voila mon conky et ses conkyrc:

screenshot: http://a.imageshack.us/img839/1214/captureah.png

conkyrc:

use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
##own_window_hints undecorated,below,skip_taskbar
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background yes
double_buffer yes
minimum_size 280 5
draw_shades no
draw_outline no
draw_borders no
stippled_borders 8
border_margin 0
border_width 0
default_color white
default_shade_color black
default_outline_color black
alignment top-right
gap_x 55
gap_y 60
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer no

TEXT
${color white}${font arial :size=14}RhythmBox Now Playing :
${exec rhythmbox-client --print-playing-format "%ta - %at"}

conkyrc2:

#emplacement
alignment top_right
use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
##own_window_hints undecorated,below,skip_taskbar
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background yes
double_buffer yes
minimum_size 280 5
draw_shades no
draw_outline no
draw_borders no
stippled_borders 8
border_margin 0
border_width 0
default_color white
default_shade_color black
default_outline_color black
alignment top-right
gap_x 10
gap_y 70
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer no

TEXT
${font arial :size=9}$alignc${color #00FFFF}${execi 86400 lsb_release -si} : ${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}
${font arial :size=9}$alignc${color #00FFFF}$sysname : $kernel $machine 
${color #FF0000}$hr 
${font arial :size=10}${color white}Disque dur :$alignr${fs_free /}
${color #FFFFFF}Root: ${color #FFFFFF}${fs_free /}/${fs_size /} ${color #00FFFF}${fs_bar /}
${font arial :size=10}${color white}Disque Externe : ${font :size=8}${color white}${fs_free /media/WD USB 2}/${fs_size /media/18C9-0D14}  ${color #00FFFF}${fs_bar /media/18C9-0D14}
${color #FF0000}$hr
${font arial :size=10}${color #FFFFFF}Mémoire RAM :${#FFFFFF} $alignr$mem/$memmax - $memperc%
${color #00FFFF}${membar}
${font arial :size=10}${color #FFFFFF}Mémoire SWAP :${color #FFFFFF} $alignr$swap/$swapmax - $swapperc%
${color #00FFFF}${swapbar}
${color white}${font arial :size=10}Core 1 : ${color #00FFFF}${freq cpu1}Mhz $alignr${color #00FFFF}${cpubar cpu1 5,85} ${color white}:${font arial :size=10}${cpu cpu1}%  
$alignc${color #00FFFF}${cpugraph cpu1 26,150 00ffed 00ffed}
${color #FF0000}$hr
${color1}:${font arial :size=10}Down:${color1}${downspeed GSM (ttyACMO)} k/s${color1}${offset 80}Up:${color1}${upspeed GSM (ttyACMO)} k/s
${color #00FFFF}${downspeedgraph wlan0 6,140 000000 7f8ed3}   ${color #00FFFF}   ${upspeedgraph wlan0 6,140 000000 7f8ed3}
${font arial :size=10}${color1}TCP Connections: ${color1}${tcp_portmon 1 65535 count}
${color #FF0000}$hr
${font arial :size=10}${color white}IP Locale  : ${color #00FFFF}${addr eth0}
${font arial :size=10}${color white}Passerelle : ${color #00FFFF}${gw_ip}
${font arial :size=10}${color white}Serveur    : ${color #00FFFF}$nameserver
${color #FF0000}$hr
${font arial :size=10}${color1}Carte Mère:${color #00FFFF}${exec sensors | grep temp1 | awk '{ print $2}'}${alignr}${color1}Processeur:${color #00FFFF}${exec sensors | grep temp2 | awk '{ print $2}'}
${font arial :size=10}${color1}Ventilateur:${color #00FFFF}${execi 10 sensors | grep 'fan1' | sed 's/.*://;' | sed 's/M .*/M/;' | sed 's/^[[:blank:]]*//'}${color white}$alignr SDA:${color #00FFFF}${hddtemp /dev/sda}°
${color #FF0000}$hr
${font arial :size=10}${color white}Lecture ${color #00FFFF}${diskio_read} ${font arial :size=10}${color white}$alignr Écriture ${color #00FFFF}${diskio_write}
${color #FF0000}$hr
${font arial :size=10}${color white}Processus : ${color #00FF00}${color}$processes ${color white}En cours : ${color #00FFFF}${color}$running_processes ${color #00FF00}${font arial :size=10}$alignr${color #FFFFFF}(%)  CPU   MEM
  ${font arial :size=10}${color #00FFFF}${top name 1} $alignr${top cpu 1} ${top mem 1}
  ${font arial :size=10}${color #00FFFF}${top name 2} $alignr${top cpu 2} ${top mem 2}
  ${font arial :size=10}${color #00FFFF}${top name 3} $alignr${top cpu 3} ${top mem 3}
  ${font arial :size=10}${color #00FFFF}${top name 4} $alignr${top cpu 4} ${top mem 4}
  ${font arial :size=10}${color #00FFFF}Mémoire :${color #FFFFFF}$alignr (%)  CPU   MEM
  ${font arial :size=10}${color #00FFFF}${top_mem name 1} $alignr${top_mem cpu 1} ${top_mem mem 1}
  ${font arial :size=10}${color #00FFFF}${top_mem name 2} $alignr${top_mem cpu 2} ${top_mem mem 2}
  ${font arial :size=10}${color #00FFFF}${top_mem name 3} $alignr${color #00FFFF}${top_mem cpu 3} ${top_mem mem 3}
${color #FF0000}$hr

conkyrc3:

use_xft yes
xftfont Bitstream Vera Sans Mono:size=8
xftalpha 0.8
update_interval 1.0
total_run_times 0
own_window yes
own_window_argb_visual yes
own_window_transparent yes
##own_window_hints undecorated,below,skip_taskbar
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
background yes
double_buffer yes
minimum_size 280 5
draw_shades no
draw_outline no
draw_borders no
stippled_borders 8
border_margin 0
border_width 0
default_color white
default_shade_color black
default_outline_color black
alignment top-right
gap_x 10
gap_y 700
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer no

TEXT

    ${font arial :size=13}${color #00FFFF}${time %A %d %B %Y} -${color #FFFFFF} ${time %H:%M:%S}
       ${color red}---------------------------------------- 
$alignc${color #00FFFF}   Systeme allumé depuis:$color $uptime


${execp cal | sed 's/^/ /g' | sed 's/'" $(date +%e)"'/\${color2}'" $(date +%e)"'\${color1}/1' | sed -e "1d ; s/^/\${goto X}/g"}

lancer-conky (script):

#!/bin/bash
sleep 5
conky -c /home/mick/conky/conkyrc &
sleep 5
conky -c /home/mick/conky/conkyrc2 &
sleep 5
conky -c /home/mick/conky/conkyrc3 &

exit 0

il me reste un petit probleme, c'est le centrage et l'alignement du calendrier

Hors ligne

#2559 Le 06/08/2010, à 19:47

djipey

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

maaduck a écrit :
Fenouille84 a écrit :
maaduck a écrit :

Hello.
Je cherche un script...

Va plutôt voir par là wink

Merci Fenouille84  smile j'viens de voir le code vnstat de DJipey  smile faut que j'essai ça

Mon code vnstat me permet de ne pas avoir recours à des scripts. J'ai du ruser pour le dl du mois, à cause de la langue de la date dans vnstat. Mais il faut installer le programme vnstat. Quelqu'un aurait une solution à mon problème svp?

Hors ligne

#2560 Le 06/08/2010, à 20:34

maaduck

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Tu cherche a voir quel espace disque en fait?

celui de ta clef USB ?


Je sais pas si ça va t'aider pour mes clef USB j'utilise IF

${if_mounted /media/E218-8E8D}${image /home/mad-duck/.conky/images/clefusb.png -p 5,590}
${voffset -5}${alignr}USB : ${fs_used /media/E218-8E8D} / ${fs_size /media/E218-8E8D}$else${endif}

${if_mounted /media/EA05-F5AC}${image /home/mad-duck/.conky/images/clefusb.png -p 5,590}
${voffset -25}${alignr}USB : ${fs_used /media/EA05-F5AC} / ${fs_size /media/EA05-F5AC}

$else$hr${endif}

En gros Si E218-8E8D est branchée il m'affiche clefusb.png et les info  espace utilisé/ espace libre
Sinon  SI EA05-F5AC est branchée afficher ...

ce  qui donne

conky.jpg

si aucune de mes deux clef sont branché alors l'icone de clef et les infos s'affiche pas.

J'espère que ça t'aide



D'ailleur t'as du ruser ?

Comment tu fais pour faire passer la commande "vnstat -u -i eth0"  il me renvoit qu'il peut pas, en console j'ai la meme réponse sauf si je la fait en "sudo" .

Hors ligne

#2561 Le 06/08/2010, à 20:44

djipey

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

${if_mounted /media/E218-8E8D}${image /home/mad-duck/.conky/images/clefusb.png -p 5,590}
${voffset -5}${alignr}USB : ${fs_used /media/E218-8E8D} / ${fs_size /media/E218-8E8D}$else${endif}

${if_mounted /media/EA05-F5AC}${image /home/mad-duck/.conky/images/clefusb.png -p 5,590}
${voffset -25}${alignr}USB : ${fs_used /media/EA05-F5AC} / ${fs_size /media/EA05-F5AC}

$else$hr${endif}

Je fais un if aussi, mais regarde: /media/EA05-F5AC c'est ce que tu mets. Quand tu mets une clé usb inconnue par exemple, tu ne sais pas sur quel point de montage elle atterrit. C'est ce problème que je veux résoudre.


Pour ce qui est de la ruse, quand tu lances vnstat -u sans les droits super-utilisateur, la console te renvoie un truc du genre : /dossierx/dossiery/etho.db: impossible de réecrire ou remplacer le fichier, gnagnagna. Tu fais alors:

sudo chwon ton_nom_utilisateur /dossierx/dossiery (mais pas /dossierx/dossiery:etho.db)

Et là ça marche. En fait tu te rends propriétaire du dossier (il est dans les dossier système) pour pouvoir modifier le .db à ta guise.

Hors ligne

#2562 Le 06/08/2010, à 22:30

wlourf

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Hors ligne

#2563 Le 06/08/2010, à 22:46

djipey

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Maaduck, pourrais tu joindre ton conkyrc en entier s'il te plaît? certaines parties m'intéressent.

Hors ligne

#2564 Le 06/08/2010, à 23:28

Mario_26

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

@ wlourf: tu édite 4 tilda au démarrage d'ubuntu (autostart.sh) :

Système > Préférence > application au démarrage > ajouté

Dernière modification par Mario_26 (Le 06/08/2010, à 23:29)


Dell Vostro 3700 | 4 Gib DDR | Geforce GT 330M | Intel Core I5 | Precise Pangolin -> I like ubuntu (-;
Communauté Devosi
Open Source Informatique

Hors ligne

#2565 Le 07/08/2010, à 01:55

Mpok

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

@admin : time for a '(4) Conky'....

Hors ligne

#2566 Le 07/08/2010, à 11:20

maaduck

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

djipey a écrit :

Je fais un if aussi, mais regarde: /media/EA05-F5AC c'est ce que tu mets. Quand tu mets une clé usb inconnue par exemple, tu ne sais pas sur quel point de montage elle atterrit. C'est ce problème que je veux résoudre.

Pour ce qui est du nom de ta clef usb comme moi " /media/EA05-F5AC " celui change que si tu formate ta clef, en gros a chaque branchement ma clef s'ouvre dans ce dossier, si je la format le nom du dossier dans /media/ changera.

djipey a écrit :

Maaduck, pourrais tu joindre ton conkyrc en entier s'il te plaît? certaines parties m'intéressent.

Oui tiens smile

# temps pour fermer conky en seconde. 0 = toujours actif 
total_run_times 0

# affiche le texte sur la sortie standard
out_to_console no

# réglage de la mémoire, pour éviter le clignotement
double_buffer yes
# Soustraire les mémoires tampons de la mémoire utilisée
no_buffers yes
text_buffer_size 2048

# taux de rafraichissement de la fenêtre (en secondes)
update_interval 1

# nombre d'échantillons à utiliser pour calculer la moyenne d'utilisation
cpu_avg_samples 4
net_avg_samples 2

# taille et positon
alignment top_right
minimum_size 320 5
maximum_width 200

# écart avec le bord x=gauche ou droit y= haut ou bas
gap_x 5
gap_y 50

#  afficher les ombres
draw_shades yes
# afficher des contours
draw_outline no
# contours autour des blocs de texte
draw_borders no
# largeur du contour
border_width 1
# largeur des marges
border_margin 4
#afficher les contours des graph
draw_graph_borders yes


#pour que conky tourne en arrière plan background no pour les tests
background yes

# utiliser sa propre fenêtre
own_window yes

#type de fenêtre : normal(avec le cadre) / override / desktop
own_window_type override # normal / override / desktop

#pseudo transparence si vous avez des icones sous le conky elle ne seront plus accessible une fois conky activé
own_window_transparent yes

# Utiliser Xft (polices lissées etc)
use_xft yes
xftalpha .1
override_utf8_locale yes # force UTF8

#police a utiliser : use_xft doit être a "yes"
xftfont Fixed:size=7#OCR A Std:size=6
# Tout le texte en majuscule
uppercase no

# Ajoute des espaces après certains objets pour éviter de les faire bouger.
# Fonctionne uniquement avec les polices Fixes
use_spacer right

# Couleurs
default_color FFFFFF #blanc
default_shade_color 333333
default_outline_color black

color1 e49c16 
color2 CA0000 #rouge

color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 BBBBBB


TEXT
#*****ORDINATEUR****
 ${image /home/mad-duck/.conky/images/Ubuntu.png -p 0,0}${voffset 5}${alignr}${execi 86400 lsb_release -sr} ${execi 86400 lsb_release -sc}
${alignr}$kernel $machine
${alignr}Uptime : $uptime

$hr
#****MEMOIRE/SWAP****
RAM      : ${alignr}$memperc% ${membar 8,60}

Swap    : ${alignr}${fs_used /dev/sda5} / ${fs_free /dev/sda5}
${alignr}${fs_used_perc /dev/sda5}%${fs_bar 8,100/dev/sda5}


Process : ${alignr}$processes Running : $running_processes

$hr
#****CPU****

${offset 70}Total :$cpu %  ${offset 15}n°1 :${offset 10}${cpu cpu1} %
${offset 140}n°2 :${offset 10}${cpu cpu2} %
${offset 140}n°3 :${offset 10}${cpu cpu3} %
${offset 140}n°4 :${offset 10}${cpu cpu4} %
${image /home/mad-duck/.conky/images/phenom_x4.png -p 5,175}

$hr
#****ATI****
${image /home/mad-duck/.conky/images/Ati.png -p 10,270}${offset 75}Freq GPU : ${alignr}${exec  aticonfig --adapter=0 --od-getclocks | grep  "Current Clocks" | awk '{ print $4}'} MHz
${offset 75}Charge GPU : ${alignr}${exec  aticonfig --adapter=0 --od-getclocks | grep  "GPU load" | awk '{ print $4}'}
${offset 75}Temp GPU : ${alignr}${exec  aticonfig --od-gettemperature | grep Temperature | cut -c43-47}°C
${offset 75}Freq Memoire : ${alignr}${exec  aticonfig --adapter=0 --od-getclocks | grep  "Current Clocks" | awk '{ print $5}'} MHz

$hr
#****RESEAU****
Down ${offset 20}${totaldown eth0} ${offset 8}${alignr}Up ${alignr}${totalup eth0}
${downspeedgraph eth0 22,80 5e7b7b d8deeb} ${alignr}${upspeedgraph eth0 22,80 99c8e8 618094}
${offset 10}${voffset -21}${downspeedf eth0}k/s
${offset 130}${voffset -14}${upspeedf eth0}k/s

${alignc}Aujourd'hui ${execi 1 vnstat -u -i eth0}
Down:${execi 1 vnstat -i eth0 | grep "today" | awk '{print $2 $3}'}${alignr}Up: ${execi 1 vnstat -i eth0 | grep "today" | awk '{print $5 $6}'}
${alignc}Semaine
Down:${execi 1 vnstat -w -i eth0 | grep "current week" | awk '{print $3 $4}'}${alignr}Up: ${execi 1 vnstat -w -i eth0 | grep "current week" | awk '{print $6 $7}'}
${alignc}Mois
Down:${execi 1 vnstat -m -i eth0 | grep "'" | tail -n 1 | awk '{print $3 $4}'}${alignr}Up: ${execi 1 vnstat -m -i eth0 | grep "'" | tail -n 1 | awk '{print $6 $7}'}
${alignc}Total
Down: ${execi 1 vnstat | grep "received:" | awk '{print $2 $3}'}${alignr}Up: ${execi 1 vnstat | grep "transmitted:" | awk '{print $2 $3}'}

$hr
#****DISQUE DUR****
${image /home/mad-duck/.conky/images/disque_dur_3d_.png -p 5,500}
${offset 80}Temp : ${hddtemp /dev/sda}°
${alignr}Home : ${fs_used /home} / ${fs_free /home}
${alignr}${fs_used_perc /home}% ${fs_bar 8,100 /home}

${diskiograph_read /dev/sda 22,80 99c8e8 618094} ${alignr}${diskiograph_write /dev/sda 22,80 99c8e8 618094}
${offset 8}${voffset -25}read:${diskio_read /dev/sda}
${offset 130}${voffset -13}write:${diskio_write /dev/sda}

#****clef usb****
${if_mounted /media/E218-8E8D}${image /home/mad-duck/.conky/images/clefusb.png -p 5,590}
${voffset -5}${alignr}USB : ${fs_used /media/E218-8E8D} / ${fs_size /media/E218-8E8D}$else${endif}

${if_mounted /media/EA05-F5AC}${image /home/mad-duck/.conky/images/clefusb.png -p 5,590}
${voffset -25}${alignr}USB : ${fs_used /media/EA05-F5AC} / ${fs_size /media/EA05-F5AC}

$else$hr${endif}

Name                             ${alignr}CPU      ${alignr}RAM
${color #e09495} ${top name 1}   ${alignr}${top cpu 1}  ${alignr}${top mem 1}
${color #e0d094} ${top name 2}   ${alignr}${top cpu 2}  ${alignr}${top mem 2}
${color1} ${top name 3}    ${alignr}${top cpu 3}  ${alignr}${top mem 3}
${color1} ${top name 4}    ${alignr}${top cpu 4}  ${alignr}${top mem 4}
${color1} ${top name 5}    ${alignr}${top cpu 5}  ${alignr}${top mem 5}

Il y a surement des choses à modifier pour le rendre plus lèger, je regarderais ça plus tard

Pour le Total télécharger et envoyer tu utilise

${alignc}Total
Down: ${execi 1 vnstat | grep "received:" | awk '{print $2 $3}'}${alignr}Up: ${execi 1 vnstat | grep "transmitted:" | awk '{print $2 $3}'}

ses lignes me renvoient rien moi bisar

Hors ligne

#2567 Le 07/08/2010, à 12:52

wlourf

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Mario_26 a écrit :

@ wlourf: tu édite 4 tilda au démarrage d'ubuntu (autostart.sh) :

Système > Préférence > application au démarrage > ajouté

ok merci mais comment je lui dit d'avoir des hauteurs differentes pour chacun des tilda. Je vois bien le fichier "config_0" dans ~/.tilda mais comment lui dire d'utiliser un "config_1" différent, je n'ai rien trouvé dans les options de ligne de commande, ni --max-height, ni --config-file yikes
merci de ton aide

Edit : avec xterm, j'arrive a régler différentes hauteurs mais pas la transparence, avec tilda, c'est l'inverse. Suis avec openbox et j'ai bien transset-df.
On est dans le topic des conkys donc en voici un pour pas être totalement HS !


d15638c7d7cc1900ae24c8af1bf70tt.jpg

Je posterai le code dès qu'il sera terminé

Dernière modification par wlourf (Le 07/08/2010, à 13:25)

Hors ligne

#2568 Le 07/08/2010, à 15:46

Mario_26

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

@ wlourf: Normalement tu clic droit sur un tilda ouvert préférence et ta tout pour régler?


Dell Vostro 3700 | 4 Gib DDR | Geforce GT 330M | Intel Core I5 | Precise Pangolin -> I like ubuntu (-;
Communauté Devosi
Open Source Informatique

Hors ligne

#2569 Le 07/08/2010, à 16:23

kurapika29

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

oui faut ouvrir les 4 et les positionner comme tu veux avec leur préférences comme dis juste au dessus,après suffit d'ouvrir tilda plusieurs fois au démarrage dans "applications aux démarrage" et le tour et jouer chaque tilda a ses préférences séparé wink


Disponible sur IRC, sur le serveur irc.freenode.net salon ##ubuntu-voyager (et aussi sur plein d'autre serveur/salon)
Venez si vous avec besoin d'aide ou pour causer ;) suffit d'avoir Xchat ou un autre client IRC
Où sinon en cliquant sur se lien http://kiwiirc.com/client/irc.freenode. … tu-voyager

Hors ligne

#2570 Le 07/08/2010, à 16:48

djipey

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Pour ce qui est du nom de ta clef usb comme moi " /media/EA05-F5AC " celui change que si tu formate ta clef, en gros a chaque branchement ma clef s'ouvre dans ce dossier, si je la format le nom du dossier dans /media/ changera.

Oui ça je le sais, mais imaginons que qqn vienne chez moi et connecte sa clé. Il n'y a pas de ligne attribuée à la dite clé dans le conkyrc, donc elle n'apparaîtra pas.

Je ne sais pas comment résoudre ça. Soit intervenir sur le /etc/fstab, pour que tous les périphériques soient montés logiquement: disk-1, disk -2, soit recourir à une commande dans le conkyrc qui récupérerait la taille de tous les premiers dossiers dans /media. Une idée?


${alignc}Total
Down: ${execi 1 vnstat | grep "received:" | awk '{print $2 $3}'}${alignr}Up: ${execi 1 vnstat | grep "transmitted:" | awk '{print $2 $3}'}

quant à ça, déja spécifie dans un premier temps l'interface réseau: eth0 ou wlan0, même si je ne pense pas que le problème vient de là.
Ensuite lance cette commande en console, et voit le résultat. Si cela t'affiche des trucs bizarres, c'est que le grep ne marche pas, soit parce que "transmitted" ou received ne sont pas affichés comme ça, soit parce que vnstat n'a pas encore suffisament de données.  Sur lynx, je crois que c'est plus "rx:" et "tx:" en fait. Si tu n'es pas sur, poste le résultat de la commande, et on verra ça ensemble.

Dernière modification par djipey (Le 07/08/2010, à 16:50)

Hors ligne

#2571 Le 07/08/2010, à 17:44

chepioq

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

mycke88 a écrit :

il me reste un petit probleme, c'est le centrage et l'alignement du calendrier

Pour que ton calendrier soit bien aligné, il faut utiliser une police à chasse fixe, c'est à dire une police dont chaque caractère occupe le même place.
Or la police arial que tu utilises ne l'est pas.
Moi j'utilisai la police Monaco, que tu peux obtenir ici http://www.gringod.com/wp-upload/MONACO.TTF.

Une autre solution est de prendre le calendrier en lua de wlourf, l'avantage c'est que tu peux mettre la police que tu veux, ton calendrier sera toujours aligné.

C'est celui ci que j'utilise:
calendar.lua

--[[Calendar Box]]

require 'cairo'

calendar_file= "/home/dominique/.conkyrc/conky15/calendar.txt"	

function conky_calendar_box()
	   -- Retrieve current date

	cal_settings={

		{
		x=120,				--obligatoire, x du coin supérieur gauche
		y=10,				--obligatoire, y du coin supérieur gauche	
		font="URW Chancery L",	    --obligatoire : police à utiliser
		font_size=16,		--obligatoire : taille de la police
		two_digits=false,	--afficher les nombres avec 2 chiffres (true/false) false par défaut
		month_format="%B %Y",--format d'affiche du mois, (défaut = %B -nom complet) http://www.lua.org/pil/22.1.html
		month_position="t",	--position de la boite mois t,b,l,r (défaut = t)
		month_offset=0,		--décalage du mois (défaut=0)
		hpadding=1,		--espace horizontal entre texte et bordure (défaut=2 pixels)
		vpadding=0,			--espace vertical entre texte et bordure (défaut=2 pixels)
		border=0,			--taille de la bordure en pixels (défaut=0 pixels)
		gap=4,				--espace entre deux boites (défaut=2 pixels)
		radius=0,			--rayon des coins (défaut=0 pixels)
		alignment="r",		--alignment des chiffres (l,c ou r) (défaut="c")
		days_position="t",   --position des jours (t/b) (défaut=t)
		days_number=2,		--nombre de lettres du jour (défaut=1)
		display_others_days=false,   --affiche les jours des autres mois (true/false) défaut=true
		
		--pour les couleurs, les paramètres du conky doivent être:
		--own_window_transparent yes
		--own_window_argb_visual yes
		--couleurs {couleur1, couleur2, alpha1,alpha2,border1,border2,alpha border1,alpha border2}
		--colBox = {0xFF0000,0x0000FF,0,1,0x0000FF,0x00FFFF,0.5,0.5}, --couleur "boite" Date (les chiffres)
		--colDays = {0xFF00FF,0x0000FF,1,1,0x0000FF,0x00FF00,1,1},  	--couleur "boite" Jour (Lundi, mardi ...)
		--colMonth = {0x00FF00,0x0000FF,1,1,0x0000FF,0x00FF00,1,1},	--couleur "boite" Mois
		--colBoxTD  = {0xFF0000,0xFF0000,0,1,0xFF00FF,0x00FF00,1,1}, 	--couleur "boite" AUJOURDHUI
		--colBoxBH  = {0xFF0000,0xFF0000,1,1,0xFF00FF,0x00FF00,1,1}, 	--couleur "boite" Férié
		--couleurs text {couleur1,couleur2, alpha1,alpah2}
		colBoxText = {0x30BAFF,0x30BAFF,1,1},						--couleur Texte Date les chiffres)
		colBoxTextTD = {0xF21804,0xAA0B02,1,1},					--couleur Texte Date Aujourd'hui
		colBoxTextBH = {0x30BAFF,0x30BAFF,1,1},					 	--couleur Texte Date Férié
		--colBoxTextOM = {0xFFFFF0,0xFFF0FF,1,1},					--couleur Texte Date Mois Différent
		colDaysText  ={0x0D4357,0x0D4357,1,1},						--couleur Texte Jour
		colMonthText  = {0x0003E5,0x09EFFF,1,1},					--couleur Texte Mois
		orientation ="nw", -- orientation du dégradé défaut ="nn", valeurs possibles= nn, ne,ee,se,ss,sw,ww,nw
		gradient=1,  --  défaut linear(=0) ou radial gradient (défaut=centre du cercle (0 à 1) % du côté d'un carré)
		
		display_info_box=true,				--affiche la boite info (false par défaut)
		--colInfo = {0xFF0000,0x0000FF,0,1,0x0000FF,0x00FFFF,0.5,0.5}, --couleur de la boite Info
		colInfoText = {0x188D9C,0x188D9C,1,1},					--couleur Texte Info
		info_position="b",   				--position de la boite info (défaut=b)
		display_empty_info_box=true,		--affiche la boite info si pas d'info (true/false), (défaut= false)
		
		
		}

	}

--FIN DES PARAMETRES ------------------


	if conky_window == nil then return end
	--if tonumber(conky_parse("$updates"))<3 then return end
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
	cr = cairo_create (cs)
	
    for i,v in pairs(cal_settings) do
        draw_calendar(v)
    end
    
	cairo_destroy(cr)
	cairo_surface_destroy(cs)


    
end











function draw_square(cr,x,y,width,height,radius)
	local degrees = math.pi / 180.0
	radius=tonumber(radius)

		cairo_new_sub_path (cr);
		if radius>0 then
			cairo_arc (cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
			cairo_arc (cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees);
			cairo_arc (cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees);
			cairo_arc (cr, x + radius, y+ radius, radius, 180 * degrees, 270 * degrees);
		else
			cairo_rectangle(cr,x,y,width,height)
		end
		cairo_close_path (cr);

	return 
end




function rgb_to_r_g_b(colour,alpha)
	return ((colour / 0x10000) % 0x100) / 255., ((colour / 0x100) % 0x100) / 255., (colour % 0x100) / 255., alpha
end


function create_pattern(cr,x,y,w,h,tCol,orientation,gradient)
	if gradient~=0  then
		create_pattern_radial(cr,x,y,w,h,tCol,orientation,gradient)
	else
		create_pattern_linear(cr,x,y,w,h,tCol,orientation)
	end
end

function create_pattern_linear(cr,x,y,w,h,tCol,orientation)
	col0,col1,alpha0,alpha1=tCol[1],tCol[2],tCol[3],tCol[4]

	if orientation=="nn" then
		p={x+w/2,y,x+w/2,y+h}
	elseif orientation=="ne" then
		p={x+w,y,x,y+h}
	elseif orientation=="ee" then
		p={x+w,y+h/2,x,y+h/2}		
	elseif orientation=="se" then
		p={x+w,y+h,x,y}		
	elseif orientation=="ss" then
		p={x+w/2,y+h,x+w/2,y}
	elseif orientation=="sw" then
		p={x,y+h,x+w,y}
	elseif orientation=="ww" then
		p={x,y+h/2,x+w,y+h/2}
	else
		p={x,y,x+w,y+h}	
	end
		
	local pat = cairo_pattern_create_linear (p[1],p[2],p[3],p[4])
	cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col0,alpha0))
	cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col1,alpha1))
	cairo_set_source (cr, pat)
	cairo_pattern_destroy(pat)
end

function create_pattern_radial(cr,x,y,w,h,tCol,orientation,gradient)
	local col0,col1,alpha0,alpha1=tCol[1],tCol[2],tCol[3],tCol[4]
	local decn=gradient
	local dec=1-decn
	if orientation=="nn" then
		p={x+w/2,y+h*decn}
	elseif orientation=="ne" then
		p={x+w*dec,y+h*decn}
	elseif orientation=="ee" then
		p={x+w*dec,y+h/2}		
	elseif orientation=="se" then
		p={x+w*dec,y+h*dec}		
	elseif orientation=="ss" then
		p={x+w/2,y+h*dec}
	elseif orientation=="sw" then
		p={x+w*decn,y+h*dec}
	elseif orientation=="ww" then
		p={x+w*decn,y+h/2}
	else
		p={x+w*(1-dec),y+h*(1-dec)}	
	end

	local radius = w/dec 
	if h>w then radius=h/dec end
	local pat = cairo_pattern_create_radial (p[1],p[2],0,p[1],p[2],radius)
	cairo_pattern_add_color_stop_rgba (pat, 0, rgb_to_r_g_b(col0,alpha0))
	cairo_pattern_add_color_stop_rgba (pat, 1, rgb_to_r_g_b(col1,alpha1));
	cairo_set_source (cr, pat);
	cairo_pattern_destroy(pat)
end

function draw_frame (x0,y0,width,height,tCol,radius,border,orientation,gradient)

	cairo_set_operator(cr,CAIRO_OPERATOR_SOURCE)
	create_pattern(cr,x0,y0,width,height,{tCol[5],tCol[6],tCol[7],tCol[8]},orientation,gradient)
	draw_square(cr,x0,y0,width,height,radius)
	cairo_set_line_width(cr,border)
	cairo_fill (cr)

	--cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
	create_pattern(cr,x0,y0,width,height,{tCol[1],tCol[2],tCol[3],tCol[4]},orientation,gradient)
	draw_square(cr,x0+border,y0+border,width-border*2,height-border*2,radius)
	cairo_fill (cr)
	cairo_set_operator(cr,CAIRO_OPERATOR_OVER)	
	
	
	
	if tCol[2]>0 or tCol[3]>0 then
		cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
	else
		cairo_set_operator(cr,CAIRO_OPERATOR_CLEAR)
	end
	create_pattern(cr,x0,y0,width,height,{tCol[1],tCol[2],tCol[3],tCol[4]},orientation,gradient)
	draw_square(cr,x0+border,y0+border,width-border*2,height-border*2,radius)
	cairo_fill (cr)
	cairo_set_operator(cr,CAIRO_OPERATOR_OVER)
	

end

function string:split(delimiter)
--source for the split function : http://www.wellho.net/resources/ex.php4?item=u108/split
  local result = { }
  local from  = 1
  local delim_from, delim_to = string.find( self, delimiter, from  )
  while delim_from do
    table.insert( result, string.sub( self, from , delim_from-1 ) )
    from  = delim_to + 1
    delim_from, delim_to = string.find( self, delimiter, from  )
  end
  table.insert( result, string.sub( self, from  ) )
  return result
end


function draw_calendar(t)
	local te=cairo_text_extents_t:create()
	if t.font==nil or t.x==nil or t.y == nil or t.font_size == nil then
		print ("Error in settings")
		return 
	end
	
	
	x0,y0=t.x,t.y
	if t.two_digits then str_format="%02d" else str_format="%d" end
	if t.month_format==nil then t.month_format = "%B" end
	if t.hpadding==nil then t.hpadding=2 end
	if t.vpadding==nil then t.vpadding=2 end
	if t.border==nil then t.border=0 end		
	if t.month_offset==nil then t.month_offset=0 end
	if t.gap==nil then t.gap=2 end
	if t.radius==nil then t.radius=0 end
	if t.days_number==nil then t.days_number=1 end
	if t.display_others_days==nil then t.display_others_days=true end
	if t.gradient==nil then t.gradient=0 end
	if t.display_info_box == nil then t.display_info_box=false end
	if t.display_empty_info_box == nil then t.display_empty_info_box=false end

	
	local orientation="nn"
	for i,v in ipairs({"nn","ne","ee","se","ss","sw","ww","nw"}) do 
		if v==t.orientation then orientation=v end
	end
	local alignment ="c"
	for i,v in ipairs({"l","c","r"}) do 
		if v==t.alignment then alignment=v end
	end
	local month_position="t"
	for i,v in ipairs({"t","b","l","r"}) do 
		if v==t.month_position then month_position=v end
	end
	local days_position="t"
	for i,v in ipairs({"t","b","l","r"}) do 
		if v==t.days_position then days_position=v end
	end
	local info_position="b"
	for i,v in ipairs({"t","b","l","r"}) do 
		if v==t.info_position then info_position=v end
	end
	
	function table.copy(t)
	  local t2 = {}
	  for k,v in pairs(t) do
		t2[k] = v
	  end
	  return t2
	end

	if t.colBox ~= nil and #t.colBox ~=8 then t.colBox=nil end
	if t.colDays ~= nil and #t.colDays ~=8 then t.colDays=nil end	
	if t.colMonth ~= nil and#t.colMonth ~=8 then t.colMonth=nil end	
	if t.colBoxTD ~= nil and #t.colBoxTD ~=8 then t.colBoxTD=nil end
	if t.colBoxBH ~= nil and #t.colBoxBH ~=8 then t.colBoxBH=nil end
	if t.colInfo ~= nil and #t.colInfo ~=8 then t.colInfo=nil end	
	if t.colBoxText ~= nil and #t.colBoxText ~= 4 then t.colBoxText=nil end
	if t.colBoxTextOM ~= nil and #t.colBoxTextOM ~=4 then t.colBoxText=nil end
	if t.colBoxTextTD ~= nil and #t.colBoxTextTD ~= 4 then t.colBoxTextTD=nil end
		
	if t.colDaysText ~= nil and #t.colDaysText ~= 4 then t.colDaysText=nil end
	if t.colMonthText ~= nil and #t.colMonthText ~= 4 then t.colMonthText=nil end
	if t.colInfoText ~= nil and #t.colInfoText ~= 4 then t.colInfoText=nil end	
	
	if t.colBox == nil then t.colBox = {0x000000,0xFFFFFF,0,0,0xFFFFFF,0x000000,0,0} end
	if t.colDays == nil then t.colDays = table.copy(t.colBox) end
	if t.colMonth == nil then t.colMonth = table.copy(t.colBox) end
	if t.colInfo == nil then t.colInfo = t.colBox end
	if t.colBoxTD == nil then t.colBoxTD = {t.colBox[2],t.colBox[1],t.colBox[3],t.colBox[4],t.colBox[6],t.colBox[5],t.colBox[7],t.colBox[8]}end
	if t.colBoxBH == nil then t.colBoxBH = t.colBox end
	if t.colBoxText == nil	then t.colBoxText = {0x000000,0x000000,1,1} end
	if t.colBoxTextOM == nil then t.colBoxTextOM = {0x00000,0x000000,0.2,0.2} end
	if t.colBoxTextTD == nil then t.colBoxTextTD = {0xFF0000,0xFF0000,1,1} end
	if t.colBoxTextBH == nil then t.colBoxTextBH = {0xFF0000,0xFF0000,1,1} end
	if t.colDaysText == nil	then t.colDaysText = {0x999999,0x999999,1,1} end
	if t.colMonthText == nil	then t.colMonthText = {0x333333,0x333333,1,1} end
	if t.colInfoText == nil	then t.colInfoText = {0x333333,0x333333,1,1} end
	
	
--	i/m
	
	
	
	
	
	
	
	
	
	
	--calculate maximum size of a square
	local maxSide=0
	cairo_select_font_face(cr, t.font, CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL)
	cairo_set_font_size(cr,t.font_size)
	for d=1,31 do
		cairo_text_extents (cr,string.format(str_format,d),te)
		maxSide = math.max(maxSide,te.width+te.x_bearing+2*t.hpadding,te.height+te.y_bearing+2*t.vpadding) --te.y_bearing+
	end
	maxSide=maxSide+2*t.border


	d=0

   -- Compute what day it was the first of the month (0=Monday)
   -- from conky wiki
   dtable = os.date("*t")
   --this month table
   mtable=dtable
   mtable.month=dtable.month+t.month_offset
   mtable = os.date("*t",os.time(mtable))
   day,wday = mtable.day, mtable.wday
   first_day = wday - 2 - (day-1) % 7
   if first_day < 0 then first_day = first_day + 7 end
   
   local txt_month = os.date(t.month_format, os.time(mtable))
   txt_month = string.upper(string.sub(txt_month,1,1)) .. string.sub(txt_month,2)
   
   --last day of month
--[[   ldtable=mtable
   ldtable.month=mtable.month+1
   ldtable.day,ldtable.hour,ldtable.min,ldtable.sec=1,0,0,0
	--print ("av",ldtable.day,ldtable.month,ldtable.hour,ldtable.min,ldtable.sec)
   ldtable=os.date("*t",os.time(ldtable)-2)
   last_day=ldtable.day
]]	--print ("ap",ldtable.day,ldtable.month,ldtable.hour,ldtable.min,ldtable.sec)
	
	-- returns the number of days in a given month and year
	-- Compatible with Lua 5.0 and 5.1.
	-- from sam_lie 
	function get_days_in_month(month, year)
	  local days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }   
	  local d = days_in_month[month]
	   
	  -- check for leap year
	  if (month == 2) then
		if (math.mod(year,4) == 0) then
		 if (math.mod(year,100) == 0)then                
		  if (math.mod(year,400) == 0) then                    
		      d = 29
		  end
		 else                
		  d = 29
		 end
		end
	  end

	  return d  
	end
	last_day=get_days_in_month(mtable.month, mtable.year)
	
	lpdtable=mtable
    lpdtable.month=lpdtable.month-1
    mtable = os.date("*t",os.time(lpdtable))
    if lpdtable.month==0 then lpdtable.month=12 end
	
    last_p_day=get_days_in_month(lpdtable.month,lpdtable.year)
   	mtable.month=lpdtable.month+1
   	mtable = os.date("*t",os.time(mtable))

	--read the calendar file
	local file = io.open(calendar_file,"r")	
	local tabcal={}	
	local idx=1
	local line,lineok="",""
	local txt_info=""
	if file ~= nil then
		while true do
		 	line = file:read("*l")
			if line == nil then break end
			lineok = string.split(line,";")
			if (#lineok)==3 then
				tabcal[idx]={lineok[1],lineok[2],lineok[3]}
				idx=idx+1
				if lineok[1] == os.date("%m%d", os.time()) then
					txt_info=lineok[3]
				end
			end
		end
	end
	
	if not t.display_empty_info_box and txt_info=="" then
		t.display_info_box =false
	end
	if not t.display_info_box then 	info_position="b" end
	
	local nblines=idx-1
	--for i,v in ipairs(tabcal) do print (i,v[1],v[2],v[3]) end
	io.close()
	
	
	
	--définit le texte des jours
	tdays={}
	for i=4,11 do
		table.insert(tdays,os.date("%A", os.time{year=2010, month=1, day=i}))
	end
	for i=1,7 do
		tdays[i]=string.upper(string.sub(tdays[i],1,1)) .. string.sub(tdays[i],2)
		tdays[i]=(string.sub(tdays[i],1,math.max(t.days_number,1)))
	end

	local display_day=true
	--dessine les dates (nombres)
    local flagEnd=0
	for r=0,5 do
		if flagEnd>0 then break end
		for c=0,6 do
			d=d+1
			X=x0+c*maxSide+t.gap*c
			Y=y0+r*maxSide+t.gap*r
			if month_position=="t" then	
				Y=Y+maxSide+t.gap 
			elseif month_position=="l" then
				X=X+maxSide+t.gap
			end
			if info_position=="t" then	
				Y=Y+maxSide+t.gap 
			elseif info_position=="l" then
				X=X+maxSide+t.gap
			end

			if days_position=="t" then
				Y=Y+maxSide+t.gap 
			end

			--bank holiday or not ?
			mtable.day=d-first_day
			md = os.date("%m%d", os.time(mtable))
			local flagBH = false
			for idy=1,nblines do
				if tabcal[idy][1] == md then
					if tabcal[idy][2] == "1" then
						flagBH = true
					end
					break
				end
			end
							
			--draw frames
			local colorBox=t.colBox
			if dtable.day == d-first_day and t.month_offset==0 then
				colorBox=t.colBoxTD
			elseif flagBH then
				colorBox=t.colBoxBH
			end
			draw_frame (X,Y,maxSide,maxSide,colorBox,t.radius,t.border,orientation,t.gradient)			
			
			--format _text
			if d<=first_day  then  									--days before
				create_pattern(cr,X,Y,maxSide*(1-t.gradient),maxSide*(1-t.gradient),t.colBoxTextOM,orientation,t.gradient)
				txt_date=last_p_day-first_day+d
				display_day=t.display_others_days
			elseif d-first_day>0 and d-first_day<=last_day then      -- days of the month
				txt_date=d-first_day
				local colorText= t.colBoxText
				if txt_date==dtable.day and t.month_offset==0 then
					colorText=t.colBoxTextTD
				elseif flagBH then
					colorText=t.colBoxTextBH
				end
				create_pattern(cr,X,Y,maxSide*(1-t.gradient),maxSide*(1-t.gradient),colorText,orientation,t.gradient)
				
				display_day=true
			else												--days after
				txt_date=d-first_day-last_day
				create_pattern(cr,X,Y,maxSide*(1-t.gradient),maxSide*(1-t.gradient),t.colBoxTextOM,orientation,t.gradient)
				display_day=t.display_others_days
			end
			
			--show text or not
			if display_day then
				cairo_text_extents (cr,string.format(str_format,txt_date),te)
				if alignment=="r" then
					delta=maxSide-te.width-te.x_bearing-t.border-t.hpadding
				elseif alignment=="c" then
					delta=(maxSide-te.width)/2-te.x_bearing
				else
					delta=t.border+t.hpadding
				end
				if c==0 or d-first_day==1 then teheight= te.height end
				cairo_move_to(cr,X+delta,Y+(maxSide)/2+teheight/2)
				cairo_show_text(cr,string.format(str_format,txt_date))
			end
			
			if d-first_day>=last_day then
				flagEnd=r
			end
		end
	end
	



	--show days (monday, thuesday ...)
	if days_position=="t" then
		Y=y0
		if month_position=="t" then Y=Y+maxSide+t.gap end
		if info_position=="t" then Y=Y+maxSide+t.gap end
	else
		Y=y0+(flagEnd+1)*(maxSide+t.gap)
	end
	deltaX=0
	if month_position=="l" then	deltaX=deltaX+maxSide+t.gap end
	if info_position=="l" then	deltaX=deltaX+maxSide+t.gap end	
	flagEnd=flagEnd+1
	for c =0,6 do
		X=x0+c*maxSide+t.gap*c+deltaX
		draw_frame (X,Y,maxSide,maxSide,t.colDays,t.radius,t.border,orientation,t.gradient)
		cairo_save(cr)
		cairo_text_extents (cr,tdays[c+1],te)
		local ratio=(maxSide-2*t.border-2*t.hpadding)/(te.width+ te.x_bearing)
		if ratio>1 then ratio=1 end
--		print (tdays[c+1],(te.width+ te.x_bearing)>(maxSide-2*t.border-2*t.hpadding),ratio)
		local xm = X+(maxSide-te.width-t.hpadding)/2
--		(maxSide-te.width)/2-te.x_bearing
		local xm = X+t.hpadding+(maxSide-2*t.hpadding-te.width)/2-te.x_bearing--+t.hpadding/2
		local ym = Y+(maxSide+te.height)/2
		--if ratio<1 then ym=y0+vbox.height-t.border -t.vpadding end
		if ratio<1 then xm=X+t.border+t.hpadding end
		
		if alignment=="r" then
			delta=maxSide-te.width-te.x_bearing-t.border-t.hpadding
		elseif alignment=="c" then
			delta=(maxSide-te.width)/2-te.x_bearing
		else
			delta=t.border+t.hpadding
		end
		
		cairo_move_to(cr,xm,ym)
		create_pattern(cr,X,Y,maxSide,maxSide,t.colDaysText,orientation,t.gradient)
		cairo_save(cr)
		cairo_scale(cr,ratio,1)
		cairo_show_text(cr,tdays[c+1])
		cairo_restore(cr)	
	end

	function show_big_box(txt,box,position)
		cairo_text_extents (cr,txt,te)
		hbox={ width  = maxSide*7+t.gap*6,  height  = maxSide}
		vbox={ width  = maxSide,  height  = maxSide*(flagEnd+1)+t.gap*flagEnd}
		local deltaY = 0
		local deltaX = 0
	
		if box=="month" then
			tColor=t.colMonth
			tColorText=t.colMonthText
			if info_position=="l" or info_position=="r" then
				hbox={ width  = maxSide*8+t.gap*7,  height = maxSide}
			end
			if info_position=="l" then
				deltaX = (maxSide+t.gap)
			end 
			if info_position=="t"  and month_position=="t" then
				deltaY = (maxSide+t.gap)
			end
			if (month_position=="l" or month_position=="r") and (info_position=="t") then
				deltaY=(maxSide+t.gap)
			end
			if (month_position=="b") and (info_position=="t") then
				deltaY=(maxSide+t.gap)
			end	
		elseif box=="info" then
			tColor=t.colInfo
			tColorText=t.colInfoText
			if month_position=="l" or month_position=="r"then
				hbox={ width  = maxSide*8+t.gap*7,  height  = maxSide}
			end 	
			if month_position=="r" and info_position=="r" then 
				deltaX=(maxSide+t.gap)
			end
			if (month_position=="t") and (info_position=="l" or info_position=="r") then
				deltaY=(maxSide+t.gap)
			end
			if (month_position=="t") and (info_position=="b") then
				deltaY=(maxSide+t.gap)
			end			
			if (month_position=="b") then
				vbox={ width  = maxSide,  height  = maxSide*(flagEnd)+t.gap*(flagEnd-1)}
			end
		else
			return	
		end
	
	
		if position=="b" then	
			flagEnd=flagEnd+1
			draw_frame (x0,y0+flagEnd*(maxSide+t.gap)+deltaY,hbox.width,hbox.height,tColor,t.radius,t.border,orientation,t.gradient)
		elseif position=="l" then
			draw_frame (x0+deltaX,y0+deltaY,vbox.width, vbox.height,tColor,t.radius,t.border,orientation,t.gradient)
		elseif position=="r" then
			draw_frame (x0+7*(maxSide+t.gap)+deltaX,y0+deltaY,vbox.width,vbox.height,tColor,t.radius,t.border,orientation,t.gradient)
		else
			draw_frame (x0,y0+deltaY,hbox.width,hbox.height,tColor,t.radius,t.border,orientation,t.gradient)
		end


		if position=="t" or position=="b" then
			cairo_save(cr)
			local ratio=(hbox.width-2*t.border-2*t.hpadding)/(te.width + te.x_bearing)
			if ratio>1 then ratio=1 end
		
			local xm = x0+hbox.width/2-(te.width/2 + te.x_bearing)
			local ym = y0+hbox.height/2-(te.height/2+ te.y_bearing)
			if ratio<1 then xm=x0+t.border +t.hpadding end
			if position=="b" then ym = ym + flagEnd*(maxSide+t.gap) end

			create_pattern(cr,x0,y0,hbox.width,hbox.height,tColorText,orientation,t.gradient)
			cairo_translate(cr,xm,ym+deltaY)
			cairo_scale(cr,ratio,1)
			cairo_show_text(cr,txt)
			cairo_restore(cr)
		end
	
		if position=="l" or position=="r" then
			cairo_save(cr)
			--ajuster la taille, à faire avec cairo_set_scaled_font ??
			local ratio=(vbox.height-2*t.border-2*t.hpadding)/(te.width + te.x_bearing)
			if ratio>1 then ratio=1 end
		
			local xm = x0+vbox.width/2-(te.height/2 + te.y_bearing)+deltaX
			local ym = y0+vbox.height/2+(te.width/2+ te.x_bearing)
			if ratio<1 then ym= y0 + vbox.height - t.border -t.hpadding end 
			if position=="r" then xm=xm + 7*(maxSide+t.gap) end

			--hum hum ...
			create_pattern(cr,xm-hbox.height+te.height,ym-te.width- te.x_bearing,hbox.height,te.width+ te.x_bearing,tColorText,orientation,t.gradient)
			cairo_translate(cr,xm,ym+deltaY)
			cairo_rotate(cr,-math.pi/2)
			cairo_scale(cr,ratio,1)
			cairo_show_text(cr,txt)
			cairo_restore(cr)
		end
	
	end


	--txt_info="essa s  la co gf f hgf hg ss ss ss ff r ss s"
	show_big_box(txt_month,"month",month_position)
	if t.display_info_box  then 
		if t.file_info ~= nil then
			local file = io.open(t.file_info,"r")
			if file ~= nil then txt_info = file:read("*l") end
		end
		show_big_box(txt_info,"info",info_position)
	end


end


function conky_show_ip()
	if conky_window == nil then return end
	local cs = cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, conky_window.width, conky_window.height)
	cr = cairo_create (cs)


	local file = io.open("/tmp/my_ip.txt","r")	
	local ip_txt
	if file ~= nil then
		ip_txt = file:read("*l")
	end
	if ip_txt~=nil then
		cairo_set_font_size (cr, 50.0);
		cairo_move_to (cr, 100.0, 100.0);
		cairo_set_source_rgba (cr, 0.325490196, 0.258823529, 0.035294118, 0.2);
		cairo_show_text (cr, ip_txt);
	end
	io.close()
	cairo_destroy(cr)
	cairo_surface_destroy(cs)

end

1281197589.png

C'est un peu plus compliqué à mettre en œuvre, mais tu peu faire ce que tu veux avec.

Si tu restes sur un calendrier plus classique, juste quelques remarques sur ton conky:

-tu as une erreur dans

alignment top-right

c'est alignment top_right


-"border_margin 0" n'existe plus, maintenant c'est border_inner_margin ou border_outer_margin, mais comme tu le mets a zero tu peux supprimer la ligne, ou la commenter en mettant un # devant: #border_margin 0

-de même tu peux commenter la ligne "use_spacer no" ou mettre la valeur a false (use_spacer no n'existe plus)

-De plus dans la ligne

${execp cal | sed 's/^/ /g' | sed 's/'" $(date +%e)"'/\${color2}'" $(date +%e)"'\${color1}/1' | sed -e "1d ; s/^/\${goto X}/g"}

tu as ${color1} et ${color2}, mais tu ne définis pas ces couleurs dans la partie qui est avant TEXT, donc ton calendrier est tout blanc

Tu peux mettre par exemple:

color1 FFFFFF
color2 FF0000

Tout est dans tout et réciproquement....

Hors ligne

#2572 Le 07/08/2010, à 18:21

wlourf

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

@ Mario_26 & kurapika29
Merci, je suis parvenu a mes fins ! 
En fait, à chaque fois qu'on lance tilda, il va chercher le fichier de config_0, si celui-ci est déjà utilisé, il prend ou créé le fichier config_1 et ainsi de suite. Donc on ne peut pas spécifier le fichier de config à utiliser comme avec conky et l'option -c :

conky -c monconkyrc

Avec l'autostrat d'openbox, il faut spécifier des délais sinon il peut y avoir des problèmes lors du lancement, parfois  le premier tilda utilise le fichier de config du deuxième, donc ça donne ça pour avoir un affichage propre :

sleep 1s && tilda --class=tilda0 &
sleep 2s && tilda --class=tilda1 &
sleep 3s && tilda --class=tilda2 &

Je spécifie les class pour pouvoir les gérer avec le rc.xml d'openbox (ainsi je peux les placer en arrière plan "sur" le bureau) mais dans ce cas, je suis obligé de redéfinir la position de la fenêtre (x et y), je ne sais pas pourquoi :

    <application name="tilda" class="tilda0" type="normal">
      <position force="yes">
        <x>633</x>
        <y>113</y>
        <monitor>1</monitor>
      </position>    
      <desktop>all</desktop>
      <layer>below</layer>
      <skip_taskbar>yes</skip_taskbar>
    </application>
    
    <application name="tilda" class="tilda1" type="normal">
      <position force="yes">
        <x>633</x>
        <y>323</y>
        <monitor>1</monitor>
      </position>
      <desktop>all</desktop>
      <layer>below</layer>
      <skip_taskbar>yes</skip_taskbar>
    </application>
    
    <application name="tilda" class="tilda2" type="normal">
      <position force="yes">
        <x>633</x>
        <y>786</y>
        <monitor>1</monitor>
      </position>
      <desktop>all</desktop>
      <layer>below</layer>
      <skip_taskbar>yes</skip_taskbar>
    </application>

Voilà:
683909c7a9ca3b8439788ccdcd3b6t.jpg

@mycke88, moi aussi j'utilise le même script cité par chepioq mais avec différents paramètres, et ça donne ça  :
a9b231295f66d216caaffdd12d263t.jpg

@chepioq, sur le forum crunchbang, il font des trucs intéressants pour les heures de lever et de coucher du soleil, comme tu avais posté ici, ainsi que pour la position du soleil, si ça t'interesse: http://crunchbanglinux.org/forums/post/80246/#p80246

Hors ligne

#2573 Le 07/08/2010, à 18:33

chepioq

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

wlourf a écrit :

@chepioq, sur le forum crunchbang, il font des trucs intéressants pour les heures de lever et de coucher du soleil, comme tu avais posté ici, ainsi que pour la position du soleil, si ça t'intéresse: http://crunchbanglinux.org/forums/post/80246/#p80246

C'est en effet très intéressant, merci pour le lien.
Je vais voir si je peux en faire quelque chose (récupérer les heures du lever et du coucher sans passer par sunwait...)


Tout est dans tout et réciproquement....

Hors ligne

#2574 Le 07/08/2010, à 18:59

maaduck

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Merci djipey j'ai réussi a débloquer vnstat -u big_smile

T'avais raison aussi sur "rx" "tx"  sauf que

vnstat | grep "tx:" | awk '{print $2 $3}'

me renvoit le même résultat que

vnstat | grep "rx:" | awk '{print $2 $3}'

mais pas l'inverse , c'est a dire que c'est bien TX qui copie l'info RX... du coup le total d'upload je l'ai enlevé smile


Me reste a comprendre comment on met les infos météo et rythmbox

Encore un truc qui va me prendre 1 semaine smile


merci de votre aide

Hors ligne

#2575 Le 07/08/2010, à 20:55

Skubu

Re : (3) Conky : Postez vos conkyrc ou certaines parties intéressantes

Bonsoir,

Chepioq, ce serait possible de voir ton conky calendar ?
Le mien n'affiche rien...


Debian / Archlinux | Gnome / KDE

Hors ligne