snippets / zenity

All snippets tagged zenity (2)

  1. zsha1sum (Hash sha1sum d'un fichier avec sortie Zenity)

    Idéal couplé à Nautilus Actions. Requiers Zenity

     1 #!/bin/bash
    2 ###############################################################################
    3 #
    4 # zsha1sum :
    5 # Scripts permettant d'utiliser SHA1Sum avec une sortie dans Zenity.
    6 #
    7 # by Guillaume Kulakowski a.k.a LLaumgui <guillaume at llaumgui dot com>
    8 # Version 1.0
    9 #
    10 ###############################################################################
    11 # This program is free software; you can redistribute it and/or
    12 # modify it under the terms of the GNU General Public License
    13 # as published by the Free Software Foundation; either version 2
    14 # of the License, or (at your option) any later version.
    15 #
    16 # This program is distributed in the hope that it will be useful,
    17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    19 # GNU General Public License for more details.
    20 #
    21 # You should have received a copy of the GNU General Public License
    22 # along with this program; if not,
    23 # - write to the Free Software
    24 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    25 # - See http://www.gnu.org/licenses/gpl.html
    26 ###############################################################################
    27
    28 if [ $# = 0 ]; then
    29 zenity --info \
    30 --width=600 \
    31 --title="Usage incorrect de gSHA1Sum !" \
    32 --text="L'usage correct est :
    33 gSHA1Sum &#60;fichier&#62;";
    34 exit
    35 fi
    36
    37
    38 action=`sha1sum $1`
    39 zenity --info \
    40 --title=SHA1SUM \
    41 --no-wrap \
    42 --text="SHA1Sum du fichier $1:\n
    43 $action"
    Posted by llaumgui to shell zenity sha1sum gpl ... saved by 1 person ... 0 comments ... 1 year, 2 months
  2. convert2flv (Convert avi to flv)

    Need : - zenity - ffmpeg

      1 #!/bin/bash
    2 ###############################################################################
    3 #
    4 # convert2flv :
    5 # Convert avi to flv.
    6 # Need :
    7 # - zenity
    8 # - ffmpeg
    9 #
    10 # by Guillaume Kulakowski a.k.a LLaumgui <guillaume at llaumgui dot com>
    11 # Version 1.0^M
    12 #
    13 ###############################################################################
    14 # This program is free software; you can redistribute it and/or
    15 # modify it under the terms of the GNU General Public License
    16 # as published by the Free Software Foundation; either version 2
    17 # of the License, or (at your option) any later version.
    18 #
    19 # This program is distributed in the hope that it will be useful,
    20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    22 # GNU General Public License for more details.
    23 #
    24 # You should have received a copy of the GNU General Public License
    25 # along with this program; if not,
    26 # - write to the Free Software
    27 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
    28 # - See http://www.gnu.org/licenses/gpl.html^M
    29 ###############################################################################
    30
    31
    32 ###############################################################################
    33 # Variables :
    34 #
    35 OPT_AR=22050
    36 OPT_AB=32
    37 OPT_S="320X240"
    38 OPT_NAME="video.flv"
    39 OPT_LOG=true
    40
    41
    42
    43
    44 ###############################################################################
    45 # Fonctions :
    46 #
    47 ##
    48 # Définir le taux d’échantillonnage du son :
    49 #
    50 function setAr () {
    51
    52 OPT_AR=`zenity --entry --text="Taux d’échantillonnage" --entry-text=$OPT_AR`
    53 }
    54
    55
    56
    57 ##
    58 # Définir le audio bitrate en kbit / seconde :
    59 #
    60 function setAb () {
    61
    62 OPT_AB=`zenity --entry --text="Audio bitrate en kbit / seconde" --entry-text=$OPT_AB`
    63 }
    64
    65
    66
    67 ##
    68 # Définir les dimensions après conversion :
    69 #
    70 function setS () {
    71
    72 OPT_S=`zenity --entry --text="Dimensions après conversion" --entry-text=$OPT_S`
    73 }
    74
    75
    76
    77 ##
    78 # Définir les nom de la vidéo de sortie :
    79 #
    80 function setName () {
    81
    82 OPT_NAME=`zenity --entry --text="Non du fichier flv de sortie" --entry-text=$OPT_NAME`
    83 }
    84
    85
    86
    87 ##
    88 # Test l'appel du script :
    89 #
    90 function testArg () {
    91 if [ $1 -lt 2 ]; then
    92 zenity --info \
    93 --width=600 \
    94 --title="Usage incorrect de convert2flv !" \
    95 --text="L'usage correct est :
    96 convert2flv &#60;Chemin vers le fichier&#62; &#60;Nom du fichier&#62;";
    97 exit
    98 fi
    99 }
    100
    101
    102
    103 ##
    104 # Lancement
    105 #
    106 function convert () {
    107
    108 #Debug zenity --error --text="ffmpeg -i '$1/$2' -ar $OPT_AR -ab $OPT_AB -f flv -s $OPT_S '$1/$OPT_NAME'"
    109 #echo "ffmpeg -i '$1/$2' -ar $OPT_AR -ab $OPT_AB -f flv -s $OPT_S '$1/$OPT_NAME'" > "$1/$OPT_NAME.log"
    110 if [ $OPT_LOG = true ]; then
    111 ffmpeg -y -i "$1/$2" -ar $OPT_AR -ab $OPT_AB -f flv -s $OPT_S "$1/$OPT_NAME" 2> "$1/$OPT_NAME.log"
    112 zenity --text-info --filename="$1/$OPT_NAME.log"
    113 else
    114 ffmpeg -y -i "$1/$2" -ar $OPT_AR -ab $OPT_AB -f flv -s $OPT_S "$1/$OPT_NAME"
    115 fi
    116 }
    117
    118
    119
    120
    121
    122 ###############################################################################
    123 # Code brut :
    124 #
    125 testArg $#
    126 setAr
    127 setAb
    128 setS
    129 setName
    130 convert "$1" "$2"
    Posted by llaumgui to shell flv convertir avi zenity ... saved by 4 persons ... 0 comments ... 1 year, 2 months
showing 10, 25, 50 items per pages

Pages : 1

Flux RSS friendsnippetLatest snippets


More...