Accueil Forum Wiki Projets Créer un compte Groupes Utilisateurs

Rester connecté
Personnalisation de GNU/Linux Liste des forums Conky conky
Conky
Sujets Auteur Langue Messages Dernier message
message conky
ljere fr Français 4 mathieuI [Lire]
Dimanche 18 Janvier 2009, à 20:20

Dimanche 18 Janvier 2009, à 14:59 - Citer

voici mon conky pour commencer je vous donne le script pour la météo qui va avec.
http://img90.imageshack.us/img90/7973/capturegj9.th.jpg
le conkyrc
# 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 utiliser
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 320

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

# 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

#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
default_shade_color 333333
default_outline_color black

color1 e49c16
color2 CA0000 #rouge

color6 EEEEEE
color7 DDDDDD
color8 CCCCCC
color9 BBBBBB

TEXT
${offset 25}${color}${time %A %d %B %Y}
${offset 23}${color1} ${font Astron Boy Video:style=Bold:pixelsize=30}${time %H:%M:%S}${font}${color}

${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Ordinateur ${color2}${hr}${font}

${offset 25}${color1}${execi 86400 cat /etc/lsb-release|grep ID|cut -d= -f2} ${color}${execi 86400 cat /etc/lsb-release|grep REL|cut -d= -f2} ${execi 86400 cat /etc/lsb-release|grep NAME|cut -d= -f2}
${offset 25}${color1}$sysname ${color}$kernel ${color}$machine
${offset 25}${color1}${nodename}${color} fonctionne depuis ${color1}$uptime
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Réseau ${color2}${hr}
${color1}${offset 25}${font}Eth0
${offset 25}${color1}Lan :${alignr}${offset -25}${color}${addr eth0}
${offset 25}${color1}Wan :${alignr}${offset -33}${color}${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${offset 25}${color1}Téléchargement${color}${alignr}${offset -35}${color1}Emission${color}
${offset 25}${color2}${downspeedgraph eth0 16,115 582D10 E08000}${alignr}${offset -35}${upspeedgraph eth0 16,115 582D10 E08000}
${offset 25}${color}${downspeed eth0}ko/s ${totaldown eth0}${alignr}${offset -32}${upspeed eth0}ko/s ${totalup eth0}
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Processeur ${color2}${hr}
${font}${color1}${alignr}${offset -32}Total : ${color}$processes ${color1}En cours :${color}$running_processes

${offset 25}${color1}CPU : ${color}${freq_dyn_g}GHz ${color1}soit : ${color}$cpu%${alignr}${color2}${offset -35}${voffset
-12}${cpugraph 16,125 582D10 E08000}
${alignr}${offset -35}${color1}PID %CPU %MEM
${offset 25}${color1}${top name 1}${alignr}${offset -35}${color} ${top pid 1} ${top cpu 1} ${top mem 1}
${offset 25}${color1}${top name 2}${alignr}${offset -35}${color6} ${top pid 2} ${top cpu 2} ${top mem 2}
${offset 25}${color1}${top name 3}${alignr}${offset -35}${color7} ${top pid 3} ${top cpu 3} ${top mem 3}
${offset 25}${color1}${top name 4}${alignr}${offset -35}${color8} ${top pid 4} ${top cpu 4} ${top mem 4}
${offset 25}${color1}${top name 5}${alignr}${offset -35}${color9} ${top pid 5} ${top cpu 5} ${top mem 5}
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Mémoire ${color2}${hr}${font}

${offset 25}${color1}Ram :${alignc}${offset 1}${color2}${membar 5,170} ${color}${alignr}${offset -35}${memperc}%
${offset 25}${color1}Swap :${alignc}${color2}${swapbar 5,170} ${color}${alignr}${offset -35}${swapperc}%
${offset 25}${alignr}${offset -35}${color1}PID %CPU %MEM
${offset 25}${color1}${top_mem name 1}${alignr}${offset -35}${color} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${offset 25}${color1}${top_mem name 2}${alignr}${offset -35}${color6} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${offset 25}${color1}${top_mem name 3}${alignr}${offset -35}${color7} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${offset 25}${color1}${top_mem name 4}${alignr}${offset -35}${color8} ${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${offset 25}${color1}${top_mem name 5}${alignr}${offset -35}${color9} ${top_mem pid 5} ${top_mem cpu 5} ${top_mem mem 5}
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Disques ${color2}${hr}${font}

${offset 25}${color1}/ :${color}${offset 31}${fs_used_perc /}% ${alignr}${offset -35}${color1}[${color}${fs_free /}${color1}/ ${color7}${fs_used /}${color1}/ ${color8}${fs_size /}${color1}]
${offset 25}${color2}${fs_bar 6,260 /}
${offset 25}${color1}/home :${color}${fs_used_perc /home}% ${alignr}${offset -35}${color1}[${color}${fs_free /home}${color1}/ ${color7}${fs_used /home}${color1}/ ${color8}${fs_size /home}${color1}]
${offset 25}${color2}${fs_bar 6,260 /home}
${offset 25}${color1}/stock :${color}${offset 2}${fs_used_perc /home/ljere/stock}% ${alignr}${offset -35}${color1}[${color}${fs_free /home/ljere/stock}${color1}/ ${color7}${fs_used /home/ljere/stock}${color1}/ ${color8}${fs_size /home/ljere/stock}${color1}]
${offset 25}${color2}${fs_bar 6,260 /home/ljere/stock}
${offset 25}${color1}/boot :${color}${offset 7}${fs_used_perc /boot}% ${alignr}${offset -35}${color1}[${color}${fs_free /boot}${color1}/ ${color7}${fs_used /boot}${color1}/ ${color8}${fs_size /boot}${color1}]
${offset 25}${color2}${fs_bar 6,260 /boot}
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Température ${color2}${hr}${font}

${offset 25}${color1}Carte Mère :${alignr}${offset -35}${color}${exec sensors | grep temp1 | awk '{ print $2}'}
${offset 25}${color1}Processeur :${alignr}${offset -35}${color6}${exec sensors | grep temp2 | awk '{ print $2}'}
${offset 25}${color1}sda :${alignr}${offset -35}${color7}+${execi 10 hddtemp -n /dev/sda}.0°C
${offset 25}${color1}sdc :${alignr}${offset -35}${color8}+${execi 10 hddtemp -n /dev/sdc}.0°C
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Météo ${color2}${hr}${font}

${offset 25}${color1}Ville :${alignr}${offset -35}${color}${execi 600 sh /home/ljere/.weather.sh "FRXX0052" | grep Ville | awk '{ print $2}'}
${offset 25}${color1}Conditions :${alignr}${offset -35}${color6}${execi 600 sh /home/ljere/.weather.sh "FRXX0052" | grep Conditions | awk '{ print $2}'}.
${offset 25}${color1}Température :${alignr}${offset -35}${color7}${execi 600 sh /home/ljere/.weather.sh "FRXX0052" | grep Temperature | awk '{ print $2}'}.
${offset 25}${color1}Demain :${alignr}${offset -35}${color8}${execi 600 sh /home/ljere/.weather.sh "FRXX0052" | grep Demain | awk '{ print $2}'}.
${offset 25}${color1}Vent :${alignr}${offset -35}${color9}${execi 600 sh /home/ljere/.weather.sh "FRXX0052" | grep Vent | awk '{ print $2}'}.
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=15} Rhythmbox ${color2}${hr}${font}
${if_running rhythmbox}
${offset 25}${color1}Artiste :${alignr}${offset -35}${color}${exec rhythmbox-client --no-start --print-playing-format "%ta"}
${offset 25}${color1}Album :${alignr}${offset -35}${color6}${exec rhythmbox-client --no-start --print-playing-format "%at"}
${offset 25}${color1}Titre :${alignr}${offset -35}${color7}${exec rhythmbox-client --no-start --print-playing-format "%tt"}
${offset 25}${color1}Durée :${alignr}${offset -35}${color8}${exec rhythmbox-client --no-start --print-playing-format "%te / %td"}
${else}
${offset 25}${color1}Rhythmbox n'est pas ouvert
$endif
${color1}${font URW Chancery L:style=Medium Italic:pixelsize=18} Conçu par Ljere ${font}${color2}${hr}

Dimanche 18 Janvier 2009, à 15:03 - Citer

le script de boojit qui est a placer dans votre dossier /home/user, modifier ci dessus et en dessous ljere en votre user
.weather.sh
#!/bin/sh

#
# Grab weather data from weather.com and format it according to the given XSLT
# Script written by boojit
# Modified by Hellf[i]re
# The orignal script and xslt can be downloaded from http://pondol.com/weather.tar.gz

# Usage:
# ${execi 1800 /path/to/weather/weather.sh location}
# Usage Example:
# ${execi 1800 /home/user/weather/weather.sh 03833}

# your Location ID: use http://xoap.weather.com/search/search?where=[yourcity] to find it
# U.S. users can just use their zip code; doubt that works for anyone else though (YMMV)
LOCID=$1

# s=standard units, m=metric units
UNITS=m

# where this script and the XSLT lives
RUNDIR=/home/ljere
# there's probably other stuff besides CURL that will work for this, but i haven't
# tried any others.
# you can get curl at http://curl.haxx.se/
CURLCMD=/usr/bin/curl

# get it at http://xmlsoft.org/XSLT/
XSLTCMD=/usr/bin/xsltproc

# you probably don't need to modify anything below this point....

# CURL url. Use cc=* for current forecast or dayf=10 to get a multi-day forecast
CURLURL="http://xoap.weather.com/weather/local/$LOCID?cc=*&unit=$UNITS&dayf=2"

# The XSLT to use when translating the response from weather.com
# You can modify this xslt to your liking
XSLT=$RUNDIR/.weather.xslt

#filter (if you want to convert stuff to lower-case or upper case or something)
#FILTER="|gawk '{print(tolower(\$0));}'"

#####

Dimanche 18 Janvier 2009, à 15:06 - Citer

et pour finir on place toujours dans /home/user
.weather.xslt
<!--

This XSLT is used to translate an XML response from the weather.com
XML API.

You can format this file to your liking. Two things you may feel
like doing:

1) Modify the layout of the fields or static text already defined
2) Add other fields from the XML response file that aren't referenced in this
XSLT. You can grab a full list by just doing a:
wget "http://xoap.weather.com/weather/local/$LOCID?cc=*&unit=$UNITS"
(change $LOCID and $UNITS to suit your needs)
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="text" disable-output-escaping="yes"/>
<xsl:template match="weather">
<xsl:apply-templates select="cc"/>
<xsl:apply-templates select="dayf/day[@d='1']"/>
</xsl:template>


<xsl:template match="cc">
<xsl:text>Ville: </xsl:text><xsl:value-of select="obst"/>
<xsl:text>:
</xsl:text>
<xsl:text> Temperature: </xsl:text><xsl:value-of select="tmp"/><xsl:value-of select="/weather/head/ut"/>
<xsl:if test="tmp != flik">
<xsl:text>
Ressenti: </xsl:text><xsl:value-of select="flik"/><xsl:value-of select="/weather/head/ut"/>
</xsl:if>
<xsl:text>
Conditions: </xsl:text><xsl:value-of select="t"/>
<xsl:text>
Vent: </xsl:text>
<xsl:choose>
<xsl:when test="wind/s = 'calm'"><xsl:text>0</xsl:text></xsl:when>
<xsl:otherwise><xsl:value-of select="wind/s"/></xsl:otherwise>
</xsl:choose>
<xsl:value-of select="/weather/head/us"/>
<xsl:choose>
<xsl:when test="wind/s = 'calm'"><xsl:text>(0mph)</xsl:text></xsl:when>
<xsl:otherwise><xsl:text> (</xsl:text><xsl:value-of select="round(wind/s * 0.6214)"/><xsl:text>mph)</xsl:text></xsl:otherwise>
</xsl:choose>
<xsl:text> (</xsl:text><xsl:value-of select="wind/t"/>
<xsl:text>)</xsl:text>
</xsl:template>

<xsl:template match="dayf/day[@d='1']">
<xsl:text>
Demain: </xsl:text><xsl:value-of select="low"/><xsl:value-of select="/weather/head/ut"/>
<xsl:text> to </xsl:text><xsl:value-of select="hi"/><xsl:value-of select="/weather/head/ut"/>
<xsl:text>, </xsl:text><xsl:value-of select="part[@p='d']/t"/>
<xsl:text>
</xsl:text><xsl:value-of select="/weather/swa/a/t"/>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>

Dimanche 18 Janvier 2009, à 20:20 - Citer

pas mal
je l'ai adapté à mes besoins, il me reste encore à ajouter le wifi :
# Total number of times for Conky to update before quitting. 0 = forever
total_run_times 0

# Print text to stdout
out_to_console no

# Buffer management, avoid blinking
double_buffer yes
no_buffers yes
text_buffer_size 2048

# refresh rate
update_interval 1

# samples for rate average
cpu_avg_samples 4
net_avg_samples 2

# size and posiiton
alignment top_right
minimum_size 320 5
maximum_width 320
gap_x 4
gap_y 30

# shading and framming
draw_shades yes
draw_outline no
draw_borders no
border_width 1
border_margin 4

# should Conky fork in the background
background yes

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

#font management
use_xft yes
xftalpha .1
override_utf8_locale yes # force UTF8

# font face
xftfont Fixed:size=7#OCR A Std:size=6
uppercase no

# Adds spaces to keep things from moving about.
# Works only with fixed width fonts
use_spacer right

# Colors
default_color FFFFFF
default_shade_color 333333
default_outline_color black

color1 e49c16
color2 CA0000 #rouge

color6 CCCCCC
color7 999999
color8 666666
color9 333333

TEXT
${color1}${color}${time %A %d %B %Y}
${color1} ${font Astron Boy Video:style=Bold:pixelsize=20}${time %H:%M:%S}${font}${color}
${color1}${font Aerial:size=8} Computer${color2}${hr}${font}
${alignr}${color}${execi 86400 cat /etc/lsb-release|grep ID|cut -d= -f2} ${color1}${execi 86400 cat /etc/lsb-release|grep REL|cut -d= -f2}${color} "${color1}${execi 86400 cat /etc/lsb-release|grep NAME|cut -d= -f2}${color}"
${alignr}${color}$sysname ${color1}$kernel ${color}on ${color1}$machine
${alignr}${color1}${nodename}${color} fonctionne depuis ${color1}$uptime${color}
${color1}${font Aerial:size=8} Réseau${color2}${hr}
${color1}${font}eth0 :
${alignc}${color2}lan: ${color}${addr eth0} ${color2}IP:${color}${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${color2}${downspeedgraph eth0 16,145 582D10 E08000}${alignr}${upspeedgraph eth0 16,145 582D10 E08000}
${color1}Down ${color}${downspeed eth0} ${color grey}ko/s${color} ${color}${totaldown eth0}${alignr}${color1}Up ${color}${color}${upspeed eth0} ${color grey}ko/s${color} ${color}${totalup eth0}
${color1}${font}ath0 :
${alignc}${color2}lan: ${color}${addr ath0} ${color2}IP:${color}${texeci 3600 wget http://checkip.dyndns.org -O - -o /dev/null | cut -d : -f 2 | cut -d \< -f 1}
${color2}${downspeedgraph ath0 16,145 582D10 E08000}${alignr}${upspeedgraph ath0 16,145 582D10 E08000}
${color1}Down ${color}${downspeed ath0} ${color grey}ko/s${color} ${color}${totaldown ath0}${alignr}${color1}Up ${color}${color}${upspeed ath0} ${color grey}ko/s${color} ${color}${totalup ath0}
${color1}${font Aerial:size=8} Disques${color2}${hr}
${color2}/${color1} : ${color}${fs_used_perc /} % ${alignr}${color1}[${color}${fs_free /}${color1}/ ${color7}${fs_used /}${color1}/ ${color8}${fs_size /}${color1}]
${color2}${fs_bar 4 /}
${color2}/${color1}home${color1}: ${color}${fs_used_perc /home/mathieui/} % ${alignr}${color1}[${color}${fs_free /home/mathieui/}${color1}/ ${color7}${fs_used /home/mathieui/}${color1}/ ${color8}${fs_size /home/mathieui/}${color1}]
${color2}${fs_bar 4 /home/mathieui/}
${if_mounted /media/IOMEGA_HDD/}${color1}/media: ${color}${fs_used_perc /media/IOMEGA_HDD/} %${alignr}${color1}[${color}${fs_free /media/IOMEGA_HDD/}${color1}/ ${color7}${fs_used /media/IOMEGA_HDD/}${color1}/ ${color8}${fs_size /media/IOMEGA_HDD/}${color1}]
$color2${fs_bar 4 /media/IOMEGA_HDD/}$endif
${color1}${font Aerial:size=8} Processeur${color2}${hr}
${font}${color2}${alignc}Total: ${color}$processes ${color2}Running:${color} ${color}$running_processes

${voffset 2}${color1}CPU :${alignr}${color}${freq_dyn_g}GHz ${color2}${color2}${voffset
-12}${cpugraph 16,128 582D10 E08000} ${voffset -1}${color}$cpu%
${alignr}${offset -32}${color1}PID %CPU %MEM
${alignr}${offset -32}${color1}${top name 1}${color} ${top pid 1} ${top cpu 1} ${top mem 1}
${alignr}${offset -32}${color1}${top name 2}${color6} ${top pid 2} ${top cpu 2} ${top mem 2}
${alignr}${offset -32}${color1}${top name 3}${color7} ${top pid 3} ${top cpu 3} ${top mem 3}
${alignr}${offset -32}${color1}${top name 4}${color8} ${top pid 4} ${top cpu 4} ${top mem 4}
${alignr}${offset -32}${color1}${top name 5}${color9} ${top pid 5} ${top cpu 5} ${top mem 5}
${color1}${font Aerial:size=8} Mémoire${color2}${hr}${font}
${color1}RAM :$color6 ${mem}$color1 /$color7${memmax} $color${alignr}${color2}${membar 4,128} ${color}${memperc}%
${color1}swap :$color6 ${swap}$color1 /$color7${swapmax}${alignr}${offset 6}${color2}${swapbar 4,128} ${color}${swapperc}%
${alignr}${offset -32}${color1}PID %CPU %MEM
${alignr}${offset -32}${color1}${top_mem name 1}${color} ${top_mem pid 1} ${top_mem cpu 1} ${top_mem mem 1}
${alignr}${offset -32}${color1}${top_mem name 2}${color6} ${top_mem pid 2} ${top_mem cpu 2} ${top_mem mem 2}
${alignr}${offset -32}${color1}${top_mem name 3}${color7} ${top_mem pid 3} ${top_mem cpu 3} ${top_mem mem 3}
${alignr}${offset -32}${color1}${top_mem name 4}${color8} ${top_mem pid 4} ${top_mem cpu 4} ${top_mem mem 4}
${alignr}${offset -32}${color1}${top_mem name 5}${color9} ${top_mem pid 5} ${top_mem cpu 5} ${top_mem mem 5}
${color1}${font Aerial:size=8} Température${color2}${hr}${font}
${color1}Carte Mère :${alignc}${offset 30}${color}${exec sensors | grep temp1 | awk '{ print $2}'}
${color1}Processeur :${alignc}${offset 30}${color6}${exec sensors | grep temp2 | awk '{ print $2}'}

${color1}${font Aerial:size=8} Batterie${color2}${hr}${font}

$color1 Etat :$color${battery_percent BAT0} % ${alignc}${offset 30}$color ${acpiacadapter}
$color1 Autonomie (si sur batterie):${color white}$alignc${execi 60 acpi|cut -d , -f 3| cut -d r -f 1 }
$color2 ${battery_bar BAT0}

Conky
Sujets Auteur Langue Messages Dernier message
message conky
ljere fr Français 4 mathieuI [Lire]
Dimanche 18 Janvier 2009, à 20:20

Poster un message
Filtre anti-spam 2 + 2 =
sntx_boldsntx_italicsntx_underlinesntx_strike  sntx_align_leftsntx_align_centersntx_align_rightsntx_align_justifysntx_align_float  sntx_listsntx_list_number  sntx_linksntx_mail  sntx_quotesntx_codesntx_math  sntx_imagesntx_rss  sntx_box_downloadsntx_box_infosntx_box_errorsntx_box_warning
Le saviez-vous ? La balise RSS permet d'afficher les 5 derniers articles d'un fil : [rss]http://...[/rss]

Personnalisation de GNU/Linux Liste des forums Conky conky