#!/bin/bash
"""
Type: Nautilus Script
Title: Info
Version: 1.3
Info: quelques informations importantes sur le système.
      some important information about the system.
Author: © Copyright (C) 2012, Airelle - http://rlwpx.free.fr/WPFF/nautilus.htm
Original language: french
Translations:
- to english: Airelle - http://rlwpx.free.fr/WPFF/nautilus.htm
License: GNU General Public License, version 3 or later - http://www.gnu.org/licenses/gpl.html
Usage : copier ce fichier dans le répertoire des scripts Nautilus de votre dossier personnel (~/.gnome2/nautilus-scripts/)
        et vérifier que le script est exécutable (x). Le paquet zenity doit être installé.
        copy this file to the directory of Nautilus-scripts of your home (~/.gnome2/nautilus-scripts/)
        and be sure that the script is executable (x). Package zenity must be installed.
"""
sep='-------------------------------------------------------------------'

# Messages
case $LANG in
 en* )
  msg_titre='System Information'
  msg_0='Operating system & Kernel'
  msg_1='Architecture'
  msg_2='Processors'
  msg_3='Memory'
  msg_4='Network'
  msg_5='Host name: '
  msg_6='Video'
  msg_7='Audio'
  msg_8='Disks'
  msg_9="Battery"
  ;;
 * )
  msg_titre="Informations système"
  msg_0="Système d'exploitation et noyau"
  msg_1="Architecture"
  msg_2="Processeurs"
  msg_3="Mémoire"
  msg_4="Réseau"
  msg_5="Nom d'hôte : "
  msg_6="Vidéo"
  msg_7="Audio"
  msg_8="Disques"
  msg_9="Batterie"
 ;;
esac

# Analyse
 iv=`lsb_release -d | sed 's/^.*://' | sed 's/^[ \t]*//'`
 iv2=`cat /proc/version_signature`
 iv3=`cat /proc/version`
 iv5=`lscpu | grep bit`
 iv6=`uname -m`
 ip=`cat /proc/cpuinfo | grep name | sed 's/^.*://' | sed 's/^[ \t]*//'`
 im=`cat /proc/meminfo | grep MemTotal`
 iv4=`hostname`
 iip=`ifconfig | grep -i "Bcast" | sed 's/^[ \t]*//'`
 in=`lspci | grep -i Modem | sed 's/^.*://' | sed 's/^[ \t]*//'`
 in2=`lspci | grep -i Ethernet | sed 's/^.*://' | sed 's/^[ \t]*//'`
 in3=`lspci | grep -i Wireless | sed 's/^.*://' | sed 's/^[ \t]*//'`
 ig=`lspci | grep VGA | sed 's/^.*://' | sed 's/^[ \t]*//'`
 ir=`xrandr -q | grep -w Screen`
 ir2=`xdpyinfo | grep -i resolution | sed 's/^[ \t]*//'`
 ia=`lspci | grep -i audio | sed 's/^.*://' | sed 's/^[ \t]*//'`
 id=`df -T -x tmpfs -x devtmpfs -h`
 id2=`lsblk`
 ib=`acpi -V|grep -i capa`
 ib2=`acpi -V|grep -i charg`

# Rapport
zenity --info --title="${msg_titre}" --text="$sep $msg_0\n$iv ($iv2)\n$iv3
$sep $msg_1\n$iv6\n$iv5
$sep $msg_2\n$ip
$sep $msg_3\n$im
$sep $msg_4\n$msg_5 $iv4\n$iip\n$in\n$in2\n$in3
$sep $msg_6\n$ig\n$ir\n$ir2
$sep $msg_7\n$ia
$sep $msg_8\n$id\n$id2
$sep $msg_9\n$ib\n$ib2"

# EOF


