Home Forums Wiki Doc Install Extras Screenshots IRC Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock Wiki Doncky setups
The latest stable release is the *3.2.1* : How to install it here.
Information : The version displayed on this page is not the latest available.
History View code

Glx-Dock / Cairo-Dock

Home

History

Language

fr Français

Support Us

Flattr this

Cairo-Dockon

Doncky setups

Cette page est en cours d'edition.

Pourquoi une page specifique Doncky ?

C'est un de mes fantasmes et j'espere en amenant des curieux ici de pouvoir influencer le developpement afin que cet applet soit remis au gout du jour.

Je pense sincerement que cet applet est le futur de cairo-dock. En permettant a tous les applets d'etres configurables via un fichier .xml, on aura acces a de nouveaux themes ainsi que de nouvelles contributions. Le succes de conky et de ces nombreux themes sur le net en sont la preuve.
Le developpement sera aussi liberer de la forme des applets et pourra ainsi se focaliser sur le fond.

Tous les applets externes pourraient ainsi avoir des themes parce qu'a ce jour ils sont tres limites lorsqu'ils sont places hors du dock.

Exemple de base d'un fichier de configuration de Doncky
<doncky>
    <br>8</br>
    <alignW>center</alignW>
    <font>A bite 24</font>
    <color>255;255;255;255</color>
    <txt>Network </txt>
    <br>1</br>
    <alignW>left</alignW>
    <font>UnDotum Bold 10</font>
    <color>0;0;0;255</color>
    <txt>Ip adress :</txt>
    <font>UnDotum Bold 9</font>
    <color>0;0;0;255</color>
    <cmd>
        <bash>/yourlocation/script.sh</bash>
        <refresh>800</refresh>
</cmd>
</doncky>


Les scripts

Des scripts pour afficher des infos avec doncky.

N'oubliez pas de rendre les scripts executable

Afficher sa release

#!/usr/bin/perl

use strict;
use warnings;

my $a = `lsb_release -d`;
my $b = `lsb_release -c`;

$a =~ s/\n//g;
$a =~ s/\t//g;
$b =~ s/\n//g;
$b =~ s/\t//g;
$a =~ s/.*Description://g;
$b =~ s/.*Codename://g;
print $a." ( ".$b." )\n";


Afficher le nom du compte connecté
#!/usr/bin/perl

use strict;
use warnings;

print $ENV{USER}."\n";


Afficher le Load Average
#!/usr/bin/perl

use strict;
use warnings;

my $loadavg = `uptime`;

$loadavg =~ s/.*load\saverage:\s(.*)\n$/$1/;
print $loadavg."\n";


Afficher son IP addresse externe
version bash :
#!/bin/bash

# voir ip derriere routeur

wget http://checkip.dyndns.org/ -O - -o /dev/null | cut -d: -f 2 | cut -d\< -f 1 > ip
cat ip

version perl :
#!/usr/bin/perl

use strict;
use warnings;

my $a = `dig +short myip.opendns.com \@resolver1.opendns.com`;

$a =~ s/\n//g;
print $a."\n";


Afficher son ip locale

#!/usr/bin/perl

use strict;
use warnings;

my $wifi = `ifconfig wlan0`;
my $ethernet = `ifconfig eth0`;

if ( $wifi =~ /.*inet\sadr.*/ ) {
$wifi = `ifconfig wlan0 | grep "inet adr"`;
$wifi =~ s/.*inet\sadr://g;
$wifi =~ s/Bcast:.*//g;
$wifi =~ s/\s//g;
print $wifi."\n";
} elsif ( $ethernet =~ /.*inet\sadr.*/ ) {
$ethernet = `ifconfig eth0 | grep "inet adr"`;
$ethernet =~ s/.*inet\sadr://g;
$ethernet =~ s/Bcast:.*//g;
$ethernet =~ s/\s//g;
print $ethernet."\n";
} else {
print "NA\n";
}


Afficher son ip locale

#!/usr/bin/perl

use strict;
use warnings;

my $wifi = `ifconfig wlan0`;
my $ethernet = `ifconfig eth0`;

if ( $wifi =~ /.*inet\sadr.*/ ) {
print "Wifi\n";
} elsif ( $ethernet =~ /.*inet\sadr.*/ ) {
print "Ethernet\n";
} else {
print "NA\n";
}


Température

Cpu

#!/usr/bin/perl

use strict;
use warnings;

my $a = `acpi -t`;

$a =~ s/.*,//g;
$a =~ s/\n//g;
$a =~ s/degrees\sC//g;
$a =~ s/\s//g;
print $a."\n";


Gpu

#!/usr/bin/perl

use strict;
use warnings;

my $a = `nvidia-settings -q gpucoretemp | grep Attribute`;

$a =~ s/.*://g;
$a =~ s/\n//g;
$a =~ s/\s//g;
$a =~ s/\.//g;
print $a.".0\n";


Résolution d'écran

#!/usr/bin/perl

use strict;
use warnings;

my $a = `xrandr -q | grep Screen`;

$a =~ s/\n//g;
$a =~ s/.*current\s//g;
$a =~ s/,\smaximum.*//g;
print $a."\n";


Afficher la version du driver Nvidia propriétaire
#!/usr/bin/perl

use strict;
use warnings;

my $a = `nvidia-smi -q | grep Driver | grep Version`;

$a =~ s/\n//g;
$a =~ s/.*://g;
$a =~ s/\s//g;
print $a."\n";


Obtenir une image satellite de son pays

Informations

pour le moment, les pays sont :
-fr pour france
-de pour allemagne
-en pour angleterre
-es pour espagne
-it pour italie
-pt pour portugal ( image identique à l'es )
-ca pour quebec
-usnw pour US North West
-usnc pour US North Central
-usne pour US North East
-uscw pour US Central West
-uscc pour US Central Central
-usce pour US Central East
-ussw pour US South West
-ussc pour US South Central
-usse pour US South East
( sans le - )

Code

perl <nom_du_programme.pl> <pays> <largeur> <hauteur>


( necessite d'avoir convert d'ImageMagick d'installé )
#!/usr/bin/perl

use strict;
use warnings;
use FindBin;

my $dir = $FindBin::Bin;

if ( !defined($ARGV[0]) or !defined($ARGV[1]) or !defined($ARGV[2]) ) {
    print "perl imgsat.pl fr|en|de|es|pt|it|ca|usnw|uscw|ussw|usnc|uscc|ussc|usne|usce|usse largeur hauteur\n";
    exit;
}

if ( ! -d $dir."/img/" ) { `mkdir $dir/img/`; }
if ( ! -d $dir."/img/sat/" ) { `mkdir $dir/img/sat/`; }

if ( ($ARGV[0] eq "fr") or ($ARGV[0] eq "en") or ($ARGV[0] eq "de") or ($ARGV[0] eq "es") or ($ARGV[0] eq "pt") or ($ARGV[0] eq "it") ) {
    `cd $dir/img/sat/ && wget -m -nd http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_VIS006EColor-westernEurope.jpg`;
    `cp $dir/img/sat/EUMETSAT_MSG_VIS006EColor-westernEurope.jpg $dir/img/sat/imagesattmp.jpg`;
} elsif ( ($ARGV[0] eq "usnw") or ($ARGV[0] eq "ussw") or ($ARGV[0] eq "usne") or ($ARGV[0] eq "uscw") or ($ARGV[0] eq "uscc") or ($ARGV[0] eq "usce") or ($ARGV[0] eq "usnc") or ($ARGV[0] eq "ussc") or ($ARGV[0] eq "usse") ) {
    `cd $dir/img/sat/ && wget --no-check-certificate -m -nd https://www.nrlmry.navy.mil/focus_public/CONUS/focus_regions/Full/Overview/vis_ir_background/goes/CURRENT.jpg`;
    `cp $dir/img/sat/CURRENT.jpg $dir/img/sat/imagesattmp.jpg`;
} elsif ( $ARGV[0] eq "ca" ) {
    `cd $dir/img/sat/ && wget -m -nd http://www.meteo.gc.ca/data/satellite/goes_ecan_vvi_100.jpg`;
    `cp $dir/img/sat/goes_ecan_vvi_100.jpg $dir/img/sat/imagesattmp.jpg`;
} else {
    print "perl imgsat.pl fr|en|de|es|pt|it|ca|usnw|uscw|ussw|usnc|uscc|ussc|usne|usce|usse largeur hauteur\n";
    exit;
}

my ($up,$down);

if ( $ARGV[0] eq "fr" ) {
    $up = "617x432+260+100";
    $down = "357x332-107-177";
} elsif ( $ARGV[0] eq "en" ) {
    $up = "617x432+205+45";
    $down = "357x332-107-177";
} elsif ( $ARGV[0] eq "de" ) {
    $up = "617x432+342+55";
    $down = "357x332-107-177";
} elsif ( $ARGV[0] eq "es" ) {
    $up = "617x432+182+185";
    $down = "357x332-107-177";
} elsif ( $ARGV[0] eq "pt" ) {
    $up = "617x432+182+185";
    $down = "357x332-107-177";
} elsif ( $ARGV[0] eq "it" ) {
    $up = "617x432+367+160";
    $down = "357x332-107-177";
} elsif ( $ARGV[0] eq "ca" ) {
     $up = "1024x1024+409+214";
    $down = "615x810-140-500";
} elsif ( $ARGV[0] eq "usnw" ) {
    $up = "1300x800+210+88";
    $down = "1090x712-746-499";
} elsif ( $ARGV[0] eq "uscw" ) {
    $up = "1300x800+210+301";
    $down = "1090x499-746-286";
} elsif ( $ARGV[0] eq "ussw" ) {
    $up = "1300x800+210+514";
     $down = "1090x286-746-73";
} elsif ( $ARGV[0] eq "usnc" ) {
    $up = "1300x800+554+88";
    $down = "746x712-402-499";
} elsif ( $ARGV[0] eq "uscc" ) {
    $up = "1300x800+554+301";
     $down = "746x499-402-286";
} elsif ( $ARGV[0] eq "ussc" ) {
    $up = "1300x800+554+514";
     $down = "746x286-402-73";
} elsif ( $ARGV[0] eq "usne" ) {
    $up = "1300x800+898+88";
    $down = "402x712-58-499";
} elsif ( $ARGV[0] eq "usce" ) {
    $up = "1300x800+898+301";
    $down = "402x499-58-286";
} elsif ( $ARGV[0] eq "usse" ) {
    $up = "1300x800+898+514";
    $down = "402x286-58-73";
}
`cd $dir/img/sat/ && convert imagesattmp.jpg -crop $up imagesattmp.jpg`;
`cd $dir/img/sat/ && convert imagesattmp.jpg -crop $down image.jpg`;
`cd $dir/img/sat/ && convert image.jpg -resize $ARGV[1]x$ARGV[2]\! image.jpg`;
`cd $dir/img/sat/ && rm -rf imagesattmp.jpg`;


Images
Europe ( dimension 250/155 ) :
http://uppix.net/a/e/6/25dff08a8fd2e037d6a4083ca85e9.jpg http://uppix.net/f/0/f/cf774705491e14c5ce8b0bc52bddb.jpg http://uppix.net/7/4/a/c87a8cd44892150e550a32f833bad.jpg
http://uppix.net/f/6/1/168690715797cf507b97a83990b7f.jpg http://uppix.net/c/3/3/1dfab0060eb5343cfd4d3691402a8.jpg

Quebec ( dimension 475/310 ) :
http://uppix.net/6/d/9/c218a99b5e8858624f8a683d7bc83.jpg

U.S.A ( dimension 344/213 ) :
http://uppix.net/4/5/b/cb5548352a87db87545f80b00a00b.jpg http://uppix.net/0/c/d/8326fc6be76c087eb8ecf9a921242.jpg http://uppix.net/5/b/0/a5d304ae0bce7d7b8dce08bd1f992.jpg
http://uppix.net/2/5/d/f09b8dcde124c7d88335a69dd5670.jpg http://uppix.net/5/5/f/4a4e4a5997c9d6673dc6aff611322.jpg http://uppix.net/a/9/6/bcb8206d5a2c21b9cb3cbe7f036a8.jpg
http://uppix.net/1/1/c/ccb7a90bab488834d91fd58628009.jpg http://uppix.net/4/1/a/0d9d2d869649db7c37ebc47413cd7.jpg http://uppix.net/2/3/d/1ce5fe6dc2095222ae8442a4a749d.jpg


Phases de la lune

Necessite Astro::MoonPhase disponible sur CPAN


le lien de téléchargement contient aussi les images a afficher.
#!/usr/bin/perl

use strict;
use warnings;
use Astro::MoonPhase;
use FindBin;

my $dir = $FindBin::Bin;

my (undef,$moonillu,undef,undef,undef,undef,undef) = phase(time);

$moonillu = int($moonillu*100);

$dir = $dir."/img/moon";
my $file = $moonillu.".png";
`rm -rf $dir/moon.png && cp -r $dir/$file $dir/moon.png`;


Afficher des VDM

permet d'afficher aléatoirement une VDM de viedemerde.fr
perl <nom_du_script.pl> <longueur du texte>

longueur du texte doit correspondre au nombre de caracteres maximum avant d'aller automatiquement à la ligne.

#!/usr/bin/perl

use strict;
use warnings;

my $vdm_choisi;
my @vdm;

if (!defined($ARGV[0])) {
    print "[Cairo-Dock][vdm applet] no option defined\nNeed lenght cut in option\n";
    exit;
}
sub getvdm {
    my $vdm_link = "http://www.viedemerde.fr/data/fr/fortunes";

    my $dl = `curl -s --user-agent "Mozilla/5.0" $vdm_link`;
    my $phrase = "";
    foreach my $a (split(/\n/,$dl)) {
        if ( $a =~ /^Aujourd.*VDM$/ ) {
            $phrase = $phrase."\n".$a;        
        }
    }

    $phrase =~ s/^\n//g;
    @vdm = split(/\n/,$phrase);
}

sub choosevdm {$vdm_choisi = $vdm[int(rand(@vdm))]; }
sub vdm_get {

    &getvdm;

    &choosevdm;

    if ( $vdm_choisi eq "" ) { &choosevdm; }

    my @vdm_choisi_split = split(/\s/,$vdm_choisi);
    my $phrase_final = "";
    my $tmp = "";

    foreach my $a (@vdm_choisi_split) {
        $tmp = $tmp." ".$a;
        if ( length($tmp) >= $ARGV[0] ) {
            $tmp =~ s/^\s//g;
            $phrase_final = $phrase_final."\n".$tmp;
            $tmp = "";
        }
    }
    $tmp =~ s/^\s//g;
    $phrase_final = $phrase_final."\n".$tmp;
    $phrase_final =~ s/^\n//g;
    $phrase_final =~ s/^\s//g;
    $phrase_final =~ s/\"/\"/g;
    $phrase_final = $phrase_final."\n";

    return $phrase_final;
}

my $vdm_final = &vdm_get;
print $vdm_final;


Je mets un peu a jour mes recherches et mes scripts pour les sauvegarder afin que d'autres puissent aussi avoir un peu de doncky power sur leur ordi (taiebot65)
divers scripts crées par ours_en_pluche


Glx-Dock / Cairo-Dock Wiki Doncky setups Haut de page

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2012 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence.
Many thanks to TuxFamily for the web Hosting