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.

#626 Le 14/05/2011, à 13:55

Fenouille84

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

Aucun soucis avec ton conky sur ma distro... neutral

J'utilise CrunchBang Linux (base Debian + OpenBox). Toutefois, avant je tournais sous Ubuntu (jusqu'à la 10.10) et j'ai jamais eu de soucis avec le calendrier ni le code conky.

J'utilise une version 32bits. Le soucis vient peut être de là, je ne sais pas... hmm

Dernière modification par Fenouille84 (Le 14/05/2011, à 13:55)


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

Hors ligne

#627 Le 14/05/2011, à 14:49

kurapika29

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

Sous natty (gnome session) en 64 bits j'ai tester son conky et même soucie hmm


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

#628 Le 15/05/2011, à 13:54

melkor79

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

Bonjour à vous,

je viens requérir votre aide, je début avec Ubuntu depuis quelques mois,
et je comprend rien à mon problème, je crois bien avoir suivi les tutos que j'ai lu.

Mon conky ne s’affiche pas correctement
je vais vous mettre les différentes actions que j'ai faite

tout d'abord, j'ai placé mes fichiers conky dans le même dossier
/home/david/conky/

voici mon script pour lancer mon conky, conky-start.sh

#!/bin/bash

conky -c ~/home/david/conky/conkyrc &

exit 0

et mon conkyrc volontairement très simple pour être affranchi d'autres problèmes

# temps pour fermer conky en seconde. 0 = toujours actif 
total_run_times 0 
out_to_console no 
double_buffer yes 
no_buffers yes 
text_buffer_size 2048 

update_interval 1 

cpu_avg_samples 4 
net_avg_samples 2 

alignment top_right 
minimum_size 320 5 
maximum_width 320 

gap_x -120 
gap_y 30 

draw_shades no 
draw_outline no 
draw_borders no 

border_width 1 
border_margin 4 

background yes 

own_window yes 
own_window_type override # normal / override / desktop 
own_window_transparent yes 

use_xft yes 
xftalpha .1 
override_utf8_locale yes # force UTF8 

xftfont Fixed:size=7#OCR A Std:size=6 

uppercase no 

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 

${font tron:size=12}My Trubuntu

quand je lance mon conky-start.sh, j'ai le conky basic qui s'affiche, par contre quand je place le code de conkyrc dans un /home/david/.conkyrc et que je le lance en faisant alt+f2 et en rentrant conky, la tout se lance bien.

c'est mon 1er point où  je bloque, n'y arrivant pas, je n'essaye pas, de lancer autre chose comme des *.lua

si quelqu'un peut m'aider ça serait très sympa

Hors ligne

#629 Le 15/05/2011, à 14:03

msg_dracula

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

@melkor79

il y a une erreur dans ton conky-start.sh. Il faut mettre soit

conky -c /home/david/conky/conkyrc &

sois

conky -c ~/conky/conkyrc &

D'ailleurs, pour le repertoire, celui ci n'est il pas .conky (avec le point devant) au lieu de conky ?

Hors ligne

#630 Le 15/05/2011, à 14:17

melkor79

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

Merci msg_dracula  pour ta rapidité smile

j'ai essayé en modifiant mon conky-start.sh, avec les 2 lignes que tu m'as donné,
mais même chose j'ai le conky basic en haut à gauche qui s'affiche

j'ai par la suite essayé en modifiant le répertoire où sont placés  mes fichiers conky, comme tu me l'as suggéré

donc le nouveau répertoire et /home/david/.conky/
avec conkyrc et conky-start.sh

conky -c /home/david/.conky/conkyrc &

ou

conky -c ~/conky/conkyrc &

question subsidiére pourquoi y aurait'il 2 lignes de code différente pour appeler un conky ?

Hors ligne

#631 Le 15/05/2011, à 14:35

chepioq

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

Juste une question :
dans ton script de lancement de conky, as-tu fais un retour charriot après la dernière ligne ?
Si tu as juste enregistré après avoir écrit "exit 0" sans faire un retour charriot (il faut juste appuyer sur la touche "ENTER") ton script attend une autre commande....

-Deuxième chose : as tu rendu ton script exécutable ?


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

Hors ligne

#632 Le 15/05/2011, à 14:43

melkor79

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

@chepioq

effectivement je n'avais pas fait de return derrière "exit 0"
mais même avec rien ne se passe...

sinon oui il me semble l'avoir rendu exécutable, j'ai modifié son statu dans propriétés et je l'ai rendu exécutable

je désespère :s

Hors ligne

#633 Le 15/05/2011, à 14:44

Fenouille84

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

chepioq a écrit :

Si tu as juste enregistré après avoir écrit "exit 0" sans faire un retour charriot (il faut juste appuyer sur la touche "ENTER") ton script attend une autre commande....

Perso, tous mes scripts s'arrêtent avec exit 0 sans aucune ligne vide après, et tout fonctionne nickel.
Donc je pense pas que le souci vienne de là.


chepioq a écrit :

Deuxième chose : as tu rendu ton script exécutable ?

+1 !! Vérifie bien que ton script soit exécutable.
> Clic droit sur le script > Propriétés > Permission > Exécution


melkor79 a écrit :

question subsidiére pourquoi y aurait'il 2 lignes de code différente pour appeler un conky ?

Il n'y a pas 2 lignes, mais 2 façon de nommer tes répertoires.
Cette écriture de ton dossier personnel :

/home/david

Est équivalente à celle-ci :

~

Donc, si ton répertoire personnel contient un sous-dossier nommé conky, alors ces 2 écritures sont équivalentes :

conky -c /home/david/conky/conkyrc
conky -c ~/conky/conkyrc

Maintenant, à toi de choisir l'une d'entre elles.

Dernière modification par Fenouille84 (Le 15/05/2011, à 14:45)


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

Hors ligne

#634 Le 15/05/2011, à 14:51

melkor79

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

j'ai trouvé...

j'ai honte mais pour faire avancer les choses je vais mettre mon erreur

.conky et .Conky, c'est subtile mais tout tient à la majuscule...

Merci beaucoup pour votre aide,
je vais pouvoir continuer à avancer big_smile

Hors ligne

#635 Le 15/05/2011, à 15:02

Fenouille84

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

melkor79 a écrit :

.conky et .Conky, c'est subtile mais tout tient à la majuscule...

Ah oui, faut faire attention à la casse des caractères... tongue

Bon courage pour la suite wink


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

Hors ligne

#636 Le 15/05/2011, à 19:34

Compte anonymisé

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

Bonjour les conkyfan lol

Je teste en ce moment conky, c'est sympa mais il ne m'affiche pas correctement les températures des cores de mon CPU.

Il m'indique :

CPU  °C


Pourtant j'ai lmsensors qui est installé, et la commande

sensors

me renvoie la réponse

acpitz-virtual-0
Adapter: Virtual device
temp1:      -127.0°C  (crit = +60.0°C)                  

coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +40.0°C  (high = +86.0°C, crit = +100.0°C)  

coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +42.0°C  (high = +86.0°C, crit = +100.0°C) 

J'utilisais sensor applet quand j'étais sous gnome, et j’effaçais la valeur erronée de temp 1 pour ne garder dans la barre des taches que celle des core 0 et 1.

Que se passe t-il ?

Edit : je suis sous la 11.04 et j'utilise Unity 2D

Dernière modification par Compte anonymisé (Le 15/05/2011, à 19:39)

#637 Le 15/05/2011, à 23:12

Fenouille84

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

Mudochon a écrit :

Bonjour les conkyfan lol
Je teste en ce moment conky, c'est sympa mais il ne m'affiche pas correctement les températures des cores de mon CPU

Tu peux nous poster le code ton conky stp ?

Et quand tu lances conky dans un terminal, il te sort des messages d'erreurs ?


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

Hors ligne

#638 Le 16/05/2011, à 06:59

Compte anonymisé

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

Le code de mon Conky ? c'est à dire ? neutral

Dans un terminal j'ai la réponse là :

Conky: desktop window (10000be) is subwindow of root window (1ad)
Conky: window type - desktop
Conky: drawing to created window (0x3a00001)
Conky: drawing to single buffer

J'ai un peu l'impression de m'être lancé dans un truc de geek pour lequel je n'ai pas du tout le niveau, je comprend pas la moitié des sujets qui parle de conky lol

#639 Le 16/05/2011, à 07:36

fredr

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

Le contenu de ton fichier .conkyrc


ArcoLinuxD Awesome
L'optimiste pense que nous vivons dans le meilleur des mondes. Et le pessimiste craint que ce ne soit exact.

Hors ligne

#640 Le 16/05/2011, à 08:07

Compte anonymisé

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

Merci pour les réponses wink

Finalement je laisse tomber Conky, c'est un poil trop compliqué pour moi et j'ai réussi à récupérer ce que je voulais ( météo et températures CPU et disque dur ) par d'autre moyens plus simples wink

Désolé pour le dérangement lol

#641 Le 16/05/2011, à 08:47

Rolinh

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

[hs]aaaah, Oddworld smile [/hs]

Hors ligne

#642 Le 16/05/2011, à 10:28

Compte anonymisé

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

Histoire de partir en beauté tongue

sudo comme je suis un peu con
sudo je n'ai été conquis par Conky
sudo désolé

#643 Le 16/05/2011, à 12:43

Fenouille84

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

Mudochon a écrit :

Finalement je laisse tomber Conky

Y'en a qu'on essayé...

tongue


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

Hors ligne

#644 Le 16/05/2011, à 14:09

bece

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

... Ils ont eu des problèmes big_smile


"L'informatique, c'est l'art de passer 15 jours à gagner 5 millisecondes"

Hors ligne

#645 Le 16/05/2011, à 20:37

bannana jones

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

Bonjour à tous,

voici mes premier conky
capturela.png
http://img832.imageshack.us/i/capturensf.png/
voici mes conf de conky:

celui pour la musique:

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# 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 yes
own_window_transparent yes
own_window_type override
#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 100 0
#maximum_width 150

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_bottom
#alignment top_right
#alignment bottom_left
#alignment bottom_right

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

# 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
draw_graph_borders yes
TEXT
${color}EN ÉCOUTE :$color
Artiste : ${tab 20}${color ffffff}${exec rhythmbox-client --print-playing-format "%ta"}$color
Titre : ${tab 20}${color ffffff}${exec rhythmbox-client --print-playing-format "%tt"}$color
Album : ${tab 20}${color ffffff}${exec rhythmbox-client --print-playing-format "%at"}$color
Piste : ${tab 20}${color ffffff}${exec rhythmbox-client --print-playing-format "%tn"}$color
Durée : ${tab 20}${color ffffff}${exec rhythmbox-client --print-playing-format "%te / %td"}$color

celui pour le disque dur:

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# 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 yes
own_window_transparent yes
own_window_type override
#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 100 0
#maximum_width 150

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_bottom
#alignment top_right
#alignment bottom_left
#alignment bottom_right

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

# 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
draw_graph_borders yes
TEXT
${voffset 8}Home:
${voffset 3}${fs_free /home}/${fs_size /home} 
${voffset 3}${fs_bar 10,180 /home}

celui pour le processeur:

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# 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 yes
own_window_transparent yes
own_window_type override
#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 100 0
#maximum_width 150

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_bottom
#alignment top_right
#alignment bottom_left
#alignment bottom_right

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

# 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
draw_graph_borders yes
TEXT
${color }${font INFECTED:size=20}TOP CPU${font}
${voffset 10}${font JUICE Bold:size=8}${top name 1}${alignr}${top cpu 1}
${top name 2}${alignr}${top cpu 2}
${top name 3}${alignr}${top cpu 3}
${top name 4}${alignr}${top cpu 4}
${top name 5}${alignr}${top cpu 5}

celui pour la memoire:

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# 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 yes
own_window_transparent yes
own_window_type override
#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 100 0
#maximum_width 150

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_bottom
#alignment top_right
#alignment bottom_left
#alignment bottom_right

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

# 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
draw_graph_borders yes
TEXT
${color }${font INFECTED:size=20}TOP CPU${font}
${voffset 10}${font JUICE Bold:size=8}${top name 1}${alignr}${top cpu 1}
${top name 2}${alignr}${top cpu 2}
${top name 3}${alignr}${top cpu 3}
${top name 4}${alignr}${top cpu 4}
${top name 5}${alignr}${top cpu 5}

et le dernier du bas :

# Use Xft?
use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# 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 yes
own_window_transparent yes
own_window_type override
#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 100 0
#maximum_width 150

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_bottom
#alignment top_right
#alignment bottom_left
#alignment bottom_right

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

# 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
draw_graph_borders yes
TEXT
${font INFECTED:size=20}TOP MEM${font}$color
${voffset 10}${font JUICE Bold:size=8}${top_mem name 1}${alignr}${top_mem mem 1}
${top_mem name 2}${alignr}${top_mem mem 2}
${top_mem name 3}${alignr}${top_mem mem 3}
${top_mem name 4}${alignr}${top_mem mem 4}
${top_mem name 5}${alignr}${top_mem mem 5}

et mon horlogue :

# Conky settings #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
#imlib_cache_size 0

temperature_unit fahrenheit

# Window specifications #

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 200 250
maximum_width 200

alignment tr
gap_x 35
gap_y 35

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# Text settings #
use_xft yes
xftfont Caviar Dreams:size=8
xftalpha 0.5

uppercase no

temperature_unit celsius


default_color FFFFFF

# Lua Load  #
lua_load /etc/conky/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT
${voffset 8}${color D60650}${font Caviar Dreams:size=16}${time %A}${font}${voffset -8}${alignr 50}${color FFFFFF}${font Caviar Dreams:size=38}${time %e}${font}
${color FFFFFF}${voffset -30}${color FFFFFF}${font Caviar Dreams:size=18}${time %b}${font}${voffset -3} ${color FFFFFF}${font Caviar Dreams:size=20}${time %Y}${font}${color D60650}${hr}
${image /etc/conky/debian-logo.png -p 68,120 -s 60x60}











${color FFFFFF}${goto 75}${voffset 35}${cpu cpu0}%
${color D60650}${goto 75}CPU
${color FFFFFF}${goto 100}${voffset 23}${memperc}%
${color D60650}${goto 100}RAM
${color FFFFFF}${goto 125}${voffset 23}${swapperc}%
${color D60650}${goto 125}Swap
${color FFFFFF}${goto 150}${voffset 23}${fs_used_perc /}%
${color D60650}${goto 150}Disk

${color #B7EA81}${goto 00}${font Desused:size=18}Alimentation :${font}

${color #B7EA81}Charge de la batterie : $alignr${color #D6065}${battery_short BAT0}
${color #B7EA81}Autonomie : $alignr${color #D6065}${battery_time BAT0}
$alignr${color #B7EA81}IP Publique : ${color #D6065}${execi 600 wget -O - http://ip.tupeux.com | tail}

${voffset 30}${color #B7EA81}${offset 37}${font INFECTED:size=18}NETWORK
${voffset -10}${color #B7EA81}${font Defused:size=8}Down: 
${downspeedgraph eth0 30,70 B7EA81 B7EA81}${voffset -15}${alignr}${downspeed eth0} 
${color #B7EA81}${font Defused:size=8}Up:  
${upspeedgraph eth0 30,70 B7EA81 B7EA81}${voffset -15}${alignr}${upspeed eth0}

pour l'horlogue j'utilise aussi

--[[
Clock Rings by Linux Mint (2011) reEdited by despot77

This script draws percentage meters as rings, and also draws clock hands if you want! It is fully customisable; all options are described in the script. This script is based off a combination of my clock.lua script and my rings.lua script.

IMPORTANT: if you are using the 'cpu' function, it will cause a segmentation fault if it tries to draw a ring straight away. The if statement on line 145 uses a delay to make sure that this doesn't happen. It calculates the length of the delay by the number of updates since Conky started. Generally, a value of 5s is long enough, so if you update Conky every 1s, use update_num>5 in that if statement (the default). If you only update Conky every 2s, you should change it to update_num>3; conversely if you update Conky every 0.5s, you should use update_num>10. ALSO, if you change your Conky, is it best to use "killall conky; conky" to update it, otherwise the update_num will not be reset and you will get an error.

To call this script in Conky, use the following (assuming that you save this script to ~/scripts/rings.lua):
    lua_load ~/scripts/clock_rings.lua
    lua_draw_hook_pre clock_rings
    
Changelog:
+ v1.0 -- Original release (30.09.2009)
   v1.1p -- Jpope edit londonali1010 (05.10.2009)
*v 2011mint -- reEdit despot77 (18.02.2011)
]]

settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xD60650,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=100, y=150,
        -- "radius" is the radius of the ring.
        radius=50,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xD60650,
        fg_alpha=0.4,
        x=100, y=150,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xD60650,
        fg_alpha=0.6,
        x=100, y=150,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xD60650,
        fg_alpha=0.8,
        x=100, y=150,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xD60650,
        fg_alpha=1,
        x=100, y=150,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='cpu',
        arg='cpu0',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xD60650,
        fg_alpha=0.8,
        x=100, y=250,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xD60650,
        fg_alpha=0.8,
        x=125, y=300,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='swapperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xD60650,
        fg_alpha=0.8,
        x=150, y=350,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='fs_used_perc',
        arg='/',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xD60650,
        fg_alpha=0.8,
        x=175, y=400,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
        
}

-- Use these settings to define the origin and extent of your clock.

clock_r=65

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=100
clock_y=150

show_seconds=true

require 'cairo'

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

function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)

    -- Draw background ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    
    -- Draw indicator ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)        
end

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    
    secs=os.date("%S")    
    mins=os.date("%M")
    hours=os.date("%I")
        
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
        
    -- Draw hour hand
    
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)
    
    -- Draw minute hand
    
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    
    -- Draw seconds hand
    
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
    
        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local str=''
        local value=0
        
        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        
        value=tonumber(str)
        pct=value/pt['max']
        
        draw_ring(cr,pct,pt)
    end
    
    -- Check that Conky has been running for at least 5s

    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)
    
    local cr=cairo_create(cs)    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    
    draw_clock_hands(cr,clock_x,clock_y)
end

j'ai juste trois petit problème pour le moment que je n'arrive pas à régler le premier c'est que je ne sais comment faire pour mêtre les trois du bas en un, le second est que le troisième ( celui du processeur) clignote mais pas de manière réguliaire et permanante et le troisième c'est qu'avec le petit scprit que j'ai fait pour pouvoir avoir tout lancer au démarrage ne marche pas (du moins les images pour l'horlogue ne s'affiche pas car elles ont besoin d'être lancé avec sudo)

#!/bin/bash
# On laisse passer un ange pour eviter les problemes, 5 secondes ici, a changer eventuellement
sleep 5
# C'est parti pour conky...
killall conky 
cd
sleep 2
conky -d -c /etc/conky/conkyrc1;
sleep 2
sudo conky -d -c /etc/conky/conkyrc2;
sleep 2
conky -d -c /etc/conky/conkyrc3;
sleep 2
conky -d -c /etc/conky/conkyrc4;
sleep 2
conky -d -c /etc/conky/conkyrc5;
# Pour lancer tilda, a commenter si pas de tilda...
killall tilda
# Un petit sleep, tilda mets du temps à mettre a jour son lock...
sleep 3
tilda
exit

Merci pour votre future aide ou pour vos commentaires sur mon conky smile

Dernière modification par bannana jones (Le 16/05/2011, à 20:53)


O.S : Ubuntu 9.10; processeur Intel Pentium M 1,6 Ghz ; 496 de mémoire vive PC: DELL Latitude 505

Hors ligne

#646 Le 17/05/2011, à 06:35

maestroom

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

bon après avoir réglé tous les petites troubles de mon conky..voici mon nouveau conky inspirer du 2011
conky170811.th.png

Uploaded with ImageShack.us
et voici les code smile
conky.conf

# Conky settings #
background no
update_interval 1

cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

# Window specifications #

own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below

border_inner_margin 0
border_outer_margin 0

minimum_size 450 450
maximum_width 450

alignment tr
gap_x 55
gap_y 350

# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yno

# Text settings #
use_xft yes
xftfont caviar dreams:size=8
xftalpha 0.5

uppercase no

default_color FFFFFF

# Lua Load  #
lua_load ~/conky/clock_rings.lua
lua_draw_hook_pre clock_rings

TEXT
${voffset 8}${color FF6600}${font caviar dreams:size=16}${time %A}${voffset -8}${alignr 320}${font caviar dreams:size=38}${time %e}${font}
${voffset -30}${font caviar dreams:size=18}${time %b}${font}${voffset -3} ${font caviar dreams:size=20}${time %Y}${font}${color FF6600}${hr}

${color FF6600}${font caviar dreams:size=8}${alignr}${nodename}
${color FF6600}${font caviar dreams:size=8}${alignr}${pre_exec cat /etc/issue.net}  $machine
${color FF6600}${font caviar dreams:size=8}${alignr}Kernel: ${kernel}

${voffset 27}${goto 45}${cpugraph cpu1 20,100 FFF83A FF6E00}
${voffset -6}${goto 95}${cpugraph cpu2 20,100 FFF83A CB0C29}
${voffset -8}${goto 145}${cpugraph cpu3 20,100 FFF83A 49A835}
${voffset -8}${goto 195}${cpugraph cpu4 20,100 FFF83A 2D7DB3}

${voffset 60}${color FFFFFF}${goto 100}${voffset 23}${memperc}%
${color FF6600}${goto 100}RAM
${voffset 130}${color FF6600}${goto 250}down:${downspeed eth0}
${voffset 0}${color FF6600}${goto 250}up:${upspeed eth0}

${voffset 10}${color FF6600}${goto 150}Home:${fs_used_perc /}%
${color FF6600}${goto 150}serenity ${fs_used_perc /media/serenity}%
${color FF6600}${goto 150}Dead space:${fs_used_perc /media/Dead space}%
${color FF6600}${goto 150}Exodus:${fs_used_perc /media/EXODUS}%
${voffset 10}${color FF6600}${font caviar dreams:size=8}${alignr}uptime: ${uptime_short}
${color FF6600}${font caviar dreams:size=8}${alignr}Processus: ${processes}
${color FF6600}${font caviar dreams:size=8}${alignr}Running: ${running_processes}

clock_rings.lua

settings_table = {
    {
        -- Edit this table to customise your rings.
        -- You can create more rings simply by adding more elements to settings_table.
        -- "name" is the type of stat to display; you can choose from 'cpu', 'memperc', 'fs_used_perc', 'battery_used_perc'.
        name='time',
        -- "arg" is the argument to the stat type, e.g. if in Conky you would write ${cpu cpu0}, 'cpu0' would be the argument. If you would not use an argument in the Conky variable, use ''.
        arg='%I.%M',
        -- "max" is the maximum value of the ring. If the Conky variable outputs a percentage, use 100.
        max=12,
        -- "bg_colour" is the colour of the base ring.
        bg_colour=0xffffff,
        -- "bg_alpha" is the alpha value of the base ring.
        bg_alpha=0.1,
        -- "fg_colour" is the colour of the indicator part of the ring.
        fg_colour=0xFF6600,
        -- "fg_alpha" is the alpha value of the indicator part of the ring.
        fg_alpha=0.2,
        -- "x" and "y" are the x and y coordinates of the centre of the ring, relative to the top left corner of the Conky window.
        x=250, y=400,
        -- "radius" is the radius of the ring.
        radius=50,
        -- "thickness" is the thickness of the ring, centred around the radius.
        thickness=5,
        -- "start_angle" is the starting angle of the ring, in degrees, clockwise from top. Value can be either positive or negative.
        start_angle=0,
        -- "end_angle" is the ending angle of the ring, in degrees, clockwise from top. Value can be either positive or negative, but must be larger than start_angle.
        end_angle=360
    },
    {
        name='time',
        arg='%M.%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.4,
        x=250, y=400,
        radius=56,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%S',
        max=60,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.6,
        x=250, y=400,
        radius=62,
        thickness=5,
        start_angle=0,
        end_angle=360
    },
    {
        name='time',
        arg='%d',
        max=31,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=250, y=400,
        radius=70,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='time',
        arg='%m',
        max=12,
        bg_colour=0xffffff,
        bg_alpha=0.1,
        fg_colour=0xFF6600,
        fg_alpha=1,
        x=250, y=400,
        radius=76,
        thickness=5,
        start_angle=-90,
        end_angle=90
    },
    {
        name='memperc',
        arg='',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6600,
        fg_alpha=0.8,
        x=135, y=350,
        radius=25,
        thickness=5,
        start_angle=-90,
        end_angle=180
    },
    {
        name='downspeedf',
        arg='eth0',
        max=500,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xDB2D2A,
        fg_alpha=0.8,
        x=350, y=500,
        radius=50,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='upspeedf',
        arg='eth0',
        max=400,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x474898,
        fg_alpha=0.8,
        x=350, y=500,
        radius=40,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu1',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xFF6E00,
        fg_alpha=0.8,
        x=150, y=150,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu2',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0xCB0C29,
        fg_alpha=0.8,
        x=200, y=175,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu3',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x49A835,
        fg_alpha=0.8,
        x=250, y=200,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180
    },
    {
        name='cpu',
        arg='cpu4',
        max=100,
        bg_colour=0xffffff,
        bg_alpha=0.2,
        fg_colour=0x2D7DB3,
        fg_alpha=0.8,
        x=300, y=225,
        radius=25,
        thickness=4,
        start_angle=-90,
        end_angle=180

    },
}

-- Use these settings to define the origin and extent of your clock.

clock_r=65

-- "clock_x" and "clock_y" are the coordinates of the centre of the clock, in pixels, from the top left of the Conky window.

clock_x=250
clock_y=400

show_seconds=true

require 'cairo'

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

function draw_ring(cr,t,pt)
    local w,h=conky_window.width,conky_window.height
    
    local xc,yc,ring_r,ring_w,sa,ea=pt['x'],pt['y'],pt['radius'],pt['thickness'],pt['start_angle'],pt['end_angle']
    local bgc, bga, fgc, fga=pt['bg_colour'], pt['bg_alpha'], pt['fg_colour'], pt['fg_alpha']

    local angle_0=sa*(2*math.pi/360)-math.pi/2
    local angle_f=ea*(2*math.pi/360)-math.pi/2
    local t_arc=t*(angle_f-angle_0)

    -- Draw background ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_f)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(bgc,bga))
    cairo_set_line_width(cr,ring_w)
    cairo_stroke(cr)
    
    -- Draw indicator ring

    cairo_arc(cr,xc,yc,ring_r,angle_0,angle_0+t_arc)
    cairo_set_source_rgba(cr,rgb_to_r_g_b(fgc,fga))
    cairo_stroke(cr)        
end

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    
    secs=os.date("%S")    
    mins=os.date("%M")
    hours=os.date("%I")
        
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
        
    -- Draw hour hand
    
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)
    cairo_stroke(cr)
    
    -- Draw minute hand
    
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    
    -- Draw seconds hand
    
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
    
        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

function conky_clock_rings()
    local function setup_rings(cr,pt)
        local str=''
        local value=0
        
        str=string.format('${%s %s}',pt['name'],pt['arg'])
        str=conky_parse(str)
        
        value=tonumber(str)
        pct=value/pt['max']
        
        draw_ring(cr,pct,pt)
    end
    
    -- Check that Conky has been running for at least 5s

    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)
    
    local cr=cairo_create(cs)    
    
    local updates=conky_parse('${updates}')
    update_num=tonumber(updates)
    
    if update_num>5 then
        for i in pairs(settings_table) do
            setup_rings(cr,settings_table[i])
        end
    end
    
    draw_clock_hands(cr,clock_x,clock_y)
end

et pour info quelqu'un sait comment changé la couleur des aiguiles de l'horloge.... je pourrais allors mettre les même couleurs que les rings. pour chaque aiguille si ces possible!!!

Dernière modification par maestroom (Le 17/05/2011, à 06:39)


CM: Asus Maximus extreme VI/ cpu: intel Core I7-4770 /carte graphique: nvidia GTX 760 /os: Ubuntu gnome-shell 14.04 "" 64 bits avec dual boot windows 8.1 64bit

Hors ligne

#647 Le 17/05/2011, à 18:18

Fenouille84

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

bece a écrit :

... Ils ont eu des problèmes big_smile

+1 big_smile


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

Hors ligne

#648 Le 20/05/2011, à 18:38

chepioq

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

maestroom a écrit :

et pour info quelqu'un sait comment changé la couleur des aiguiles de l'horloge.... je pourrais allors mettre les même couleurs que les rings. pour chaque aiguille si ces possible!!!

Pour changer la couleur des aiguilles de l'horloge c'est la ligne

    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)

vers la fin de ton code.
Si tu met par exemple

    cairo_set_source_rgba(cr,0.0,0.0,1.0,1.0)

tu auras les aiguilles bleues

Par contre je ne sais pas quel sont les valeurs a donner pour une couleur défini (je l'ai su mais je ne m(en souvient plus)

Mais tu auras les aiguilles de la même couleur...


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

Hors ligne

#649 Le 20/05/2011, à 19:22

chepioq

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

Bon j'ai trouvé comment avoir une couleur différente pour chaque aiguille:

Tu modifie une partie de ton script lua comme ceci

    -- Draw hour hand
    
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,0.0,0.0,1.0,1.0)
    cairo_stroke(cr)
    
    -- Draw minute hand
    
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    cairo_set_source_rgba(cr,1.0,1.0,1.0,1.0)    
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    
    -- Draw seconds hand
    
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
        cairo_set_source_rgba(cr,0.0,1.0,1.0,1.0)    
    
        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

après à toi de trouver les bonne valeurs pour les couleurs que tu désires (là tu as une aiguille bleue, une blanche et une bleue clair)

Dernière modification par chepioq (Le 20/05/2011, à 19:24)


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

Hors ligne

#650 Le 20/05/2011, à 19:44

chepioq

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

Une autre méthode (je sais je flood un peu, mais je teste en même temps...)

Essaye avec cette modification:

function draw_clock_hands(cr,xc,yc)
    local secs,mins,hours,secs_arc,mins_arc,hours_arc
    local xh,yh,xm,ym,xs,ys
    local color_hour={50,50,0}
    local color_minute={210,210,0}
    local color_second={100,100,0}
    
    secs=os.date("%S")    
    mins=os.date("%M")
    hours=os.date("%I")
        
    secs_arc=(2*math.pi/60)*secs
    mins_arc=(2*math.pi/60)*mins+secs_arc/60
    hours_arc=(2*math.pi/12)*hours+mins_arc/12
        
    -- Draw hour hand
    
    xh=xc+0.7*clock_r*math.sin(hours_arc)
    yh=yc-0.7*clock_r*math.cos(hours_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xh,yh)
    
    cairo_set_line_cap(cr,CAIRO_LINE_CAP_ROUND)
    cairo_set_line_width(cr,5)
    cairo_set_source_rgba(cr,color_hour[1]/255, color_hour[2]/255, color_hour[3]/255,1)
    cairo_stroke(cr)
    
    -- Draw minute hand
    
    xm=xc+clock_r*math.sin(mins_arc)
    ym=yc-clock_r*math.cos(mins_arc)
    cairo_move_to(cr,xc,yc)
    cairo_line_to(cr,xm,ym)
    cairo_set_source_rgba(cr,color_minute[1]/255, color_minute[2]/255, color_minute[3]/255,1)    
    cairo_set_line_width(cr,3)
    cairo_stroke(cr)
    
    -- Draw seconds hand
    
    if show_seconds then
        xs=xc+clock_r*math.sin(secs_arc)
        ys=yc-clock_r*math.cos(secs_arc)
        cairo_move_to(cr,xc,yc)
        cairo_line_to(cr,xs,ys)
        cairo_set_source_rgba(cr,color_second[1]/255, color_second[2]/255, color_second[3]/255,1)    
    
        cairo_set_line_width(cr,1)
        cairo_stroke(cr)
    end
end

Tu n'as plus qu"a rentrer les valeurs que tu veux dans

    local color_hour={50,50,0}
    local color_minute={210,210,0}
    local color_second={100,100,0}

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

Hors ligne