Bon, j'ai réussi à me démerder pour lancer une session vide à chaque démarrage . Le problème c'est qu'à chaque fois je dois donner un nom à ma session à et me prend 3 clics de plus ... Donc faudra que j'essayes de trouver le fichier de conf qui s'occupe de ça ^^



En attendant, je vous file mes conkyrc :
Mon ~/.conkyScript.sh :
#!/bin/bash
killall conky
sleep 20

conky
conky -c /home/Arkezis/.conky/conkyrc2
Mon ~/.conkyrc (le conky du haut) :
# set to yes if you want Conky to be forked in the background
background yes

cpu_avg_samples 2
net_avg_samples 2

short_units yes

out_to_console no

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont monospace-8

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 1

# Create own window instead of using desktop (required in nautilus)
own_window_transparent yes
own_window_colour black
own_window yes
own_window_type root
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 300 5
maximum_width 450

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 0

# drawn 1 pixel border around graphs or not
draw_graph_borders yes

# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
alignment top_right

# Gap between borders of screen and text

gap_x 490
gap_y 10

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

# Subtract file system buffers from used memory?
no_buffers no

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

#A lot of text in Conky ?
text_buffer_size 1024

####################################
####################################
####################################
####################################
TEXT
${font Verdana:size=11}$alignc${color #DBAA82}${Time %A %d %B %Y} 
$alignc${color #FFFB00}${time %H:%M:%S}${font Sans:size=8.5}
${color #565868}${hr 2}
${color #DBAA82}$sysname : ${color #565868}$kernel ${color #DBAA82}on ${color #565868}$machine
${color #DBAA82}Uptime : ${color #B6A291}$uptime | ${color #DBAA82}Temp : ${color #B6A291}${acpitemp}°C
${color #DBAA82}Adaptateur : ${color #FFFB00}${acpiacadapter}
${color #DBAA82}Autonomie batterie : ${color #FFFB00}${battery_percent BAT0}%
${color #FFFB00}${battery_bar BAT0}
${color #DBAA82}Charge cpu : (${color #FFFB00}${freq} MHz${color #DBAA82}) cpu 1: ${color #FFFB00}${cpu cpu1}%  ${color #DBAA82}cpu 2: ${color #FFFB00}${cpu cpu2}%
$alignc${color #FFFFFF}${cpugraph cpu1 32,100 0000ff ff4500} ${color #FFFFFF} ${cpugraph cpu2 32,100 0000ff ff4500}
${color #DBAA82}ram : ${color #3652FF}$mem ${color #DBAA82}/ $memmax - ${color #FFFB00}$memperc% ${alignr 140}${color #344299}$membar
${color #DBAA82}swap : ${color #3652FF}$swap ${color #DBAA82}/ $swapmax - ${color #FFFB00}$swapperc% ${alignr 140}${color #344299}$swapbar
${color #565868}${hr 2}
${color #DBAA82}Disques (${color #FFFB00}${execi 10 hddtemp -n /dev/sda}°C${color #DBAA82}) :
${color #DBAA82}racine : ${color #3652FF}${fs_used /} ${color #DBAA82}/ ${fs_size /} (${color #FFFB00}${fs_free_perc /}% ${color #DBAA82}libre)
${color #344299}${fs_bar /}
${color #DBAA82}home : ${color #3652FF}${fs_used /home/Arkezis} ${color #DBAA82}/ ${fs_size /home/Arkezis} (${color #FFFB00}${fs_free_perc /home/Arkezis}% ${color #DBAA82}libre)
${color #344299}${fs_bar /home/Arkezis}
${color #DBAA82}data : ${color #3652FF}${fs_used /mnt/data} ${color #DBAA82}/ ${fs_size /mnt/data} (${color #FFFB00}${fs_free_perc /mnt/data}% ${color #DBAA82}libre)
${color #344299}${fs_bar /mnt/data}
${if_mounted /media/disk}${color #DBAA82}clé(ext) : ${color #3652FF}${fs_used /media/disk} ${color #DBAA82}/ ${fs_size /media/disk} (${color #FFFB00}${fs_free_perc /media/disk}% ${color #DBAA82}libre)
${color #344299}${fs_bar /media/disk}${else}${color #DBAA82}${alignc}clé non montée$endif
Et mon ~/.conky/conkyrc2 (celui du bas) :
# set to yes if you want Conky to be forked in the background
background yes

cpu_avg_samples 2
net_avg_samples 2

short_units yes

out_to_console no

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont monospace-8

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 1

# Create own window instead of using desktop (required in nautilus)
own_window_transparent yes
own_window_colour black
own_window yes
own_window_type root
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 200 255
maximum_width 500
maximum_height 500

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 0

# border width
border_width 0

# drawn 1 pixel border around graphs or not
draw_graph_borders yes

# Default colors and also border colors
default_color white
default_shade_color white
default_outline_color white

# Text alignment, other possible values are commented
alignment bottom_right

# Gap between borders of screen and text

gap_x 515
gap_y 150

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

# Subtract file system buffers from used memory?
no_buffers no

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

#A lot of text in Conky ?
text_buffer_size 1024

####################################
####################################
####################################
####################################
TEXT
${color #DBAA82}Processus${alignr 52}PID ${alignr 20} %cpu
${color #FFFB00}${top name 1}${alignr 38}${top pid 1} ${alignr 20} ${top cpu 1}
${color #565868}${top name 2}${alignr 38}${top pid 2} ${alignr 20} ${top cpu 2}
${color #565868}${top name 3}${alignr 38}${top pid 3} ${alignr 20} ${top cpu 3}
${color #565868}${top name 4}${alignr 38}${top pid 4} ${alignr 20} ${top cpu 4}
${color #565868}${top name 5}${alignr 38}${top pid 5} ${alignr 20} ${top cpu 5}
${color #565868}${hr 2}
${color #DBAA82}Processus$color ${alignr 52}PID ${alignr 20} %mem
${color #FFFB00}${top_mem name 1}${alignr 26}${top_mem pid 1}  ${alignr 14} ${top_mem mem 1}${color #ffc11f} 
${color #565868}${top_mem name 2}${alignr 26}${top_mem pid 2}  ${alignr 14} ${top_mem mem 2}${color #ffc11f} 
${color #565868}${top_mem name 3}${alignr 26}${top_mem pid 3}  ${alignr 14} ${top_mem mem 3}${color #ffc11f} 
${color #565868}${top_mem name 4}${alignr 26}${top_mem pid 4}  ${alignr 14} ${top_mem mem 4}${color #ffc11f} 
${color #565868}${top_mem name 5}${alignr 26}${top_mem pid 5}  ${alignr 14} ${top_mem mem 5}${color #ffc11f} 
${color #565868}${hr 2}
${if_existing /proc/net/route eth0}${color #DBAA82}Ethernet : $color${addr eth0}
${color #DBAA82}Download : $color${downspeed eth0} kiB/s ${alignr}${color #DBAA82}Upload : $color${upspeed eth0} kiB/s
${color #DBAA82}Total : $color${totaldown eth0} ${alignr}${color #DBAA82}Total : $color${totalup eth0}
$endif${if_existing /proc/net/route wlan0}${color #DBAA82}Wi-Fi : $color${wireless_bitrate wlan0} ${alignr}${color #DBAA82}IP Locale : $color${addr wlan0}
${color #DBAA82}Signal : $color${wireless_link_qual wlan0} % ${color2}${wireless_link_bar wlan0}
${color #DBAA82}SSID : $color${wireless_essid wlan0} ${alignr}${color #DBAA82}MAC : $color${wireless_ap wlan0}
${color #DBAA82}Download : $color${downspeed wlan0} kiB/s ${alignr}${color #DBAA82}Upload : $color${upspeed wlan0} kiB/s
${color #DBAA82}Total : $color${totaldown wlan0} ${alignr}${color #DBAA82}Total : $color${totalup wlan0}
$endif
un mois plus tard
Bonjour
En furetant un peu sur le forum anglais de ubuntu, j'ai trouvé une commande pour pouvoir afficher le nom et la version de fedora (ou d'une autre distribution)
[dominique@Dominique ~]$ lsb_release -d
Description:    Fedora release 10 (Cambridge)
[dominique@Dominique ~]$ lsb_release -i
Distributor ID:    Fedora
[dominique@Dominique ~]$ lsb_release -r
Release:    10
[dominique@Dominique ~]$ lsb_release -c
Codename:    Cambridge
Je l'ai intégré a mon conky:
background no
font 6x10
use_xft yes
xftfont MgOpen Modata L:size=7:bold
#xftalpha 0.8
update_interval 3.0
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
#own_window_colour SteelBlue4
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
#minimum_size 280 5
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
stippled_borders 8
border_margin 4
border_width 1
default_color white
default_shade_color black
default_outline_color black
alignment top_right
gap_x 12
gap_y 270
no_buffers yes
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer right

TEXT
${font MgOpen Modata L:size=12:bold} $alignc ${color #cd5555}${execi 1800 lsb_release -d | awk '{print $2$4}'} ${execi 1800 lsb_release -c | awk '{print $2}'}
${font} $alignc ${color #cd5555}$sysname $kernel on $machine
${color #000080}$stippled_hr
${color #cd5555}Système de fichiers ouvert depuis: ${color #11B3F8}$uptime
${color #cd5555}Fréquence CPU: ${color #11B3F8}$freq
${color #0000ff}${cpugraph cpu1 32,181 0000ff ff4500} ${color #0000ff}${cpugraph cpu2 32,181 0000ff ff4500}
${color #cd5555}Utilisation Core 1:          ${color #11B3F8}${cpu cpu1}%                  ${color #cd5555}Utilisation Core 2:          ${color #11B3F8}${cpu cpu2}% 
${color #cd5555}Température Core 1:  ${color #11B3F8}${exec sensors | grep 0: | awk '{print $3}'}               ${color #cd5555}Température Core 2:  ${color #11B3F8}${exec sensors | grep 1: | awk '{print $3}'}
${color #000080}$stippled_hr
${color #cd5555}Version du pilote NVidia: ${color #11B3F8}${execi 1800 nvidia-settings -q NvidiaDriverVersion | grep Attribute |  awk '{print $4}'}
${color #cd5555}Température GPU:     ${color #11B3F8}${exec nvidia-settings -q gpucoretemp | grep Attribute | awk '{print $4}' | cut -c1-2}°C ${color #cd5555}            Fréquence GPU:     ${color #11B3F8}${exec nvidia-settings -q GPUCurrentClockFreqs | grep Attribute | awk '{print $4}' | cut -c1-7} Mhz
${color #000080}$stippled_hr
${color #cd5555}Utilisation RAM ${color #0000ff}$alignc           Totale           Utilisée          Pourcentage
$alignc ${color #11B3F8}$memmax           $mem            $memperc%
${color #0000ff}${memgraph 0000ff ff4500}
${color #cd5555}Utilisation Swap :   ${color #11B3F8} $swap/$swapmax - $swapperc% ${color #00f5ff} ${swapbar}
${color #000080}$stippled_hr
${color #cd5555}Internet:
${color #0000ff}Reception:${color #ff4500} ${downspeedf eth0} k/s                      ${color #11B3F8}       Envoi: ${color #ff4500}${upspeedf eth0} k/s
${color #0000ff}Total:       ${color #ff4500} ${totaldown eth0}                               ${color #11B3F8}Total:${color #ff4500} ${totalup eth0}
${color #0000ff}${downspeedgraph eth0 32,181 0000ff ff4500} ${color #22ccff}${upspeedgraph eth0 32,181 0000ff ff4500}
${color #000080}$stippled_hr
${color #cd5555}Systèmes de fichiers:
${color #cd5555}Système ${color #11B3F8} ${fs_used /} / ${fs_size /}: ${color #00f5ff}${fs_bar /}
${color #cd5555}Home      ${color #11B3F8} ${fs_used /home} / ${fs_size /home} : ${color #00f5ff}${fs_bar /home}
${color #000080}$stippled_hr
${color #cd5555}Processus : ${color #11B3F8}$processes       ${color #11B3F8}En cours: ${color #ff4500}$running_processes
${color #0000ff}En cours:       $alignc       PID      CPU%      MEM%
${color #ff4500} ${top name 1}  $alignc  ${top pid 1}      ${top cpu 1}      ${top mem 1}
${color #11B3F8} ${top name 2}  $alignc  ${top pid 2}      ${top cpu 2}      ${top mem 2}
${color #11B3F8} ${top name 3}  $alignc  ${top pid 3}      ${top cpu 3}      ${top mem 3}
${color #11B3F8} ${top name 4}  $alignc  ${top pid 4}      ${top cpu 4}      ${top mem 4}
${color #0000ff}En mémoire:
${color #ff4500} ${top_mem name 1} $alignc   ${top_mem pid 1}      ${top_mem cpu 1}      ${top_mem mem 1}
${color #11B3F8} ${top_mem name 2} $alignc   ${top_mem pid 2}      ${top_mem cpu 2}      ${top_mem mem 2}
${color #11B3F8} ${top_mem name 3} $alignc   ${top_mem pid 3}      ${top_mem cpu 3}      ${top_mem mem 3}
Et voila le résultat:
22 jours plus tard
Salut!
Je voudrais faire un conky permettant d'afficher la musique que j'écoute. Le problème sait que suivant mon humeur
j'utilise soit amarok2 ou rhythmbox. Pour le deuxième il n'y a pas de soucis., mais je n'arrive pas à récupérer la durée totale de la musique et
là ou l'on en est rendu.

mon .conkyrc
${if_running rhythmbox}
Rhythmbox
Titre : ${execi 1 rhythmbox-client --no-start --print-playing-format "%tt"}
Artiste : ${execi 1 rhythmbox-client --no-start --print-playing-format "%aa"}
Album : ${execi 1 rhythmbox-client --no-start --print-playing-format "%at"}
Durée : ${execi 1 rhythmbox-client --no-start --print-playing-format "%te / %td"}
$endif
${if_running amarok}
Amarok
Artiste : ${execi 1 ~/.conky/amarok artist}
Titre : ${execi 1 ~/.conky/amarok title}
Album : ${execi 1 ~/.conky/amarok album}
$endif
et mon fichier amarok
#!/bin/bash
# amaroK info display script by eirc <eirc.eirc@gmail.com>

case "$1" in

# Now Playing Info
artist) qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.GetMetadata |grep ^artist:|cut -d ":" -f2;;
title)  qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.GetMetadata |grep ^title:|cut -d ":" -f2;;
album)  qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.GetMetadata |grep ^album:|cut -d ":" -f2;;

progress)       // voilà les lignes que je 'arrive pas à faire fonctionner
    curr=`qdbus org.kde.amarok trackCurrentTime`  
    tot=`qdbus org.kde.amarok trackTotalTime`
    if (( $tot )); then
        expr $curr \* 100  / $tot
    fi
    ;;

esac
le script amarok fonctionnait bien avec amarok mais plus sous amarok2 !!! Et je ne suis pas une terreur des commandes bash :hammer::hammer:

Avec la commande :
qdbus org.kde.amarok /Player org.freedesktop.MediaPlayer.GetMetadata|grep ^time:
j'arrive à récupérer la durée totale en seconde (je crois...) mais c'est tout.
Et j'ai encore rien trouve sur le net.
20 jours plus tard
Alors j'ai réussi à résoudre mon problème, en pompant à droite à gauche ( doc ubuntu surtout ) et en faisant aussi un peu fonctionner
mes méninges,
je poste du coup le resultat, même si je pense que sa peut facilement être amélioré ( le shell n'est pas ma langue maternelle :-D ) :

~/.conky/rhythmbox
#!/bin/bash

case "$1" in

# Now Playing Info
artist) rhythmbox-client --no-start --print-playing-format "%aa";;
title)  rhythmbox-client --no-start --print-playing-format "%tt";;
album)  rhythmbox-client --no-start --print-playing-format "%at";;
courant)rhythmbox-client --no-start --print-playing-format "%te/%td";;
progress)
    curr=`rhythmbox-client --no-start --print-playing-format "%te" | grep -v "Pas de lecture en cours"`
    tot=`rhythmbox-client --no-start --print-playing-format "%td" | grep -v "Pas de lecture en cours" | grep -v Inconnu`
    a=`date +'%S' | sed 's/^0\+//'`
if [ "$a" = "" ]; then
    a=0
fi
    b=$(( ($a*100) / 30 ))
    c=$(( 200-$b ))
#si pas de durée totale, augmente pendant les 30 premieres secondes puis diminu pendant les 30 suivantes...
    if [ "$tot" = "" ]; then 
    if [ $a -le 30 ]; then
       expr $b
    else
       expr $c
    fi
    else
#Si durée totale déterminée, il faut traiter le retour de la commande donnant $curr (pour courant et $tot pour total, logique) qui renvoit une donné sous la forme hh:mm:ss
    d="1"
    nbcurr=`echo $curr | wc -m`       #nbr de caractères permet de déterminer si il y a seulement m:ss ou si il y a h:mm:ss (au minimum, m:ss)
    posm=$(( $nbcurr-5 ))             #pour faire une commande cut générique, il faut définir l'endroit ou on coupe d'ou posx (position des minutes ici)
if [ $posm -lt $d ]; then
posm=``                               #Si position inférieur à 1, renvoit variable vide pour ne pas bloque cut
fi
    posm2=$(( $nbcurr-4 ))            #Forcément 1 indication minute (minimum)= pas besoin de vérifier si >1
    posh=$(( $nbcurr-8 ))             #Idem pour les heures
if [ $posh -lt $d ]; then
posh=``
fi
    posh2=$(( $nbcurr-7 ))
    currs=`echo $curr | tail -c3 | sed 's/^0\+//'` # Récupération des secondes forcément à la fin et supression du premier 0 pour ne pas avoir de problème de base (08 en hexa ou base 10)
if [ "$currs" = "" ]; then
    currs=0                          #si uniquement des zeros, ils sont tous supprimé donc redonner la valeur
fi
    currma=`echo $curr | cut -c$posm-$posm2 | sed 's/^0\+//'`
if [ "$currma" = "" ]; then
    currma=0                         #idem pour minutes
fi
    currm=$(( $currma*60 ))          #conversion en secondes
if [ $posh2 -lt $d ]; then
currh=0
else
    currha=`echo $curr | cut -c$posh-$posh2 | sed 's/^0\+//'`
if [ "$currha" = "" ]; then         #idem heures
    currha=0
fi
currh=$(( $currha*3600 ))          # conversion en secondes
fi

    currt=$(( ($currh+$currm) + $currs )) #calcule du nombre de secondes total

    nbtot=`echo $tot | wc -m`      #Même schema pour la suite mais avec la durée totale
    tposm=$(( $nbtot-5 ))
if [ $tposm -lt $d ]; then
tposm=``
fi
    tposm2=$(( $nbtot-4 ))
    tposh=$(( $nbtot-8 ))
if [ $tposh -lt $d ]; then
tposh=``
fi
    tposh2=$(( $nbtot-7 ))
    tots=`echo $tot | tail -c3 | sed 's/^0\+//'` ## OK
if [ "$tots" = "" ]; then
    tots=0
fi
    totma=`echo $tot | cut -c$tposm-$tposm2 | sed 's/^0\+//'` ## OK
if [ "$totma" = "" ]; then
    totma=0
fi
    totm=$(( $totma*60 )) ## OK
if [ $tposh2 -lt $d ]; then
toth=0
else
    totha=`echo $tot | cut -c$tposh-$tposh2 | sed 's/^0\+//'` ## OK
if [ "$totha" = "" ]; then
    totha=0
fi
toth=$(( $totha*3600 )) ## OK
fi

    tott=$(( ($toth+$totm) + $tots )) ## OK
        expr $currt \* 100  / $tott    #Et finalement expression du pourcentage accompli
    fi
    ;;
esac
le script amarok fonctionne avec amarok2
~/.conky/amarok
#!/bin/bash                     
#fetch conky amarok2 information
#by Mjheagle8                   
#requires: amarok >= 2.0, qdbus 
#[ $(pgrep amarok) ] || exit  #This just tests whether amarok is running and exits if it's not.

case "$1" in
    version)
        qdbus org.kde.amarok / Identity   # There's no point in using an echo here when the qdbus command will spit out the information itself.
        ;;                                # Also, with qdbus, it's not necessary to call the full method interface. Just 'Identity' here suffices.
    artist)                                                                                                                                       
        qdbus org.kde.amarok /Player GetMetadata | grep artist: | cut -c 9-                                                                       
        ;;                                # When you're using the cut command, it's not necessary to supply an ending position if you just want to cut to the end.
                                         title)                                                                                                                                                        
        qdbus org.kde.amarok /Player GetMetadata | grep title: | cut -c 8-                                                                                        
        ;;                                                                                                                                                        
    album)                                                                                                                                                        
        qdbus org.kde.amarok /Player GetMetadata | grep album: | cut -c 8-
        ;;
    year)
        qdbus org.kde.amarok /Player GetMetadata | grep year: | cut -c 7-
        ;;
    genre)
        qdbus org.kde.amarok /Player GetMetadata | grep genre: | cut -c 8-
        ;;
    bitrate)
        echo `qdbus org.kde.amarok /Player GetMetadata | grep audio-bitrate: | cut -c 16-`' Kb/s'
        ;;
    rating)
        qdbus org.kde.amarok /Player GetMetadata | grep rating: | cut -c 9-
        ;;
    type)
        type=`qdbus org.kde.amarok /Player GetMetadata | grep location:`
        echo ${type:(-3)}                  # Here we're using bash string manipulation to pick off the last three characters.
        ;;
    time)
        pos=$((`qdbus org.kde.amarok /Player PositionGet`/1000)) # Here we divide by 1000 without using an intermediate variable.
    time=$((`qdbus org.kde.amarok /Player GetMetadata | grep mtime: | cut -c 8-`/1000))
    currm=$((pos/60))
    currs=$((pos%60))
    totm=$((time/60))
    tots=$((time%60))
    if [ $((currm/60)) -lt 10 ]; then
        currm=`~/.conky/conversion.sh $currm`
    fi
    if [ $((currs%60)) -lt 10 ]; then
        currs=`~/.conky/conversion.sh $currs`
    fi
    if [ $((totm/60)) -lt 10 ]; then
        totm=`~/.conky/conversion.sh $totm`
    fi
    if [ $((tots%60)) -lt 10 ]; then
        tots=`~/.conky/conversion.sh $tots`
    fi
    echo $currm:$currs / $totm:$tots
    ;;
    timeperc)
        pos=$((`qdbus org.kde.amarok /Player PositionGet`/10))
        time=$(`qdbus org.kde.amarok /Player GetMetadata | grep mtime: | cut -c 8-`/1000)
        echo $((pos/time))
        ;;
    progress)
    pos=$((`qdbus org.kde.amarok /Player PositionGet`/1000)) # Here we divide by 1000 without using an intermediate variable.
    time=$((`qdbus org.kde.amarok /Player GetMetadata | grep mtime: | cut -c 8-`/1000))
    currm=$((pos/60))
    currs=$((pos%60))
    totm=$((time/60))
    tots=$((time%60))
    if [ $((currm/60)) -lt 10 ]; then
        currm=`~/.conky/conversion.sh $currm`
    fi
    if [ $((currs%60)) -lt 10 ]; then
        currs=`~/.conky/conversion.sh $currs`
    fi
    if [ $((totm/60)) -lt 10 ]; then
        totm=`~/.conky/conversion.sh $totm`
    fi
    if [ $((tots%60)) -lt 10 ]; then
        tots=`~/.conky/conversion.sh $tots`
    fi
    curr=$currm:$currs
    tot=$totm:$tots
    a=`date +'%S' | sed 's/^0\+//'`
    if [ "$a" = "" ]; then
        a=0
    fi
        b=$(( ($a*100) / 30 ))
     c=$(( 200-$b ))
    #si pas de durée totale, augmente pendant les 30 premieres secondes puis diminu pendant les 30 suivantes...
       if [ "$tot" = "" ]; then 
        if [ $a -le 30 ]; then
            expr $b
            else
            expr
        fi
    else
    #Si durée totale déterminée, il faut traiter le retour de la commande donnant $curr (pour courant et $tot pour total, logique) qui renvoit une donné sous la forme hh:mm:ss
        d="1"
        nbcurr=`echo $curr | wc -m`       #nbr de caractères permet de déterminer si il y a seulement m:ss ou si il y a h:mm:ss (au minimum, m:ss)
        posm=$(( $nbcurr-5 ))             #pour faire une commande cut générique, il faut définir l'endroit ou on coupe d'ou posx (position des minutes ici)
    if [ $posm -lt $d ]; then
    posm=``                               #Si position inférieur à 1, renvoit variable vide pour ne pas bloque cut
    fi
      posm2=$(( $nbcurr-4 ))            #Forcément 1 indication minute (minimum)= pas besoin de vérifier si >1
      posh=$(( $nbcurr-8 ))             #Idem pour les heures
    if [ $posh -lt $d ]; then
    posh=``
    fi
    posh2=$(( $nbcurr-7 ))
        currs=`echo $curr | tail -c3 | sed 's/^0\+//'` # Récupération des secondes forcément à la fin et supression du premier 0 pour ne pas avoir de problème de base (08 en hexa ou base 10)
    if [ "$currs" = "" ]; then
        currs=0                          #si uniquement des zeros, ils sont tous supprimé donc redonner la valeur
    fi
        currma=`echo $curr | cut -c$posm-$posm2 | sed 's/^0\+//'`
    if [ "$currma" = "" ]; then
        currma=0                         #idem pour minutes
    fi
    currm=$(( $currma*60 ))          #conversion en secondes
    if [ $posh2 -lt $d ]; then
        currh=0
    else
            currha=`echo $curr | cut -c$posh-$posh2 | sed 's/^0\+//'`
        if [ "$currha" = "" ]; then         #idem heures
            currha=0
        fi
        currh=$(( $currha*3600 ))          # conversion en secondes
    fi

    currt=$(( ($currh+$currm) + $currs )) #calcule du nombre de secondes total
    nbtot=`echo $tot | wc -m`      #Même schema pour la suite mais avec la durée totale
    tposm=$(( $nbtot-5 ))
    if [ $tposm -lt $d ]; then
        tposm=``
    fi
      tposm2=$(( $nbtot-4 ))
      tposh=$(( $nbtot-8 ))
    if [ $tposh -lt $d ]; then
        tposh=``
    fi
         tposh2=$(( $nbtot-7 ))
          tots=`echo $tot | tail -c3 | sed 's/^0\+//'` ## OK
    if [ "$tots" = "" ]; then
        tots=0
    fi
        totma=`echo $tot | cut -c$tposm-$tposm2 | sed 's/^0\+//'` ## OK
    if [ "$totma" = "" ]; then
        totma=0
    fi
        totm=$(( $totma*60 )) ## OK
    if [ $tposh2 -lt $d ]; then
        toth=0
    else
        totha=`echo $tot | cut -c$tposh-$tposh2 | sed 's/^0\+//'` ## OK
        if [ "$totha" = "" ]; then
                totha=0
        fi
        toth=$(( $totha*3600 )) ## OK
    fi

        tott=$(( ($toth+$totm) + $tots )) ## OK
        expr $currt \* 100  / $tott    #Et finalement expression du pourcentage accompli
    fi
    ;;
esac
conversion.sh est utilisé dans le script amarok pour caster les durées toujours au même format (mm:ss)
~/.conky/conversion.sh
#!/bin/bash

case "$1" in

0) printf "%02.f\n" "0";;
1) printf "%02.f\n" "1";;
2) printf "%02.f\n" "2";;
3) printf "%02.f\n" "3";;
4) printf "%02.f\n" "4";;
5) printf "%02.f\n" "5";;
6) printf "%02.f\n" "6";;
7) printf "%02.f\n" "7";;
8) printf "%02.f\n" "8";;
9) printf "%02.f\n" "9";;

esac
.conkyrc2
${if_running rhythmbox}
${color3}${font DIST Yolks Emoticons:size=25} L  ${font SVBasicManual:style=Bold:size=16}Rhythmbox
${font Sans:style=Bold:pixelsize=10}${color2}Artiste : ${color1}${execi 1 ~/.conky/rhythmbox artist}
${color2}Titre : ${color1}${execi 1 ~/.conky/rhythmbox title}
${color2}Album : ${color1}${execi 1 ~/.conky/rhythmbox album}
${color2}Durée : ${color1}${execibar 1 $HOME/.conky/rhythmbox progress}
${alignr}${color1}${execi 1 ~/.conky/rhythmbox courant}$endif
${if_running amarok}${color #F0C300}${font DIST Yolks Emoticons:size=25} L  ${font SVBasicManual:style=Bold:size=16}Amarok
${font Sans:style=Bold:pixelsize=10}${color2}Artiste : ${color1}${execi 1 ~/.conky/amarok artist}
${color2}Titre : ${color1}${execi 1 ~/.conky/amarok title}
${color2}Album : ${color1}${execi 1 ~/.conky/amarok album}
${color2}Bitrate : ${color1}${execi 1 ~/.conky/amarok bitrate}
${color2}Durée : ${color1}${execibar 1 $HOME/.conky/amarok progress}
${color2}${alignr}${color1}${execi 1 ~/.conky/amarok time}
$endif
Ainsi suivant que je lance amarok2 ou rhythmbox les scripts respectifs se lancent :pint:
une petite image est toujours plus explicite...


P.S : désolé pour la tartine ( je poste pas souvent mais quand j'y vais je me fais plaisir :-D)
7 jours plus tard
Salut à tous!!
je sais pas si y aura l'image, c'est la premiere fois que je fais ça...je vous montre pas mon script, c'est un vrai torchon...mais je dois l'arranger encore
winix wrote:Salut à tous!!
je sais pas si y aura l'image, c'est la premiere fois que je fais ça...je vous montre pas mon script, c'est un vrai torchon...mais je dois l'arranger encore
http://forums.fedora/url-Capture.png
Quelqu'un pourrai me dire comment on fait pour mettre une pitite image :-D
winix wrote:Quelqu'un pourrai me dire comment on fait pour mettre une pitite image :-D
Oui, c'est assez simple. Il faut que tu héberge l'image quelque part sur Internet.
Ensuite, tu utilises la balise [ img ] dans le texte du message pour l'afficher.
Voila, je fais un essai


Aaaaah aprés trois aissé j'y suis arrivé,:-D
2 mois plus tard
bon voila le mien, je debute ^^
mon bureau
J'ai mis un fond d'ecran dynamique qui evolue selon l'heure de la journée,
Vous en pensez quoi?
c'est u bon début, il y a longtemps que je ne me suis pas repenché sur les évolutions des script..
merci, je suis sous gnome
un mois plus tard
Popov wrote:bon voila le mien, je debute ^^
mon bureau
J'ai mis un fond d'ecran dynamique qui evolue selon l'heure de la journée,
Vous en pensez quoi?
J'avais pas remarqué, tu as le même Uptime Max que moi :hammer:
Je l'avais ajouté à la mano par fierté de mon score :lol:
Malheureusement je n'ai pas trouvé de commande qui puisse indiquer l'uptime maximum d'une machine :roll:

Je pense qu'il faudrait un processus daemon qui inscrive constamment dans un fichier texte l'uptime en cours. (après à savoir si ça pomperait des ressources d'inscrire constamment...ou alors toutes les minutes via crontab.)
Puis on ferait un appel de ce fichier dans conky.

À chaque démarrage on ferait une comparaison de l'uptime inscrit avec l'uptime en cours. (et cette comparaison serait elle aussi effectué à intervalle régulier). Lorsque l'uptime en cours devient supérieur à l'uptime qui était inscrit, l'écriture dans le fichier recommence.

Ça demande quand même un peu de boulot de faire ça ^^
Kenshin: il doit suffire d'enregistrer ton uptime dans un fichier à chaque arrêt de la machine, s'il est supérieur à l'uptime max précédent.
Le truc, c'est que c'est pas à chaque démarrage, mais a chaque extinction :

Pour avoir l'uptime :
uptime | cut -f 4 -d " "
Comparaison ensuite avec un uptime maximum (tu peux garder une variable UPTIME_MAX que tu exports à chaque démarrage avec la valeur max, que tu gardes à chaque extinction)
Ou alors tu laisse tourner le script et tu exportes cet UPTIME_MAX à ce moment, mais bon je vois pas trop l'interet de la chose.

Moi je ferai ça (meme si c'est vraiment du snobisme ^^) un fichier uptime_max (plutot qu'une variable shell)
echo '0' > ~/uptime_max

...
a = `uptime | cut -f 4 -d " "`
b = `cat ~/uptime_max`
if [[ $a > $b ]]
then echo $a > ~/uptime_max
fi
Et tu récupére ainsi cette valeur pour ton uptime max

Et si par exemple tu utilises fluxbox, tu change un petit truc dans ton menu pour le "exit" :
[exec] (Exit) {/home/user/Documents/logout.sh} </usr/share/pixmaps/glade-2.png>
Avec pour logout.sh
#!/bin/sh
/home/user/Documents/uptime_seek.sh

if  zenity --question --title "Alert" --text "T'es sur mec, tu veux quitter?!"; then
        kill -TERM $(xprop -root _BLACKBOX_PID | awk '{print $3}')
fi
Et voila voila, maintenant c'est fait (pour fluxbox)

EDIT : Grilled
C'est surtout aux problèmes des coupures de courant que je réfléchissais...:lol:
a = `uptime | cut -f 4 -d " "`
if orage_sur_la_tronche == 1
then echo $a > ~/uptime_max
fi
Ah non, marche pas :hammer:
Bah justement c'est ce que je dis pour le laisser tourner le script.
tu fais genre un
while true;do
sleep [i]un certain temps[/i] <- faut pas non plus tout le temps le faire tourner

[i]le code[/i]
Et comme c'est que les jours qui compte, tu peux faire un gros sleep, ca va pas tout le temps changer.
Merci pour tout ce beau code Randy 🙂

Le seul hic, c'est que je cherche à avoir un uptime max le plus proche du "vrai".
Qu'en cas de coupure inattendue, l'uptime max inscrit soit valable à la minute près de l'uptime réellement réalisé 😉
(Parce qu'à la seconde près, c'est vraiment...trop près :-P)

Si j'ai le temps je ferai un test, pour savoir déjà comment ça fonctionnera, et les ressources que ça prendra.
(Se servir de cron pourra sans doute être utile pour avoir un résultat proche du vrai)
Bah si tu veux un uptime à la minute, tu fais un sleep à la minute 😉
Enfin je ne pense pas que de toute manière tu dépasse un uptime de 53 jours pour un ordinateur desktop (qui aura donc Conky)