Voici quelques scripts conky à modifier à votre goût
Hexchat -- Périphériques connectés sur le réseau -- Info sur le réseau interne
----------- hexchat (4 scripts)--------------
1) Ce script va vérifier si Hexchat est en cours d'utilisation, si oui il va exécuter 'conky -c ~/.Conky/.conky-chat &' et de plus quand hexchat se ferme il "kill" xchat-conky.
À mettre dans votre script de lancement de conky
~/.Conky/.scripts/xchat-conky.sh &
Code : Tout sélectionner
#!/bin/sh -v
if [ "$1" = "-k" ]; then
NAME=`basename $0`
killall $NAME conky
exit
fi
if [ "$1" != "-b" ]; then
$0 -b > /dev/null &
exit
fi
while :
do
XCHAT_PID=`pidof hexchat`
if [ "$(pidof hexchat)" ] && ! [ "$(ps $XCHAT_PID |grep -i \<defunct\>)" ]; then
if [ -z $CONKY_PID ] || ! ps $CONKY_PID || ps $CONKY_PID |grep -i \<defunct\>; then
sleep 2
conky -c ~/.Conky/.conky-chat &
CONKY_PID=$!
fi
else
if [ -n "$CONKY_PID" ]; then
kill $CONKY_PID
CONKY_PID=""
fi
fi
sleep 1
done
2) irc-prettifier.awk installer dans => .Conky/.scripts/
Code : Tout sélectionner
#!/usr/bin/awk -f
# Copyright (c) 2013 Wolf480pl (wolf480@interia.pl)
# irc-prettifier.awk
# Prettifies XChat scrollback from standard input.
# Use -v variable=value argument to set the variables, eg: -v limit=80 notime=yes
# Variables: limit - line length limit (-1 for no limit), sep - nick/message separator, notime - `yes' or `true' to hide timestamps
BEGIN{
# Line length limit
if (limit == "") limit = -1
# Nick/message separator
if (sep == "") sep = "│ "
}
{
# Get rid of 0x08 and 0x0F characters
gsub(/[\x02\x08\x0F]/, "");
# Get rid of colorcodes
gsub(/\x03[0-9]*/,"");
# Match timestamps
match($0, /T ([0-9]*)(([^\t]*\t)?)/, a);
# Replace tabs with nick/message separators
gsub(/\t/,sep);
# Parse timestamps
if (notime !~ /(yes)|(true)/) time = strftime("%H:%M:%S", substr($0, a[1, "start"], a[1, "length"]));
# Join the line together
line = time sprintf("%15s", substr($0, a[2, "start"], a[2, "length"])) substr($0, a[2, "start"] + a[2, "length"]);
# Print trimmed line if limit is set
if (limit >= 0) print substr(line, 0, limit )
# Or print not-trimmed line if the limit is not set
else print line;
}
3) xchat-get-topic.sh installer dans => .Conky/.scripts/
Code : Tout sélectionner
#!/bin/sh
# Copyright (c) 2013 Wolf480pl (wolf480@interia.pl)
# xchat-get-topic.sh
# le topic du canal de HexChat via DBus et imprime sur la sortie standard
# Syntax: xchat-get-topic.sh <network> <channel> <length limit>
# Find the context connected with specified network and channel
context=`dbus-send --dest=org.hexchat.service --print-reply --type=method_call /org/xhexchat/Remote org.hexchat.plugin.FindContext string:"$1" string:"$2" | tail -n1 | awk '{print $2}'`
# Set the context to the context found in previous line
dbus-send --dest=org.hexchat.service --type=method_call /org/hexchat/Remote org.hexchat.plugin.SetContext uint32:$context
# Get the channel topic
dbus-send --dest=org.hexchat.service --print-reply --type=method_call /org/hexchat/Remote org.hexchat.plugin.GetInfo string:"topic" | awk -v limit=$3 '{if ($0~/string/) {$1=""; match($0, /\"(.*)\"/, a); printf substr(substr($0, a[1, "start"], a[1, "length"]),0,limit ("prefix_out" int((NR+4)/5)))}}'
4) .conky-chat installer dans => .Conky/
Code : Tout sélectionner
color1 DDDDDD # Gris
color2 006FC0 # Bleu
color3 8AD749 # Vert
color4 EECE01 # Jaune
color5 F8981F # Orange
color6 F80E27 # Rouge
TEXT
# Get the channel topic from HexChat, network "freemod", channel #FFLM, length limit: 110 chars. Use backshash before channel name to escape comment char (#)
### Display a nice table header with channel name. Use backshash before channel name to escape comment char (#)
${color5}=================== ${color3}FREENOD ${color5}=========== ${color3}\#FFLM ${color5}========================= ${color1}
${exec tail ~/.config/hexchat/scrollback/freenode/#fflm.txt | ~/.Conky/.scripts/irc-prettifier.awk -v limit=100 sep="│ "}
${color5}=================== ${color3}FREENOD${color5} =========== ${color3}\#debian-facile ${color5}==================== ${color1}
${exec tail ~/.config/hexchat/scrollback/freenode/#debian-facile.txt | ~/.Conky/.scripts/irc-prettifier.awk -v limit=100 sep="│ "}
${color5}==================== ${color3}FREENOD ${color5} =========== ${color3}\#ubuntu-fr ${color5}====================== ${color1}
${exec tail ~/.config/hexchat/scrollback/freenode/#ubuntu-fr.txt | ~/.Conky/.scripts/irc-prettifier.awk -v limit=100 sep="│ "}
Information sur votre connexion
1) .conky-ip installer dans => .Conky/
Code : Tout sélectionner
Information cartes réseaux
${execpi 50 ~/.Conky/.scripts/ip.sh}
${if_up tun0}${color green}Connexion sécurisée -- Vpn activé --${else}${color 8AD749}${blink Connexion non sécurisée}${endif}${color}
2) ip.sh installer dans => .Conky/scripts/
Code : Tout sélectionner
#!/bin/bash
read COUNTRY COUNTRYCODE <<< $(wget -qO- http://ip-api.com/line/?fields=city,countryCode,country,city,);
echo "\${color5}"Pays :""\${color6} "$COUNTRY ($COUNTRYCODE)";
read CITY <<< $(wget -qO- http://ip-api.com/line/?fields=city,);
echo "\${color5}""Villes : "\${color6}"$CITY";
read REGIONNAME <<< $(wget -qO- http://ip-api.com/line/?fields=regionName,);
echo "\${color5}""Region : "\${color6}"$REGIONNAME ";
read COUNTRYCODE COUNTRY IP <<< $(wget -qO- http://ip-api.com/line/?fields=countryCode,country,query,);
echo "\${color5}""IP : "\${color6}"$IP ";
read ISP <<< $(wget -qO- http://ip-api.com/line/?fields=isp,);
echo "\${color5}""Organisation : "\${color6}"$ISP ""\${color5}";
echo "\${color5}""DNS : "\${color6}"\${nameserver}""\${color5}";
#-------------------- Interface reseaux utiliser ------------------------
echo "\${color2}""Interface Réseaux : "\${color1}"\${gw_iface}""\${color2}";
echo "\${color2}""Ip locale : "\${color1}"\${addr}""\${color2}";
echo "\${color2}""Passerelle : "\${color1}"\${gw_ip}""\${color2}";
Information sur votre reseau local
Attention il faut installer nmap sur votre distribution
il va être un peu lent à s’afficher, le temps du scan qu'il doit faire.
1) .conky-nmap installer dans => .Conky/
Code : Tout sélectionner
TEXT
${color1}${font :size=7}Périphériques connectées sur le reseaux${font}${color}
${color4}${hr}${color}
${execi 100 ~/.Conky/.scripts/nmap.pl eth0}
2) nmap.pl installer dans => .Conky/.scripts/
Modifier ligne 16 '$adapter ="eth0" ' selon votre type de connection
Code : Tout sélectionner
#!/usr/bin/perl
################
######## NMAP SCRIPT
##author: iltiscat
#mail: schmiddim@gmx.at
#web: http://schmiddi.co.cc
#date: 02.10.09
#desc: a small script for conky lists all ip's in your subnet.
#use: write ${execi 100 ~/.conky/nmap.pl wlan0} in your ~/.conkyrc
# 100 means the refresh intervall in seconds.
# you can assign a interface with the argument. Without,
# the subnet of eth0 will be analyzed. HF:)
$adapter= @ARGV[0];
if (@ARGV[0] eq""){
$adapter ="eth0";
}#fi
#get my ip
$string = `ifconfig $adapter`;
$string =~m/([0-9]+\.){3}[0-9]+/g;
$myip=$&;
#connected?
$status= system ("ping -c 1 $myip -t 2 >/dev/null");
if ($status != 0) {
print "not connected to a network :-(\n";
exit (-1); #no network connection
}
#get the subnet
$str= $myip;
while($myip =~ m/\w\.\b/g) {$lastpos= pos($myip), " " };
$subnet = substr($myip,0, $lastpos-1);
$subnet= "$subnet.1-253\n";
#parse the nmap result
$retval = `nmap -sP $subnet`;
$ctr=0;
$_=$retval;
while (/([0-9]+\.){3}[0-9]+/g) {
if ($ctr%2 == 0) {
print "$&\t";
}else{
print "$&\n";
}#fi
$ctr++;
}
if ($ctr%2 ==0) {
print "";
}else{
print"\n";
}
print "$ctr Connection(s)\n";
Et voilà pour l’instant.