diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/2GIF nautilus-actions-extra-3.4.0/bins/2GIF --- nautilus-actions-extra-0.7.3~ppa1/bins/2GIF 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/2GIF 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/python + +import os +import sys + +def new_name(file): + splited=os.path.splitext(file) + return '.'.join([splited[0],'gif']) + +files = sys.argv[1:] + +for file in files: + os.system('convert "%s" "%s"' % (file, new_name(file))) diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/2JPG nautilus-actions-extra-3.4.0/bins/2JPG --- nautilus-actions-extra-0.7.3~ppa1/bins/2JPG 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/2JPG 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/python + +import os +import sys + +def new_name(file): + splited=os.path.splitext(file) + return '.'.join([splited[0],'jpg']) + +files = sys.argv[1:] + +for file in files: + os.system('convert "%s" "%s"' % (file, new_name(file))) diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/2PNG nautilus-actions-extra-3.4.0/bins/2PNG --- nautilus-actions-extra-0.7.3~ppa1/bins/2PNG 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/2PNG 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,13 @@ +#!/usr/bin/python + +import os +import sys + +def new_name(file): + splited=os.path.splitext(file) + return '.'.join([splited[0],'png']) + +files = sys.argv[1:] + +for file in files: + os.system('convert "%s" "%s"' % (file, new_name(file))) diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/ConvertAudioFile nautilus-actions-extra-3.4.0/bins/ConvertAudioFile --- nautilus-actions-extra-0.7.3~ppa1/bins/ConvertAudioFile 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/ConvertAudioFile 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,1341 @@ +#!/bin/bash +# +# +# audio convert 0.3.1 +# +# a program to convert wav, ogg, mp3, mpc, flac, ape, aac or wma files into +# wav, ogg, mp3, mpc, flac, ape or aac files. with an easy to use interface +# it's actually possible to fill in the tags for a few formats, pass them on +# from format to format, and choose the quality of compression. +# +# copyright (C) 2005 linfasoft +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +# USA +# +# dependencies +# bash +# zenity +# awk +# file >= 4.16 +# mplayer -- if you want to decode wma files +# lame +# vorbis tools +# id3tag +# musepack-tools +# flac +# mac +# faac,faad +# +# based on +# wom_audioconverter, by yekcim , http://yeknan.free.fr. +# + +set -x + +version="0.3.1" +################################################# +# TRADUCTIONS + ###### Default = English ##### + title="audio convert "$version"" + pleasesel="please select at least one file." + noselec=""$title" converts audio files. "$pleasesel"" + choix="extension of output file:" + warning="warning" + proceed="already exists. overwrite?" + recur=""$title" can't convert a directory. "$pleasesel"" + conversion="converting file:" + ask_artist="enter the artist name:" + ask_album="enter the album name:" + ask_song="enter the song name:" + ask_track="enter the track number:" + ask_quality="select the desired quality:" + ask_compression="select the desired compression level:" + confirmation="do you want to convert" + decoding="decoding file:" + ask_fields="manually enter file metatags" + ask_confirmation_question="get prompted a confirmation question before convertin' each file" + no_codec="you don't have the right codec to decode the selected file. missin' codec:" + not_supported="format not supported" + completed="conversion completed. goodbye!" + ask_to_pass="pass the metatags on to the new files" + options="choose from the followin' options:" + options_conflict="options one and two conflict. please unselect one of them" +case $LANG in + ######## Français ######## + fr* ) + title="audio convert "$version"" + pleasesel="Merci de selectionner au moins un fichier." + noselec=""$title" permet de convertir des fichiers audio. "$pleasesel"" + choix="Format du fichier de sortie :" + warning="Attention" + proceed="existe deja. Ecraser ?" + recur=""$title" ne permet pas la conversion de dossiers. "$pleasesel"" + conversion="Conversion du fichier :" + ask_artist="Nom de l'artiste:" + ask_album="Nom de l'album:" + ask_song="Nom de la chanson:" + ask_track="Numero de la piste:" + ask_quality="Choisir la qualite voulue:" + confirmation="voulez-vous convertir" + decoding="decodage du fichier:" + ask_fields="voulez-vous completer les metatags du fichier?" + ask_confirmation_question="voulez-vous confirmer avant de convertir chaque + fichier?";; + ######## italiano ######### + it* ) + title="audio convert "$version"" + pleasesel="per favore, scegli almeno un file." + noselec=""$title" converte i file audio. "$pleasesel"" + choix="formato di conversione:" + warning="attenzione" + proceed="esiste! sovrascrivo?" + recur=""$title" non può convertire directory. "$pleasesel"" + conversion="sto convertendo il file:" + ask_artist="immetti il nome dell'artista:" + ask_album="immetti il nome dell'album:" + ask_song="immetti il nome della canzone:" + ask_track="immetti il numero della traccia:" + ask_quality="scegli la qualità del file:" + ask_compression="scegli il livello di compressione:" + confirmation="vuoi convertire" + decoding="sto decodificando il file:" + ask_fields="completare manualmente le metatags" + ask_confirmation_question="chiedi una conferma per ogni file da convertire" + no_codec="non hai il codec corretto per decodificare il file selezionato. codec mancante:" + not_supported="formato non supportato" + completed="conversione completata. arrivederci!" + ask_to_pass="copiare le metatags nel nuovo file" + options="scegli fra le seguenti opzioni:" + options_conflict="le opzioni uno e due sono in conflitto. per favore deselezionane una";; + ###### Brazilian Portuguese ###### + pt-br* ) + title="audio convert "$version"" + pleasesel="por favor, selecione pelo menos um arquivo." + noselec=""$title" converter arquivos de audio. "$pleasesel"" + choix="extensão do arquivo de saída:" + warning="atenção" + proceed="já existe! sobrescrever?" + recur=""$title" não e possível converter pasta. "$pleasesel"" + conversion="convertendo arquivo:" + ask_artist="digite o nome do artista:" + ask_album="digite o nome do album:" + ask_song="digite o nome da música:" + ask_track="digite o número da faixa:" + ask_quality="selecione a qualidade desejada:" + confirmation="você quer converter" + decoding="decodificando arquivo:";; + ######## dutch ######## + nl* ) + title="audio convert "$version"" + pleasesel="selecteer minimaal 1 bestand." + noselec=""$title" converteer audio bestanden. "$pleasesel"" + choix="extensie van uitvoerbestanden:" + warning="waarschuwing" + proceed="bestaat al. overschrijven?" + recur=""$title" kan geen directory converteren. "$pleasesel"" + conversion="converteren van bestand:" + ask_artist="voer naam van artiest in:" + ask_album="voer naam van album in:" + ask_song="voer naam van nummer in:" + ask_track="voer volgnummer in:" + ask_quality="selecteer de gewenste kwaliteit:" + confirmation="wil je converteren" + decoding="decoderen bestand:" + ask_fields="Wil je metatags aan de bestanden toevoegen?" + ask_confirmation_question="Wil je bevestiging voor het converteren van elk bestand?" + no_codec="Je hebt niet de juiste codec voor het converteren van dit bestand. Missende codec:" + not_supported="Formaat niet ondersteund" + completed="Conversie compleet." + ask_to_pass="Wil je de metatags toevoegen aan de nieuwe bestanden?";; + ######## german ######## + de* ) + title="Audio konvertier Skript "$version"" + pleasesel="Bitte wählen Sie mindestens eine Datei." + noselec=""$title" verarbeitet Dateien. "$pleasesel"" + choix="Erweiterung der Ausgabedatei:" + warning="Warnung" + proceed="existiert bereits. Überschreiben?" + recur=""$title" kann kein Verzeichnis konvertieren. "$pleasesel"" + conversion="Konvertierung der Datei:" + ask_artist="Künstlername:" + ask_album="Albumname:" + ask_song="Songname:" + ask_track="Titelnummer:" + ask_quality="Wählen Sie die gewuenschte Qualitaet:" + confirmation="Wollen Sie jetzt konvertieren?" + decoding="dekodiere Datei:" + ask_compression="gib die gewünschte Komprimierungsstaerke an:" + ask_confirmation_question="willst Du für jede Datei vor der Konvertierung eine Bestätigungsfrage?" + ask_fields="Du willst keine metatags angeben?" + completed="Konvertierung abgeschlossen. Tschüss" + no_codec="Du hast keinen passenden codec um die Datei zu dekodieren" + not_supported="Format wird nicht unterstützt";; + ######## Spanish(Español - Castellano) ######## + es* ) + title="audio convert "$version"" + pleasesel="Seleccione al menos un archivo." + noselec=""$title" - Convierte archivos de audio."$pleasesel"" + choix="Formato del archivo resultante:" + warning="Atención" + proceed="Ya existe, sobreescribir?" + recur=""$title" No se puede convertir el directorio. "$pleasesel"" + conversion="Convirtiendo archivo:" + ask_artist="Nombre del artista:" + ask_album="Nombre del álbum:" + ask_song="Nombre de la canción:" + ask_track="Número de la pista:" + ask_quality="Seleccione la calidad deseada:" + confirmation="Convertir?" + decoding="Decodificando archivo:" + ask_fields="Editar las \"metatags\" del archivo?" + ask_confirmation_question="Desea una pregunta de confirmación antes de convertir cada archivo?" + ask_compression="seleccione el nivel de compresión deseable:" + completed="conversión completo. Adiós!" + no_codec="No tenrs el codec correcto para descodificar el elijido archivo. Falta:" + not_supported="Format no es soportado";; + ######## polish ######## + pl* ) + title="konwersja audio "$version"" + pleasesel="wybierz co najmniej jeden plik." + noselec="konwersja pliku "$title". "$pleasesel"" + choix="rozszerzenie pliku wynikowego:" + warning="ostrzeÅŒenie" + proceed="juÅŒ istnieje. zastÄ~EpiÄ~G ?" + recur=""$title" nie moÅŒna konwertowaÄ~G katalogów. "$pleasesel"" + conversion="konwersja pliku:" + ask_artist="podaj nazwÄ~Y wykonawcy:" + ask_album="podaj nazwÄ~Y albumu:" + ask_song="podaj nazwÄ~Y utworu:" + ask_track="podaj numer Å~[cieÅŒki:" + ask_quality="wybierz wymagany poziom jakoÅ~[ci:" + ask_compression="wybierz wymagany poziom kompresji:" + confirmation="chcesz uÅŒyÄ~G konwersji" + decoding="dekodowany plik:" + ask_fields="chcesz umieÅ~[ciÄ~G tagi ?" + ask_confirmation_question="chcesz uÅŒywaÄ~G potwierdzenia przed kaÅŒdÄ~E konwersjÄ~E ?" + no_codec="nie posiadasz odpowiedniego kodeka dla wykonania wymaganej operacji. missin' codec:" + not_supported="brak obsÅ~Bugi wskazanego formatu" + completed="konwersjÄ~Y zakoÅ~Dczono. Pa, pa!" + ask_to_pass="chcesz eksportowaÄ~G metatagi do innych plików?" +esac + +################################################# +# FONCTIONS +get_field_names () +{ + artist_name=`zenity --entry --title="$title" --text="$ask_artist" --entry-text="$artist_name"` + album_name=`zenity --entry --title="$title" --text="$ask_album" --entry-text="$album_name"` + song_name=`zenity --entry --title="$title" --text="$ask_song"` + track_number=`zenity --entry --title="$title" --text="$ask_track"` +} + +get_ogg_quality () +{ + zenity --title="$title" --list --radiolist --column="" --column="$ask_quality" -- "-1" FALSE "0" FALSE "1" FALSE "2" FALSE "3" FALSE "4" FALSE "5" FALSE "6" TRUE "7" FALSE "8" FALSE "9" FALSE "10" +} + +get_mp3_quality () +{ + zenity --title="$title" --list --radiolist --column="" --column="$ask_quality" FALSE "medium" FALSE "standard" TRUE "extreme" FALSE "insane" +} + +get_mpc_quality () +{ + zenity --title="$title" --list --radiolist --column="" --column="$ask_quality" FALSE "thumb" FALSE "radio" TRUE "standard" FALSE "xtreme" +} + +get_flac_quality () +{ + zenity --title="$title" --list --radiolist --column="" --column="$ask_compression" FALSE "0" FALSE "1" FALSE "2" FALSE "3" FALSE "4" FALSE "5" FALSE "6" FALSE "7" TRUE "8" +} + +get_mac_quality () +{ + zenity --title="$title" --list --radiolist --column="" --column="$ask_compression" FALSE "1000" FALSE "2000" TRUE "3000" FALSE "4000" FALSE "5000" +} + +get_aac_quality () +{ + zenity --title="$title" --list --radiolist --column="" --column="$ask_compression" FALSE "100" FALSE "200" TRUE "300" FALSE "400" FALSE "500" +} + +get_quality () +{ + if [ "$1" == "mp3" ] + then + quality="$(get_mp3_quality)" + fi + if [ "$1" == "ogg" ] + then + quality="$(get_ogg_quality)" + fi + if [ "$1" == "mpc" ] + then + quality="$(get_mpc_quality)" + fi + if [ "$1" == "flac" ] + then + quality="$(get_flac_quality)" + fi + if [ "$1" == "ape" ] + then + quality="$(get_mac_quality)" + fi + if [ "$1" == "aac" ] + then + quality="$(get_aac_quality)" + fi +} + +get_metatags () +{ + if (is_mp3 "$1") + then + artist_name=`id3info "$1" | awk '/TPE1/ { print substr($0, match($0, /:/) + 2 ) }'` + album_name=`id3info "$1" | awk '/TALB/ { print substr($0, match($0, /:/) + 2 ) }'` + song_name=`id3info "$1" | awk '/TIT2/ { print substr($0, match($0, /:/) + 2 ) }'` + track_number=`id3info "$1" | awk '/TRCK/ { print substr($0, match($0, /:/) + 2 ) }'` + fi + if (is_ogg "$1") + then + artist_name=`ogginfo "$1" | grep artist | cut -d \= -f 2` + album_name=`ogginfo "$1" | grep album | cut -d \= -f 2` + song_name=`ogginfo "$1" | grep title | cut -d \= -f 2` + track_number=`ogginfo "$1" | grep tracknumber | cut -d \= -f 2` + fi + if (is_flac "$1") + then + artist_name=`metaflac --show-tag=artist "$1" | cut -d \= -f 2` + album_name=`metaflac --show-tag=album "$1" | cut -d \= -f 2` + song_name=`metaflac --show-tag=title "$1" | cut -d \= -f 2` + track_number=`metaflac --show-tag=tracknumber "$1" | cut -d \= -f 2` + fi + if (is_aac "$1") + then + artist_name=`faad -i "$1" 2>&1 | awk '/artist/ { print substr($0, match($0, /:/) + 2 ) }'` + album_name=`faad -i "$1" 2>&1 | awk '/album/ { print substr($0, match($0, /:/) + 2 ) }'` + song_name=`faad -i "$1" 2>&1 | awk '/title/ { print substr($0, match($0, /:/) + 2 ) }'` + track_number=`faad -i "$1" 2>&1 | awk '/track/ { print substr($0, match($0, /:/) + 2 ) }'` + fi +} + +mp3_parse_fields () +{ + if [ "$artist_name" ] + then + mp3_fields=(-a"$artist_name") + fi + if [ "$album_name" ] + then + mp3_fields=("${mp3_fields[@]}" -A"$album_name") + fi + if [ "$song_name" ] + then + mp3_fields=("${mp3_fields[@]}" -s"$song_name") + fi + if [ "$track_number" ] + then + mp3_fields=("${mp3_fields[@]}" -t"$track_number") + fi +} + +ogg_parse_fields () +{ + if [ "$artist_name" ] + then + ogg_fields=(-a "$artist_name") + fi + if [ "$album_name" ] + then + ogg_fields=("${ogg_fields[@]}" -l "$album_name") + fi + if [ "$song_name" ] + then + ogg_fields=("${ogg_fields[@]}" -t "$song_name") + fi + if [ "$track_number" ] + then + ogg_fields=("${ogg_fields[@]}" -N "$track_number") + fi +} + +flac_set_tags () +{ + if [ $pass_metatags -eq 0 ] || [ $fields -eq 0 ] + then + if [ "$artist_name" ] + then + metaflac --set-tag=ARTIST="$artist_name" "$1" + fi + if [ "$album_name" ] + then + metaflac --set-tag=ALBUM="$album_name" "$1" + fi + if [ "$song_name" ] + then + metaflac --set-tag=TITLE="$song_name" "$1" + fi + if [ "$track_number" ] + then + metaflac --set-tag=TRACKNUMBER="$track_number" "$1" + fi + fi +} + +aac_parse_fields () +{ + if [ "$artist_name" ] + then + aac_fields=(--artist "$artist_name") + fi + if [ "$album_name" ] + then + aac_fields=("${aac_fields[@]}" --album "$album_name") + fi + if [ "$song_name" ] + then + aac_fields=("${aac_fields[@]}" --title "$song_name") + fi + if [ "$track_number" ] + then + aac_fields=("${aac_fields[@]}" --track "$track_number") + fi +} + +is_mp3 () +{ + file -b "$1" | grep 'MP3' || echo $1 | grep -i '\.mp3$' +} + +is_ogg() +{ + file -b "$1" | grep 'Vorbis' || echo $1 | grep -i '\.ogg$' +} + +is_mpc() +{ + file -b "$1" | grep 'Musepack' || echo $1 | grep -i '\.mpc$' +} + +is_flac() +{ + file -b "$1" | grep 'FLAC' || echo $1 | grep -i '\.flac$' +} + +is_mac() +{ + file -b "$1" | grep 'Monkey' && echo $1 | grep -i '\.ape$' +} + +is_aac() +{ + file -b "$1" | grep 'AAC' || echo $1 | grep -i '\.aac$' +} + +is_wav() +{ + file -b "$1" | grep 'WAVE' || echo $1 | grep -i '\.wav$' +} + +is_wma() +{ + file -b "$1" | grep 'Microsoft' || echo $1 | grep -i '\.wma$' +} + +mp3_encode () +{ + lame -m auto --preset $quality "$2" "$3" 2>&1 | awk -vRS='\r' '(NR>3){gsub(/[()%|]/," ");print $2; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close +} + +ogg_encode () +{ + if [ $fields -eq 0 ] || [ $pass_metatags -eq 0 ] + then + ogg_parse_fields + oggenc "$2" "${ogg_fields[@]}" -q $quality -o "$3" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $2; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close + else + oggenc "$2" -q $quality -o "$3" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $2; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close + fi +} + +mpc_encode () +{ + mppenc --$quality "$2" "$3" 2>&1 | awk -vRS='\r' '!/^$/{if (NR>5) print $1; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close +} + +flac_encode () +{ + flac --compression-level-$quality "$2" -o "$3" 2>&1 | awk -vRS='\r' -F':' '!/wrote/{gsub(/ /,"");if(NR>1)print $2; fflush();}' | awk -F'%' '{print $1; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close +} + +mac_encode () +{ + mac "$2" "$3" -c$quality 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $2; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close +} + +aac_encode () +{ + if [ $fields -eq 0 ] || [ $pass_metatags -eq 0 ] + then + aac_parse_fields + faac -w "${aac_fields[@]}" -q $quality -o "$3" "$2" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $3; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close + else + faac -q $quality -o "$3" "$2" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $3; fflush();}' | zenity --progress --title="$title" --text="$conversion $1" --auto-close + fi +} + +mp3_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + lame --decode "$1" "$temp_file" 2>&1 | awk -vRS='\r' -F'[ /]+' '(NR>2){if((100*$2/$3)<=100)print 100*$2/$3; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +ogg_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + oggdec "$1" -o "$temp_file" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $2; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +mpc_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + mppdec "$1" "$temp_file" 2>&1 | awk -vRS='\r' -F'[ (]+' '!/s/{gsub(/(%)/," ");if(NR>5)print $5; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +flac_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + flac -d "$1" -o "$temp_file" 2>&1 | awk -vRS='\r' -F':' '!/done/{gsub(/ /,"");gsub(/% complete/,"");if(NR>1)print $2; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +mac_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + mac "$1" "$temp_file" -d 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $2; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +aac_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + faad -o "$temp_file" "$1" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print $1; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +wma_decode () +{ + temp_file=`echo "$1" | sed 's/\.\w*$/'.wav'/'` + mplayer -ao pcm:file="$temp_file" "$1" 2>&1 | awk -vRS='\r' '(NR>1){gsub(/%/," ");print 100-$5; fflush();}' | zenity --progress --title="$title" --text="$2 $1" --auto-close +} + +ask_for_fields () +{ + #zenity --question --text="$ask_fields" + #fields=$? + questions=("${questions[@]}" FALSE "$ask_fields") +} + +ask_for_confirmation () +{ + #zenity --question --text="$ask_confirmation_question" + #confirmation_question=$? + questions=("${questions[@]}" FALSE "$ask_confirmation_question") +} + +ask_to_pass_metatags () +{ + #zenity --question --text="$ask_to_pass" + #pass_metatags=$? + questions=(FALSE "$ask_to_pass") +} + +question_list () +{ + if [ "$formatout" == "mp3" ] || [ "$formatout" == "ogg" ] || [ "$formatout" == "flac" ] || \ + [ "$formatout" == "aac" ] + then + #pass_metatags=1 + + if (is_mp3 "$1") || (is_ogg "$1") || (is_flac "$1") || (is_aac "$1") + then + ask_to_pass_metatags # ask if user wants metatags to be passed on + fi + + ask_for_fields # ask if user wants to edit metatags + fi + if [ "$2" -gt 1 ] + then + ask_for_confirmation # ask if user wants a confirmation question for each file + #else + # confirmation_question=1 + fi +} + +ask_questions () +{ + repeat=1 + + while [ $repeat -eq 1 ] + do + answers=`zenity --list --checklist --column "" --column "$options" "${questions[@]}"` + + if (echo "$answers" | grep -i "$ask_to_pass") && \ + (echo "$answers" | grep -i "$ask_fields") + then + zenity --error --title="$warning" --text="$options_conflict" + repeat=1 + continue + fi + + repeat=0 + done +} + +parse_questions () +{ + if (echo "$answers" | grep -i "$ask_to_pass") + then + pass_metatags=0 + else + pass_metatags=1 + fi + + if (echo "$answers" | grep -i "$ask_fields") + then + fields=0 + else + fields=1 + fi + + if (echo "$answers" | grep -i "$ask_confirmation_question") + then + confirmation_question=0 + else + confirmation_question=1 + fi +} + +completed_message () +{ + zenity --info --title "$title" --text="$completed" +} + +caf () # fonction "convert audio file" +{ + ### Format in_file = mp3 ### + if (is_mp3 "$1") + then + if [ "$3" = "ogg" ] + then # mp3-2-ogg + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + mp3_decode "$1" "$decoding" + ogg_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "mpc" ] + then # mp3-2-mpc + mp3_decode "$1" "$decoding" + mpc_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "flac" ] + then # mp3-2-flac + mp3_decode "$1" "$decoding" + flac_encode "$1" "$temp_file" "$2" + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ape" ] + then # mp3-2-ape + mp3_decode "$1" "$decoding" + mac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "aac" ] + then # mp3-2-aac + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + mp3_decode "$1" "$decoding" + aac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "wav" ] + then # mp3-2-wav + mp3_decode "$1" "$conversion" + fi + break + fi + ### Format in_file = ogg ### + if (is_ogg "$1") + then + if [ "$3" = "mp3" ] + then # ogg-2-mp3 + ogg_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + if [ $pass_metatags -eq 0 ] || [ $fields -eq 0 ] + then + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + fi + rm -f "$temp_file" + break + fi + if [ "$3" = "mpc" ] + then # ogg-2-mpc + ogg_decode "$1" "$decoding" + mpc_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "flac" ] + then # ogg-2-flac + ogg_decode "$1" "$decoding" + flac_encode "$1" "$temp_file" "$2" + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ape" ] + then # ogg-2-ape + ogg_decode "$1" "$decoding" + mac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "aac" ] + then # ogg-2-aac + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + ogg_decode "$1" "$decoding" + aac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "wav" ] + then # ogg-2-wav + ogg_decode "$1" "$conversion" + fi + break + fi + ### Format in_file = mpc ### + if (is_mpc "$1") + then + if [ "$3" = "mp3" ] + then # mpc-2-mp3 + mpc_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + break + fi + mpc_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ogg" ] + then # mpc-2-ogg + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + mpc_decode "$1" "$decoding" + ogg_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "flac" ] + then # mpc-2-flac + mpc_decode "$1" "$decoding" + flac_encode "$1" "$temp_file" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ape" ] + then # mpc-2-ape + mpc_decode "$1" "$decoding" + mac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "aac" ] + then # mpc-2-aac + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + mpc_decode "$1" "$decoding" + aac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "wav" ] + then # mpc-2-wav + mpc_decode "$1" "$conversion" + fi + break + fi + ### Format in_file = flac ### + if (is_flac "$1") + then + if [ "$3" = "mp3" ] + then # flac-2-mp3 + flac_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + if [ $pass_metatags -eq 0 ] || [ $fields -eq 0 ] + then + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + fi + rm -f "$temp_file" + break + fi + if [ "$3" = "ogg" ] + then # flac-2-ogg + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_decode "$1" "$decoding" + ogg_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "mpc" ] + then # flac-2-mpc + flac_decode "$1" "$decoding" + mpc_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ape" ] + then # flac-2-ape + flac_decode "$1" "$decoding" + mac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "aac" ] + then # flac-2-aac + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_decode "$1" "$decoding" + aac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "wav" ] + then # flac-2-wav + flac_decode "$1" "$conversion" + fi + break + fi + ### Format in_file = ape ### + if (is_mac "$1") + then + if [ "$3" = "mp3" ] + then # ape-2-mp3 + mac_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + break + fi + mac_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ogg" ] + then # ape-2-ogg + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + mac_decode "$1" "$decoding" + ogg_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "mpc" ] + then # ape-2-mpc + mac_decode "$1" "$decoding" + mpc_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "flac" ] + then #ape-2-flac + mac_decode "$1" "$decoding" + flac_encode "$1" "$temp_file" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "aac" ] + then # ape-2-aac + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + mac_decode "$1" "$decoding" + aac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "wav" ] + then #ape-2-wav + mac_decode "$1" "$conversion" + fi + break + fi + ### Format in_file = aac ### + if (is_aac "$1") + then + if [ "$3" = "mp3" ] + then # aac-2-mp3 + aac_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + if [ $pass_metatags -eq 0 ] || [ $fields -eq 0 ] + then + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + fi + rm -f "$temp_file" + break + fi + if [ "$3" = "ogg" ] + then # aac-2-ogg + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + aac_decode "$1" "$decoding" + ogg_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "mpc" ] + then # aac-2-mpc + aac_decode "$1" "$decoding" + mpc_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "flac" ] + then # aac-2-flac + aac_decode "$1" "$decoding" + flac_encode "$1" "$temp_file" "$2" + if [ $pass_metatags -eq 0 ] + then + get_metatags "$1" + elif [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ape" ] + then # aac-2-ape + aac_decode "$1" "$decoding" + mac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "wav" ] + then # aac-2-wav + aac_decode "$1" "$conversion" + fi + break + fi + ### Format in_file = wav ### + if (is_wav "$1") + then + if [ "$3" = "mp3" ] + then # wav-2-mp3 + mp3_encode "$1" "$1" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + break + fi + break + fi + if [ "$3" = "ogg" ] + then # wav-2-ogg + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + ogg_encode "$1" "$1" "$2" + break + fi + if [ "$3" = "mpc" ] + then # wav-2-mpc + mpc_encode "$1" "$1" "$2" + fi + if [ "$3" = "flac" ] + then # wav-2-flac + flac_encode "$1" "$1" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + fi + if [ "$3" = "aac" ] + then # wav-2-aac + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + aac_encode "$1" "$1" "$2" + break + fi + if [ "$3" = "ape" ] + then # wav-2-ape + mac_encode "$1" "$1" "$2" + fi + break + fi + ### Format in_file = wma ### + if (is_wma "$1") + then + if [ "$3" = "mp3" ] + then # wma-2-mp3 + wma_decode "$1" "$decoding" + mp3_encode "$1" "$temp_file" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + mp3_parse_fields + id3tag "${mp3_fields[@]}" "$2" + break + fi + rm -f "$temp_file" + break + fi + + if [ "$3" = "wav" ] + then # wma-2-wav + wma_decode "$1" "$conversion" + fi + + if [ "$3" = "ogg" ] + then # wma-2-ogg + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + wma_decode "$1" "$decoding" + ogg_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "mpc" ] + then # wma-2-mpc + wma_decode "$1" "$decoding" + mpc_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "flac" ] + then # wma-2-flac + wma_decode "$1" "$decoding" + flac_encode "$1" "$temp_file" "$2" + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + flac_set_tags "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "ape" ] + then # wma-2-ape + wma_decode "$1" "$decoding" + mac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + if [ "$3" = "aac" ] + then # wma-2-aac + if [ $fields -eq 0 ] + then + get_field_names "$1" + fi + wma_decode "$1" "$decoding" + aac_encode "$1" "$temp_file" "$2" + rm -f "$temp_file" + break + fi + break + fi +} + +################################################# +# PROGRAMME +#### Pas de fichiers sélectionné ### +if [ $# -eq 0 ]; then + zenity --error --title="$warning" --text="$noselec" + exit 1 +fi +######## make a list of available formats, and check if we can decode the file ####### +if !(is_mp3 "$1") && !(is_ogg "$1") && !(is_mpc "$1") && !(is_flac "$1") && !(is_mac "$1") && \ + !(is_aac "$1") && !(is_wav "$1") && !(is_wma "$1") +then + zenity --error --title="$warning" --text="$not_supported" + exit 1 +fi +depformat="" +if which lame 2>/dev/null +then + if !(is_mp3 "$1") # if we have lame, and the file to convert is not an mp3, + then # add mp3 to the list of formats to convert to + depformat="mp3" + fi +else # if we don't have lame, check if the file to convert is an mp3 + if (is_mp3 "$1") + then + zenity --error --title="$warning" --text="$no_codec lame" + exit 1 + fi +fi +if which oggenc 2>/dev/null +then + if !(is_ogg "$1") # if we have vorbis-tools, and the file to convert is not an + then # ogg, add ogg to the list of formats to convert to + depformat="$depformat ogg" + fi +else # if we don't have vorbis-tools, check if the file to convert is an ogg + if (is_ogg "$1") + then + zenity --error --title="$warning" --text="$no_codec vorbis-tools" + exit 1 + fi +fi +if which mppenc 2>/dev/null +then + if !(is_mpc "$1") # if we have musepack-tools, and the file to convert is not + then # an mpc, add mpc to the list of formats to convert to + depformat="$depformat mpc" + fi +fi +if !(which mppdec 2>/dev/null) +then # if we don't have musepack-tools, check if the file to convert is an mpc + if (is_mpc "$1") + then + zenity --error --title="$warning" --text="$no_codec musepack-tools" + exit 1 + fi +fi +if which flac 2>/dev/null +then + if !(is_flac "$1") # if we have flac, and the file to convert is not a + then # flac, add flac to the list of formats to convert to + depformat="$depformat flac" + fi +else # if we don't have flac, check if the file to convert is a flac + if (is_flac "$1") + then + zenity --error --title="$warning" --text="$no_codec flac" + exit 1 + fi +fi +if which mac 2>/dev/null +then + if !(is_mac "$1") # if we have mac, and the file to convert is not an ape, + then # add ape to the list of formats to convert to + depformat="$depformat ape" + fi +else # if we don't have mac, check if the file to convert is an ape + if (is_mac "$1") + then + zenity --error --title="$warning" --text="$no_codec mac" + exit 1 + fi +fi +if which faac 2>/dev/null +then + if !(is_aac "$1") # if we have faac, and the file to convert to is not an aac, + then # add aac to the list of formats to convert to + depformat="$depformat aac" + fi +fi +if !(which faad 2>/dev/null) # if we don't have faad, check if the file to convert to is an aac +then + if (is_aac "$1") + then + zenity --error --title="$warning" --text="$no_codec faad" + exit 1 + fi +fi +if !(which mplayer 2>/dev/null) # if we don't have mplayer, check if the file to convert is a wma +then + if (is_wma "$1") + then + zenity --error --title="$warning" --text="$no_codec mplayer" + exit 1 + fi +fi +if !(is_wav "$1") # if the file to convert is not a wav, add wav to the list of +then # formats to convert to + depformat="$depformat wav" +fi +######## Fenêtre principale ######## +while [ ! "$formatout" ] # Réafficher la fenêtre tant que l'utilisateur n'a pas fait de choix +do + + + formatout=`zenity --title "$title" --list --column="Format" $depformat --text "$choix"` + ###### Choix -> Sortie boucle ###### + if [ $? != 0 ]; then + exit 1 + fi + [ $? -ne 0 ] && exit 2 # Annulation +done +########## Conversion ############ +#let "nbfiles = $#" +#compteur=0; +question_list "$1" "$#" # prepare all of the various conversion questions +ask_questions # ask all of the various conversion questions +parse_questions # parse all of the various conversion questions +if [ "$formatout" != "wav" ] +then + get_quality "$formatout" # ask for quality of compression +fi +file_number=$# +(while [ $# -gt 0 ]; do + for i in $formatout; do + in_file=$1 + out_file=`echo "$in_file" | sed 's/\.\w*$/'.$formatout'/'` + #echo "# $conversion $in_file" + i=`echo $i | sed 's/"//g'` + while `true`; do + ########## Le fichier de sortie existe déjÃ| , l'écraser ? ########## + if ls "$out_file" | grep -v "^ls" + then + if !(`gdialog --title "$warning" --yesno "$out_file $proceed" 200 100`) + then + break + fi + fi + if [ "$file_number" -gt 1 ] && [ "$confirmation_question" -eq 0 ] + then + zenity --question --text="$confirmation $in_file in $out_file?" + if [ $? -eq 1 ] + then + break + fi + fi + caf "$in_file" "$out_file" "$formatout" # Lancer la conversion + break + shift + done + ######### Progression ######## +# let "compteur += 1" +# let "progress = compteur*100/nbfiles" +# echo $progress + done + shift +done +) + +completed_message diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/avconvert nautilus-actions-extra-3.4.0/bins/avconvert --- nautilus-actions-extra-0.7.3~ppa1/bins/avconvert 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/avconvert 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,1814 @@ +#!/bin/bash + +# marc brumlik, tailored software inc, Mon Sep 8 22:50:20 CDT 2008 +version="0.81 Tue Jan 19 14:29:49 CST 2010 --\nVideos can now be rotated\nVideo-->frames has been improved" +# tsi-inc@comcast.net +# posted to: http://www.gnome-look.org/content/show.php/Audio%2BVideo%2BImage%2BText%2BISO+Convert?content=92533 +# your vote would be appreciated (as would a $1 donation :-) + +# convert various image, audio, and video files into other likely formats + +# set -x + +##### +# Watcher +##### +avwatcher() { +### this function produces the "progress window" during the conversion. +### there are two phases... + +# set -x +# doing frames?? +frames=n +echo "$1" | grep "frame-%04d" >/dev/null && frames=y +mult="100" +[ "$frames" = "y" ] && mult="1000" + + +# phase 1 begins. sleep for one second while the conversion gets started. +# sleep 1 +# using the process NAME and the PPID given, find the PID of the conversion +pid=`ps -ef | grep " $4 " | grep "$2" | awk '{print $2}'` +z="0" +# every second, test for the appearance of the output file + +wtext1=`mytranslate "Waiting for"` +wtext1="$wtext1 $2\n" +wtext1="$wtext1 "`mytranslate "to begin writing"` +wtext1="$wtext1 $1" +wtext2=`mytranslate "Program Cancelled!"` + +while true +do +# if this is a "frame job", skip watcher phase 1 + [ "$frames" = "y" ] && break +# if the file appears before progress window even comes up, go to phase 2 + if test -s "$1" + then break + fi + for a in 10 20 30 40 50 60 70 80 90 80 70 60 50 40 30 20 10 00 + do +# when file appears, go to phase 2 + test -s "$1" && break 2 +# otherwise, increment counter in zenity window for next display + echo $a; sleep 1 + z=`expr $z + 1` +# but if no file is seen for 20 seconds, something's not right. exit. + if [ "$z" = "20" ] + then exit 0 + fi + done +done | zenity --progress --auto-close --text="$wtext1" || ( kill -9 $pid >/dev/null 2>&1; zenity --info --text="$wtext2" ) + +# phase 2 + +wtext1=`mytranslate "Writing to"` +wtext1="$wtext1 $1\n" +wtext1="$wtext1 "`mytranslate "Estimate to completion..."` + +while true +do +# is it still there? some conversions manipulate the name + if [ "$frames" = "y" ] + then cksize=`echo "$1" | sed 's/frame-.*/frame-/'` + ckext=`echo "$1" | sed 's/^.*\././'` + else if test -s "$1" + then cksize="$1" + else break + fi + fi + +# find the size of the target output file + if [ "$frames" = "y" ] + then + newsize=`du -a -b -c "$cksize"????$ckext | tail -1 | awk '{print $1}'` + else + newsize=`du -a -b "$1" | awk '{print $1}'` + fi +# calculate this as a percentage of target file size + progress="0"`echo "scale=10; $newsize / $3 * $mult" | bc` + if [ "$progress" = "$oldprogress" ] +# if we are at 100% zenity will exit on its own +# but if the output file stops growing BEFORE 100%, exit out + then break + fi + oldprogress="$progress" + showprogress=`echo "$progress" | sed 's/\..*//'` + sleep 2 +# if the file is still growing but we're over 99%, then just show 99% +# so that the window does not close + if [ "$showprogress" -ge "99" ] + then showprogress=99 + fi + echo $showprogress +done | zenity --progress --percentage=01 --auto-close --text="$wtext1" || ( kill -9 $pid >/dev/null 2>&1; zenity --info --text="$wtext2" ) +} +# end of watcher + + +##### +# Translate text to other languages +##### +mytranslate() { +# +# use online translation service on text + +case $online in + n) echo "$*"; exit 0 ;; +esac + +case $service in +google) serviceline="-d langpair=en|$lang http://translate.google.com/translate_t" ;; +babel) serviceline="-d lp=en_$lang http://babelfish.yahoo.com/translate_txt" ;; +esac + +transline=`curl --connect-timeout 1 -m 1 --retry 1 -s -A "Mozilla/5.0" \ + -d "hl=en" -d "ie=UTF8" -d text="$*" $serviceline` + +case $service in + google) echo "$transline" | grep "gtrans" | \ + gawk -F"gtrans value" '{print $2}' | \ + cut -d'"' -f2 | $links -dump | $links -dump | sed 's/^ *//' + ;; + babel) echo "$transline" | grep "result" | grep "div" | \ + tr '<>' '~~' | awk -F~ '{print $5}' + ;; +esac +} + +##### +# Convert +##### +myavconvert() { +# +# processing images or performing text-to-image conversion + +# set -x + +# this is for looping after the first item, using the env for settings +looping=n +if test -s /tmp/avconvert.env + then . /tmp/avconvert.env + looping=y +fi + +# the output types allowed for + +case $it in + image) out=" gif jpg ico pdf png tif OTHER" + height=460 ;; + text) out=" gif jpg ico pdf png tif OTHER" + height=370 ;; +esac + +# set default checkbox: all false except the original ext (except txt) +case $imageext in + none) out=`echo "$out" | sed -e 's/ / FALSE /g'` ;; + same) out=`echo "$out" | sed -e 's/ / FALSE /g' -e "s/FALSE \$ext/TRUE $ext/"` ;; + *) out=`echo "$out" | sed -e 's/ / FALSE /g' -e "s/FALSE \$imageext/TRUE $imageext/"` ;; +esac + +# show output choices to user and loop until selection is made +while true +do +if [ "$looping" = "n" ] + then +case $prog$it in + convertimage) ident=`identify "$target"` + ident="$ident\n$imident" + title=`mytranslate "Converting file"` + c1=`mytranslate "Convert to format"` + text=`mytranslate "Source file format"` + text="$text $show, +$ident + +" + text="$text"`mytranslate "You can select multiple formats - avconvert will loop to create them all. + +OUTPUT NAMING: names of the files created will include the proper extension, +and if the resolution differs from the original then a \"-XXX\" before the extension. + +Choose OTHER for an output type not listed"` + choice=`zenity --list --height=$height --title="$title $target" --text="$text" --checklist --column "$s1" --column "$c1" $out` || exit 0 + ;; + converttext) title=`mytranslate "Convert"` + text=`mytranslate "Source file format"` + text="$text $show + +" + text="$text"`mytranslate "Default action is to convert TEXT to IMAGE + +Choose OTHER for an output type not listed"` + c1=`mytranslate "Convert to format"` + choice=`zenity --list --height=$height --title="$title $target" --text="$text" --checklist --column "$s1" --column "$c1" $out` || exit 0 + ;; +esac +fi + +if [ -n "$choice" ] + then break +fi +done + +# was it OTHER? +case $choice in + OTHER_non-image) exec myavtext ;; + OTHER) title=`mytranslate "Output type"` + text=`mytranslate "Supply an appropriate file extension"` + choice=`zenity --entry --title="$title" --text="$text"` || exit 0 ;; +esac + +# clean up any _audio reference and any leading . in ext +choice=`echo $choice | sed -e 's/_.*//' -e 's/^\..*//'` + +# loop over (possibly multiple) choice(s) +# (THE OUTER LOOP) +for each in `echo $choice | sed 's/|/ /g'` +do + +# what will the destination filename be? +new=`echo $target | sed -e "s/.$ext$//" -e "s/$/.$each/"` + +if [ "$looping" = "n" ] + then +# set resolution here +# results into $dim, will look like "jpg|gif|pdf" +origrez=`echo "$ident" | sed "s/$target//"` +case $it in + text) title=`mytranslate "Dimensions"` + text=`mytranslate "Output dimensions for"` + text="$text \"$new\"\n\n" + text="$text"`mytranslate "This will be the dimension along the longer edge +(depending on portrait or landscape mode) + +Choose one or more. +(\"Original\" cannot be combined with other sizes)"` + c1=`mytranslate "Choose dimensions"` + dim=`zenity --list --height=520 --title="$title" --text="$text" --checklist --column "$s1" --column "$c1" FALSE 1280 FALSE 1024 FALSE 800 FALSE 640 FALSE 480 FALSE 320 FALSE 250 FALSE 200 FALSE 150 FALSE 100 FALSE "Something else"` || exit 0 + ;; + image) title=`mytranslate "Dimensions"` + text=`mytranslate "Output dimensions for"` + text="$text \"$new\"\n\n" + text="$text"`mytranslate "This will be the dimension along the longer edge +(depending on portrait or landscape mode) + +Choose one or more. +(\"Original\" cannot be combined with other sizes)"` + c1=`mytranslate "Choose dimensions"` + dim=`zenity --list --height=580 --title="$title" --text="$text" --checklist --column "$s1" --column "$c1" FALSE "Original dimensions" FALSE 1280 FALSE 1024 FALSE 800 FALSE 640 FALSE 480 FALSE 320 FALSE 250 FALSE 200 FALSE 150 FALSE 100 FALSE "Something else"` || exit 0 + ;; +esac +fi + +case "$dim" in + Original*) dim="" ;; + Something*) while true + do + text=`mytranslate "New size (along longer edge)"` + dim=`zenity --entry --text="$text"` || exit 0 + case $dim in + [0-9]*[0-9]) break ;; + *) ;; + esac + done ;; +esac + +# if $safedims is set and $dim is empty +# then set it to what we used last time +if [ -z "$dim" -a -n "$safedims" ] + then dims="$safedims" +fi +# parse $dim into $dims +case $dim in + '') dims=" " ;; + *) dims=`echo $dim | sed 's/|/ /g'` ;; +esac + +# and save these $dims for next time +safedims="$dims" +textdims=`mytranslate "Previously selected resolutions:"` +textdims="$textdims: $safedims" + +if [ "$looping" = "n" ] + then +# if this is a jpeg, ask for quality +case "$new" in + *jpg) title=`mytranslate "Quality"` + title="JPG $title" + text=`mytranslate "Choose quality for"` + text="$text \"$new\"" + qual=`zenity --list --height=290 --title="$title" --text="$text" --radiolist --column "$s1" --column "$title" FALSE 100 FALSE 90 FALSE 80 TRUE 70 FALSE 60 FALSE 50` || exit 0 ;; +esac + +# normalize and equalize +case $it in + image*) ntxt=`mytranslate "Adjust for full range of colors"` + etxt=`mytranslate "Adjust for full range of brightness"` + normeq=`zenity --list --height=190 --title="Normalize / Equalize" --text="Normalize: $ntxt\nEqualize: $etxt" --checklist --column "$s1" --column "$s2" FALSE normalize FALSE equalize` || exit 0 + case $normeq in + '') ;; + *) normeq=`echo "$normeq" | \ + sed 's/^/-/' | sed 's/|/ -/'` + case $normeq in + -normalize*) normeq=`echo "$normeq" | sed 's/-normalize/-separate -normalize -combine/'` + ;; + esac + ;; + esac + ;; +esac +fi + +# create arg to convert for quality +case "$new" in + *jpg) case $qual in + '') quality="-quality 70" ;; + *) quality="-quality $qual" ;; + esac ;; +esac + +# echo "$dir" +# echo "$outdir" + +case "$dims" in + *x*x*) ;; + *) case "$dir$overwrite" in + "$outdir") title=`mytranslate "Overwrite?"` + text=`mytranslate "Read carefully: + +MANY places in this program are designed to prevent accidentally overwriting +your original file(s). However, since you have chosen the source directory as +your destination AND chosen only one conversion, you have another option. +You can choose (with caution) to REPLACE ORIGINALS with the converted files. +In this case, the converted files will have the original name as well (instead +of inserting the resolution) but with the correct extension. + +Choose wisely..."` + c1=`mytranslate "Overwrite the original files in place?"` + overwrite=`zenity --list --title="$title" --height=340 --text="$text" --radiolist --column "$s1" --column "$c1" TRUE NO FALSE YES` || exit 0 + ;; + esac + ;; +esac + +# loop through all the $dims. +for rez in " "$dims +do +# THE INNER LOOP + +case "$rez" in + " ") geom="" ;; + *) rez=`echo $rez`; geom="-geometry $rez"x"$rez" + new=`echo $target | sed -e "s/.$ext$//" -e "s/$/.$rez.$each/"` ;; +esac +if test -s "$outdir/$new" + then title=`mytranslate "Choose a new Destination Name"` + text=`mytranslate "exists - Overwrite?"` + zenity --question --title="$text" --text="$new $text" || newout=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="$title"` || exit 0 + if [ ! -z "$newout" ] + then outdir=`dirname "$newout"` + new=`basename "$newout"` + fi +fi + +case $it in +text) # EXTRA stuff for TEXT to IMAGE + colorlist=`convert -list color | sed -n '/,/s/ .*//p' | sort -u` + colorlist=`echo " "$colorlist | sed 's/ / FALSE /g'` + if whereis kcolorchooser | grep / >/dev/null + then colorlist="FALSE GUI-\"kcolorchooser\" $colorlist" + else colortext=`mytranslate " + +Install the package \"kdegraphics\" to choose colors with a GUI"` + fi + colorlist="FALSE Key-in_RGB-value $colorlist" + # for OLD version of convert + # fontlist=`convert -list font | sed -n '/0$/s/ .*//p' | sort -u` + # for NEW version of convert + fontlist=`convert -list font | grep Font | sed 's/^.*://' | \ + sed -e 's/^ //g' -e 's/ $//' | sort -u` + fontlist=`echo " "$fontlist | sed 's/ / FALSE /g'` + sizelist=" 8 10 12 15 20 25 30 35 40 50 60 80 100 120 150 200 250 300" + sizelist=`echo "$sizelist" | sed 's/ / FALSE /g'` + + bg=`mytranslate "Background"` + title="$bg" + text=`mytranslate "Choose Background Color + +NOTE: If you use GUI chooser, the RGB values +will be shown in subsequent windows +for your reference."` + text="$text $colortext\n\n" + text=`mytranslate "ALSO NOTE: for some unknown reason +there is a long delay when GUI closes."` + c1=`mytranslate "Choose color"` + back=`zenity --list --height=500 --title="$title" --text="$text" --radiolist --column "$s1" --column "$c1" $colorlist` || exit 0 + case $back in + GUI-*) back=`kcolorchooser --print` ;; + _GUI*) text=`mytranslate "To choose colors using a GUI +interface, install the"` + text="$text \"kdegraphics\"" + text="$text "`mytranslate "package"` + zenity --info --title="kcolorchooser" --text="$text" + exit 0 + ;; + Key-*) title=`mytranslate "Key in color"` + text=`mytranslate "Enter the RGB color as"` + back=`zenity --entry --title="$title" --text="$text #RGB #RRGGBB #RRRGGGBBB #RRRRGGGGBBBB rgb(rrr,ggg,bbb)"` || exit 0 + ;; + esac + fg=`mytranslate "Foreground"` + title="$fg" + text=`mytranslate "Choose Foreground Color"` + fill=`zenity --list --height=500 --title="$title" --text="[$bg = $back]\n\n$text" --radiolist --column "$s1" --column "$c1" $colorlist` || exit 0 + case $fill in + GUI-*) fill=`kcolorchooser --print` ;; + _GUI*) kdeg=`mytranslate "To choose colors with a GUI +interface, install the \"kdegraphics\" package"` + zenity --info --title="kcolorchooser" --text="$kdeg"; exit 0 ;; + Key-*) title=`mytranslate "Key in color"` + text=`mytranslate "Enter the RGB color as"` + fill=`zenity --entry --title="$title" --text="$text: #RGB #RRGGBB #RRRGGGBBB #RRRRGGGGBBBB rgb(rrr,ggg,bbb)"` || exit 0 ;; + esac + title=`mytranslate "Border Width"` + text=`mytranslate "Choose Border Width"` + borw=`zenity --list --height=340 --title="$title" --text="[$bg = $back]\n[$fg = $fill]\n\n$text" --radiolist --column "$s1" --column "$text" FALSE 0 FALSE 5 FALSE 10 FALSE 20 FALSE 30 FALSE 50` || exit 0 + case $borw in + 0) borc=`mytranslate "transparent"` ;; + *) title=`mytranslate "Border Color"` + text=`mytranslate "Border Width"` + borc=`zenity --list --height=500 --title="$title" --text="[$bg = $back]\n[$fg = $fill]\n[$text = $borw]\n\n$title" --radiolist --column "$s1" --column "$title" $colorlist` || exit 0 ;; + esac + case $borc in + GUI-*) borc=`kcolorchooser --print` ;; + _GUI*) zenity --info --title="kcolorchooser" --text="$kdeg"; exit 0 ;; + Key-*) title=`mytranslate "Key in color"` + text=`mytranslate "Enter the RGB color as"` + borc=`zenity --entry --title="$title" --text="$text: #RGB #RRGGBB #RRRGGGBBB #RRRRGGGGBBBB rgb(rrr,ggg,bbb)"` || exit 0 ;; + esac + title=`mytranslate "Font"` + text=`mytranslate "Choose text font and style"` + font=`zenity --list --height=500 --title="$title" --text="[$bg = $back]\n[$fg = $fill]\n[Border width is $borw]\n[Border color is $borc]\n\n$text" --radiolist --column "$s1" --column "$title" $fontlist` || exit 0 + title=`mytranslate "Font Size"` + text=`mytranslate "Choose text font size"` + size=`zenity --list --height=500 --title="$title" --text="[$bg = $back]\n[$fg = $fill]\n[Border width is $borw]\n[Border color is $borc]\n[Font style is $font]\n\n$text" --radiolist --column "$s1" --column "$title" $sizelist` || exit 0 + textoptions="-background $back -fill $fill -border $borw -bordercolor $borc -font $font -pointsize $size label:@" + longestline=`cat "$target" | awk 'BEGIN {max[i]=0} + (length >= max[i]) {max[i] = length} + END {printf "%s\n", max[i]}'` + # horizrez=`echo -e "scale=0\n$rez * 8 / 11\nquit\n" | bc` + horizrez=$rez + maxpossible=`echo -e "scale=0\n$horizrez / $size\nquit\n" | bc` + # splitpieces=`echo -e "scale=0\n$longestline / $maxpossible\nquit\n" | bc` + newlength=`echo -e "scale=2\n$maxpossible * .9\nquit\n" | bc` + newlength=`echo "$newlength" | sed 's/\..*//'` + if [ "$longestline" -ge "$maxpossible" ] + then newtarget=`echo "$target" | sed "s/$ext$/wrap$newlength/"` + title=`mytranslate "Adjusting input file"` + text=`mytranslate "The source file \"1\" contains long lines. + +The longest line is 2 but the max possible with an +image width of 3 and a font size of 4 is 5. + +Creating an intermediate text file with a word wrap at +the first space after character position 6. + +This will get you APPROXIMATELY the +character size you asked for. +The intermediate file will contain the full text of 7. + +Intermediate file name is: 8"` + text=`echo "$text" | \ + sed -e "s/1/$target/" -e "s/2/$longestline/" \ + -e "s/3/$horizrez/" -e "s/4/$size/" \ + -e "s/5/$maxpossible/" -e "s/6/$newlength/" \ + -e "s/7/$target/" -e "s/8/$newtarget/"` + + zenity --info --title="$title" --text="$text" + sed "s/.\{$newlength\} /&\n/g" < "$target" > "$newtarget" + target="$newtarget" + fi + + linecount=`wc $target | awk '{print $1}'` + maxpossible=`echo -e "scale=2\n$rez / $size\nquit\n" | bc` + maxpossible=`echo -e "scale=2\n$maxpossible * 2 / 3\nquit\n" | bc` + maxpossible=`echo "$maxpossible" | sed 's/\..*//'` + + if [ "$linecount" -gt "$maxpossible" ] + then shorttarget=`echo $target | sed 's/$ext$//'` + title=`mytranslate "Adjusting input file"` + text=`mytranslate "The source file \"1\" contains too many lines. +Adjusting for a more normal aspect ratio. + +There are 2 lines, but the max possible +with a length of 3 and a size of 4 is 5. + +Splitting 6 into a set of files with 7 +lines in each. The resulting files will be processed. + +This will get you APPROXIMATELY the +character size you asked for. + +Intermediate files will be named 8"aa.txt", 8"ab.txt", 8"ac.txt", and so on."` + text=`echo "$text" | \ + sed -e "s/1/$target.txt/" -e "s/2/$lincount/" \ + -e "s/3/$rez/" -e "s/4/$size/" \ + -e "s/5/$maxpossible/" -e "s/6/$target.txt/" \ + -e "s/7/$maxpossible/" -e "s/8/$shorttarget/g"` + zenity --info --title="$title" --text="$text" + cat "$target" | split -$maxpossible - "$shorttarget" + targets=`ls $shorttarget??` + multiple=y + for each in `ls $shorttarget??` + do + mv "$each" "$each.txt" + done + fi + ;; +esac +#End of extra stuff for text to image + +# Now, do the actual conversion + +# usually just one target +targets="$target" + +# in a text->image that needed splitting will be multiple $targets +case $multiple in + y) count=1 + targets=`ls $shorttarget??*` + basenew="$new" ;; +esac + +echo "$targets" | \ +while read target +do +case $multiple in + y) case $count in + ?) count="00"$count ;; + ??) count="0"$count ;; + esac + new=`echo "$basenew" | sed "s/\....$/.$count&/"` + ;; +esac +text=`mytranslate "Working on"` +oldsize=`du -a -b "$target" | awk '{print $1}'` +avwatcher "$outdir/$new" "$prog" "$oldsize" $$ & +#convert -verbose $geom $quality $normeq $textoptions"$target" "$outdir/$new" 2>/tmp/convert.$$.$count | zenity --progress --text="$text $new" --auto-close --auto-kill --pulsate +convert -verbose $geom $quality $normeq $textoptions"$target" "$outdir/$new" >/tmp/convert.$$.$count 2>&1 +case $overwrite in + YES) rename=`echo "$target" | sed "s/$ext$/$each/"` + mv "$outdir/$new" "$rename" + rm "$target" ;; +esac +# ImagMagick/convert may call ufraw for camera raw images +# there is a new version of ufraw with slightly different options +# convert is using old options, causing a "deprecated" complaint +# but the results are good as old options are still accepted. +cleanup=`egrep -v "deprecated|ppm16" /tmp/convert.$$.$count` >/tmp/$$ +mv /tmp/$$ /tmp/convert.$$.$count +if test -s /tmp/convert.$$.$count + then message=`cat /tmp/convert.$$.$count` + text=`mytranslate "An error occured during the conversion + +The message was: "` + zenity --info --text="$text $message" & + else rm -f /tmp/convert.$$.$count +fi + +case $multiple in + y) count=`expr $count + 1` ;; +esac +# end of multiple $targets loop +done + +# end of inside loop for $rez +done +# end of outside loop for $dims +done + +# convert -verbose $geom $quality $textoptions"$target" "$outdir/$new" 2>/tmp/convert.$$.$count | zenity --progress --text="Working on $new" --auto-close --auto-kill --pulsate + +case $autoloop in + y) echo " + choice=\"$choice\" + dim=\"$dim\" + dims=\"$dims\" + geom=\"$geom\" + qual=\"$qual\" + textoptions=\"$textoptions\" + normeq=\"$normeq\" + " > /tmp/avconvert.env ;; +esac +} +# end of avconvert + + + +##### +# ffmpeg +##### +myavffmpeg() { +# +# processing audio and video + +# set -x +# this is for looping after the first item, using the env for settings +looping=n +if test -s /tmp/avffmpeg.env + then . /tmp/avffmpeg.env + looping=y +fi + +# set up output extensions +case $av in + video) out=" 3gp asf avi flv mp4 mov mpg rm wmv m4a_audio_only mp3_audio_only wav_audio_only wma_audio_only jpeg_frames OTHER" + height=650 ;; + audio) out=" m4a mp3 wav wma OTHER" + height=360 ;; +esac + +out=`echo "$out" | sed -e 's/ $ext //' -e "s/ / FALSE /g"` + +# loop for output conversion type +if [ "$looping" = "n" ] + then +while true +do +title=`mytranslate "Convert"` +text1=`mytranslate "Source file information"` +text2=`mytranslate "Choose OTHER for an output type not listed"` +choice=`zenity --list --height=$height --title="$title $target" --text="$text1 $show\n$ffident\n\n$text2" --radiolist --column "$s1" --column "$title" $out` || exit 0 + +if [ -n "$choice" ] + then break +fi +done +fi + +# was it OTHER? +case $choice in + OTHER) title=`mytranslate "Output type"` + text=`mytranslate "Supply a valid file extension, example "` + choice=`zenity --entry --title="$title" --text="$text ogg / vob"` || exit 0 ;; +esac + + +case $choice in + *_audio*) av=audio; choice=`echo $choice | sed 's/_.*//'` ;; + *_frames) av=frame; choice=`echo $choice | sed 's/_.*//'` + outf=`echo $choice | awk -F_ '{print $1}'` + title=`mytranslate "Frame capture"` + text=`mytranslate "Number of frames to capture per second. +The source file FPS is shown above."` + step=`zenity --scale --title="$title" --text="$show\n$ffident\n\n$text" --value=1 --min-value=0 --max-value=60 --step=1` || exit 0 + # step="1/$step" + ;; +esac + +# we now have the output type + +# ffmpeg options from options files +## SEED THE FILES IF NOT PRESENT +# recreate the audio and video files, create custom if not present + +cat < ~/.config/avconvert/avconvert.ffopts.audio +# ~/.config/avconvert/avconvert.ffopts.audio +# +# Do *NOT* put your own options here - they will be overwritten! +# +# Use ~/.config/avconvert/avconvert.ffopts.custom instead +# +TRUE AUDIO-CODEC-UNCHANGED +FALSE acodec-ac3 +FALSE acodec-mp2 +FALSE acodec-libmp3lame +TRUE AUDIO-SAMPLE-RATE-UNCHANGED +FALSE ar-44100 +FALSE ar-22050 +TRUE AUDIO-BITRATE-UNCHANGED_default=64k +FALSE ab-128k +TRUE VOLUME-UNCHANGED_default=256 +FALSE vol-512 +!audio + +cat < ~/.config/avconvert/avconvert.ffopts.video +# ~/.config/avconvert/avconvert.ffopts.video +# +# Do *NOT* put your own options here - they will be overwritten! +# +# Use ~/.config/avconvert/avconvert.ffopts.custom instead +# +TRUE VIDEO-SIZE-UNCHANGED#you_choose_width/height_will_be_calculated/aspect_retained +FALSE w-128 +FALSE w-320 +FALSE w-640 +TRUE NO-ROTATION#rotation_requires_mencoder +FALSE rotate-right +FALSE rotate-left +TRUE DO-NOT-LETTERBOX#choose_aspect_of_your_player_to_avoid_stretching +FALSE d-1.3333#4:3 +FALSE d-1.5#Apple_iPhone +FALSE d-1.7778#16:9 +TRUE VIDEO-CODEC-UNCHANGED +FALSE vcodec-libx264 +FALSE vcodec-mjpeg +FALSE vcodec-mpeg2video +!video + +[ ! -f ~/.config/avconvert/avconvert.ffopts.custom ] && \ +cat < ~/.config/avconvert/avconvert.ffopts.custom +# ~/.config/avconvert/avconvert.ffopts.custom +# +# The purpose of THIS file is that you can create option-sets that +# you use often, and apply them with a single click in avconvert +# +# This file will NOT be overwritten by updates, but if you remove it then +# a new one will be created with all new options from the latest release +# +# There MUST be only two "words" per line, separated by a space +# TRUE or FALSE followed by an option. The option has the "-" moved +# so that "-option parameter" becomes "option-paramater". +# These can be combined by separating them with "~", as in +# option1-parameter~option2-paramater +# A comment may be added by following options with "#comment" as in +# option1-parameter~option2-parameter#My-Comment-here +# s-640x480~vcodec-mpeg2video#my_custom_options +# But there must be ONLY ONE space in each line +# +# An option for SIZING (-w) is NOT actually an ffmpeg option. The real +# size option is "-s WWWxHHH" where WWW and HHH are width and height and +# would be written in an ffopts file as "s-WWWxHHH". However, both here +# and in ffopts.custom and ffopts.submissions, this script will use the +# "-w WWW" (w-WWW) to trigger automatic resizing of the height to preserve +# the original aspect ratio. The supplied and calculated values will also +# be rounded down to the nearst multiple of 2 pixels +# +# The DISPLAY option (-d) is ALSO not a true ffmpeg option. It will be +# used to determine if the video needs to be letterboxed so that aspect +# ration is preserved when played on your device. So regardless of SIZE, +# if the original aspect does not match your specified DISPLAY, the math +# will be done for you and black bands added to make the video fit. +# Again, this form may also be used in .custom and .submissions files. + +TRUE NO-CUSTOM-OPTIONS_these.are.created.using.KEY-IN +FALSE s-640x480~vcodec-mpeg2video~acodec-mp2#Sample_custom_command +!custom + +grep tsi-inc ~/.config/avconvert/avconvert.ffopts.custom >/dev/null || cat <> ~/.config/avconvert/avconvert.ffopts.custom +# +# One more thing: if you come up with some handy (or necessary) option +# sets for specific conversions and submit them to me, I will start +# maintaining a ~/.config/avconvert/avconvert.ffopts.submissions file and +# regularly post it for download. +# Just email me your option line in the format below. +# Include a comment section, and describe the circumstances that require +# it. For example "when the input file is *.xxx and the output file is +# *.yyy and ffmpeg identifies the audio stream as zzz. +# Send submissions to: tsi-inc@comcast.net +# and include "avconvert submission" in the subject line. +!message +cat < ~/.config/avconvert/avconvert.ffmpeg-help +NOTE: an option like "-ss 60 -t 30" (seek in 60 seconds and record 30 seconds) +would be written in ~/.config/avconvert/avconvert.ffopts* as: + ss-60~t-30#seek-60_record-30 +but here, use standard command-line syntax, like this: + -ss 60 -t 30 + +-t time "time" is in seconds OR HH:MM:SS.xxx stop recording after "time" +-fs NNN "filesize" in bytes stop recording at this "size" +-f FFF format as in "rawvideo" "oss" +-ss time "time is in seconds OR HH:MM:SS start recording at "time" +-target eg. "vcd" "dvd" "ntsc" sets all appropriate options for this type +-b rate video bitrate in bit/s default "200 kb/s" (200000) +-r fps video frames per second in HZ default "25" fps +-s size frame size HHHxVVV (default is retain original) HORIZONTALxVERTICAL size +-aspect 4:3 16:9 1.3333 1.7777 +-croptop NN crop NN pixels from the top produces a band +-cropbottom -cropleft -cropright (see croptop) +-padtop NN pad NNN pixels on the top produces a band +-padbottom -padleft -padright (see padtop) +-padcolor H 6-digit HEX value (eg 000000) for padded bands +-vcodec CC CC is codec name as in "libxvid" "mpeg4" +-pass N N = 1 or 2 1-pass or 2-pass vid encoding +-ilme (MPEG-2/4) if input interlaced, retain it for higher quality +-ar NNN audio sample frequency 44100/22050/11025 default 44100 +-ab NNN audio birate in bit/s default 64k +-ac N number of audio channels default 1 +-an disable audio recording +-acodec CCC audio codec name as in "ac3" "mp2" +-tvstdc SSS set TV standard to NTSC PAL SECAM +-shortest finish recording when shortest input stream ends + +Not OFFICIALLY ffmpeg options, but handled by avconvert: + +-w WWW specify a new video width, height is calculated for you +-d A.AAAA specify the HxW ratio of a display device for letterboxing to preserve aspect ratio +!ffmpeghelp + +## END OF SEEDING THE FILES +# THE WORK STARTS HERE... + +# If we are NOT in a loop, ask for options... +if [ "$looping" = "n" ] + then +case $av in + audio) storedopts=`cat ~/.config/avconvert/avconvert.ffopts.audio ~/.config/avconvert/avconvert.ffopts.custom ~/.config/avconvert/avconvert.ffopts.submissions 2>/dev/null` ;; + video) storedopts=`cat ~/.config/avconvert/avconvert.ffopts.audio ~/.config/avconvert/avconvert.ffopts.video ~/.config/avconvert/avconvert.ffopts.custom ~/.config/avconvert/avconvert.ffopts.submissions 2>/dev/null` ;; +esac +storedopts=`echo "$storedopts" | sed 's/^#.*//'` + +title=`mytranslate "More options"` +text1=`mytranslate "Source file:"` +text2=`mytranslate "Select a combination of options, or leave any UNCHANGED. +You may choose options here AND click KEY-IN-OPTIONS. The selected and keyed options will both be used. +There is a help page for key-in options. + +These options are stored in ~/.config/avconvert/avconvert.ffopts* +You can modify the avconvert.ffopts.custom file, which will not be overwritten. +Use your favorite text editor and follow instructions contained in that file."` +c1=`mytranslate "Choose ONLY ONE from each category"` + +ffopts=`zenity --list --height=600 --title="$title" --text="$text1 $target\n$ffident\n\n$text2" --checklist --column "$s1" --column "$c1" $storedopts FALSE KEY-IN-OPTIONS` || exit 0 + +if echo "$ffopts" | grep KEY-IN-OPTIONS >/dev/null + then title=`mytranslate "Quick list of ffmpeg options"` + zenity --info --no-wrap --title="FFMPEG: $title" --text="`cat ~/.config/avconvert/avconvert.ffmpeg-help`" 2>/dev/null & + sleep .5 + zpid=`ps -ef | grep -v grep | grep -e "--title=FFMPEG:" | \ + awk '{print $2}'` + title=`mytranslate "Key in your options"` + text=`mytranslate "Examples (leave blank for none) +"` + text2=`mytranslate " + +If you add a comment, then your options will be saved for future use +in ~/.config/avconvert.ffopts.custom. Example: "` + text3=`mytranslate "My favorite"` +dopts=`echo "$ffopts" | tr '|' '\012' | sed 's/^[A-Z].*//' | grep -v '^$'` +dopts=`echo "$dopts" | sed -e 's/^/ /' -e 's/#.*//'` +dopts=`echo "$dopts" | sed -e 's/~/ /g' -e 's/-/~/g' -e 's/ / -/g' -e 's/~/ /g'` +case "$dopts" in + " -") dopts="" ;; +esac + keyin=`zenity --entry --title="$title" --text="$text -acodec mpeg3 -vcodec libx264 -ab 320k$text2 -acodec mpeg2 -vcodec libx264 # $text3 + +Current ffmpeg options: $dopts"` + kill -15 $zpid >/dev/null 2>&1 + if echo "$keyin" | grep "#" >/dev/null + then + opt=`echo "$keyin" | sed -e 's/ */ /g' -e 's/^ //'` + com=`echo "$opt" | sed -e 's/^.*#//' \ + -e 's/^ //' -e 's/ $//' -e 's/ /_/g'` + opt=`echo "$opt" | sed 's/#.*//'` + for word in $opt + do + case $word in + -*) line=$line`echo $word | sed 's/-//'` ;; + *) line=$line-$word~ ;; + esac + done + line=`echo "$line#$com" | sed 's/~#/#/'` + echo "FALSE $line" >> ~/.config/avconvert/avconvert.ffopts.custom + keyin=`echo "$keyin" | sed 's/#.*//'` + fi +fi + +# manage the SPECIAL options for resizing and letterboxing +size=`echo "$ffident" | grep Video | awk '{print $6}'` #current size per ffmpeg +size=`echo $size | sed 's/,//'` +curw=`echo $size | sed 's/x.*$//'` #current width +oldw=$curw +curh=`echo $size | sed 's/^.*x//'` #current height +cura=`echo -e "scale=2\n$curw / $curh\nquit" | bc` #current aspect +wopt=`echo "$ffopts" | grep "w-" | sed 's/^.*w-//' | \ + sed -e 's/|.*//' -e 's/#.*//'` #new width +neww=$wopt +disp=`echo "$ffopts" | grep "d-" | sed 's/^.*d-//' | \ + sed -e 's/|.*//' -e 's/#.*//'` #disp asp +if [ ! -z "$neww" ] + then neww=`expr $neww / 2 \* 2` #round down + scale=`echo -e "scale=5\n$curw / $neww\nquit" | bc` #height chg + newh=`echo -e "scale=5\n$curh / $scale\nquit" | bc` # new HHH + newh=`echo $newh | sed 's/\..*//'` #integer + newh=`expr $newh / 2 \* 2` #round down + curh=$newh #new HHH + oldw=$curw + curw=$neww + nopt="$neww"x"$newh" #WWWxHHH string + ffopts=`echo "$ffopts" | sed "s/w-$wopt/s-$nopt/"` #substitute +fi + +if [ ! -z "$disp" ] +then # *10000 and remove decimal, so "test" can treat as integer + # which aspect is wider? to calculate padding + curam=`echo -e "scale=5\n$cura * 10000\nquit" | bc` + dispm=`echo -e "scale=5\n$disp * 10000\nquit" | bc` + curam=`echo $curam | sed 's/\..*//'` + dispm=`echo $dispm | sed 's/\..*//'` + if [ "$cura" != "$disp" ] + then if [ "$curam" -ge "$dispm" ] + then # current aspect is wider than target aspect + # pad top and bottom + xtra=`echo -e "scale=5\n$cura / $disp * $curh\nquit" | bc` #dots + pad=tb + else # target aspect is wider than current aspect + # pad left and right + xtra=`echo -e "scale=5\n$disp / $cura * $curw\nquit" | bc` #dots + pad=lr + fi + # $xtra is the total dots HHH or WWW in display aspect + xtra=`echo $xtra | sed 's/\..*//'` #integer + # ACTUAL pad is $xtra - soze-of-image + case $pad in + tb) xtra=`expr $xtra - $curh + 1` ;; #subtract HHH + lr) xtra=`expr $xtra - $curw + 1` ;; #subtract WWW + esac + # the padding should be half/half either L/R or T/B + xtra=`expr $xtra / 2` #top/bottom + xtra=`expr $xtra / 2 \* 2` #round down + # create command option + case $pad in + tb) padding="padtop-$xtra|padbottom-$xtra" ;; + lr) padding="padleft-$xtra|padright-$xtra" ;; + esac + ffopts=`echo "$ffopts" | \ + sed "s/d-$disp/$padding|aspect-$disp/"` + fi +fi +## end of aspect and padding section + +ffopts=`echo "$ffopts" | tr '|' '\012' | sed 's/^[A-Z].*//' | grep -v '^$'` +if echo "$ffopts" | grep rotate >/dev/null + then rotate=`echo "$ffopts" | grep rotate` + ffopts=`echo "$ffopts" | grep -v rotate` + case $rotate in + *right) rotate=1 ;; + *left) rotate=2 ;; + esac +fi +ffopts=`echo "$ffopts" | sed -e 's/^/ /' -e 's/#.*//'` +ffopts=`echo "$ffopts" | sed -e 's/~/ /g' -e 's/-/~/g' -e 's/ / -/g' -e 's/~/ /g'` +case "$ffopts" in + " -") ffopts="" ;; +esac + +ffopts="$ffopts $keyin" +# echo -e "\n\nThe final ffmpeg options look like this:\n" +# echo $ffopts + +# END OF OPTION-SETTING +fi + +new=`echo $target | sed "s/$ext$/$dot$choice/"` + +case $av in + frame) new="$target.frame-%04d.$outf" + specialopts="-f image2 -r $step" ;; +esac + +case $new in + *3gp) x264=`ls /usr/lib/*x264* | sed 's/\..*//' | head -1` + x264=`basename $x264` + specialopts="-vcodec $x264 -acodec libfaac" ;; + *flv) case "$ffopts" in + *-ar*) ;; + *) ar=`echo "$ffident" | grep Audio | \ + awk -F, '{print $2}' | + sed -e 's/Hz//' -e 's/ //g'` + if [ "$ar" -gt "11025" ] + then nr=11025 + fi + if [ "$ar" -gt "22050" ] + then nr=22050 + fi + if [ "$ar" -gt "44100" ] + then nr=44100 + fi + ffopts="$ffopts -ar $nr" + ;; + esac +esac + +case "$outdir/$new" in + "$dir/$target") title=`mytranslate "Destination file has the same name as source!! Choose a new name"` + newout=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="$title"` || exit 0 + outdir=`dirname "$newout"` + new=`basename "$newout"` + ;; +esac + +if test -s "$outdir/$new" + then text=`mytranslate "exists - Overwrite? + +(OK to overwrite, Cancel to supply a new name)"` + zenity --question --text="$outdir/$new $text" || newout=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="Choose a new file/folder"` || exit 0 + if [ ! -z "$newout" ] + then outdir=`dirname "$newout"` + new=`basename "$newout"` + fi +fi + +oldsize=`du -a -b "$target" | awk '{print $1}'` +echo "oldsize = $oldsize" +case $rotate in + ?) tempfile=`echo "$target" | sed 's/^/rotate-/'` + avwatcher "$outdir/$tempfile" "mencoder" "$oldsize" $$ & + mencoder -vf rotate=$rotate -o "$outdir/$tempfile" -oac copy -ovc lavc "$target" + target="$outdir/$tempfile" + oldsize=`du -a -b "$target" | awk '{print $1}'` + ;; +esac + +avwatcher "$outdir/$new" "$prog" "$oldsize" $$ & + +echo -e "ffident:\n$ffident\n" >/tmp/ffmpeg.$$ +echo "ffmpeg command as executed:" >>/tmp/ffmpeg.$$ +echo ffmpeg -y -i "$target" $vol $specialopts $ffopts "$outdir/$new" >>/tmp/ffmpeg.$$ +echo >>/tmp/ffmpeg.$$ +# set -x +ffmpeg -y -i "$target" $vol $specialopts $ffopts "$outdir/$new" 2>&1 | tr '=' '\012' >> /tmp/ffmpeg.$$ + +case $rotate in + ?) echo "mencoder rotated original file to $outdir/$tempfile" >>/tmp/ffmpeg.$$ + if test -s "/tmp/$tempfile" + then : it worked + else echo "but that operation failed" >>/tmp/ffmpeg.$$ + fi ;; +esac + +result=`tail -5 /tmp/$prog.$$` +result="$result + +The full text output from this conversion is in /tmp/$prog.$$ +" + +grep "lame: output buffer too small" /tmp/ffmpeg.$$ && note=`mytranslate " +The message about libmp3lame buffer is meaningless. +If that is the only complaint message, the conversion did work."` + +grep "bitrate tolerance too small" /tmp/ffmpeg.$$ && note=`mytranslate " +The message about bitrate tolerance too small is due +to the way ffmpeg works. Seconds between frames can not be +larger than about 2/3 of the frames per second in the video. + +POSSIBLE SOLUTION: Specify a smaller seconds between frames"` + +grep "does not support" /tmp/ffmpeg.$$ && note=`mytranslate " +ffmpeg requires more/different options for this conversion + OR +your source file is unusual and requires special options + +POSSIBLE SOLUTIONS: + specify a video or audio codec + specify a sample rate + specify a different output size"` + +newsize=`du -a -b "$new" | sed 's/ .*//'` +# show results summary +case $quiet in + y) notify="--notification --window-icon=/usr/share/zenity/zenity-progress.png" + cp /usr/share/zenity/zenity.glade.progress-under /usr/share/zenity/zenity.glade 2>/dev/null ;; + n) notify="--info" + cp /usr/share/zenity/zenity.glade.progress-over /usr/share/zenity/zenity.glade 2>/dev/null ;; +esac + +title=`mytranslate "Conversion results"` +text=`mytranslate "Last message in"` +text2=`mytranslate "File size:"` +zenity $notify --title="$title" --text="$target --> $new +$text2 $newsize +$note + +$prog $text /tmp/$prog.$$: +$result" & +sleep .25 +zpid=`ps -ef | grep -v grep | grep -e "--notification" | awk '{print $2}'` +(sleep 60; kill -9 $zpid >/dev/null 2>&1) + +case $autoloop in + y) echo -e "choice=\"$choice\"\nbits=\"$bits\"" > /tmp/avffmpeg.env ;; +esac +} +# end of ffmpeg + + +##### +# ISO conversions +##### +myaviso() { + +case $it in + bchunk) + whereis bchunk | grep / >/dev/null || exec zenity --warning --text="Must install \"bchunk\" package first!" + tracks=`grep TRACK $base.cue | awk '{print $2}'` + zenity --question --text="BIN/CUE to ISO conversion\nCUE shows tracks $tracks\nProgress will be idicated for first track only\nwhich will be named "$base"01.iso" || exit 0 + new="$outdir/$base" + if test -s "$new"01.iso + then zenity --question --text="$new"01.iso" exists - Overwrite?" || new=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="Choose a new file/folder"` || exit 0 + fi + prog=bchunk + oldsize=`du -a -b "$base.bin" | awk '{print $1}'` + avwatcher "$new"01.iso "$prog" "$oldsize" $$ & + bchunk "$base.bin" "$base.cue" "$new" >/tmp/bchunk.$$ 2>&1 + ;; + daa*|nrg*|b?i*|cdi*|mdf*|pdi*|ccd*|uif*) + whereis $it | grep / >/dev/null || exec zenity --warning --text="No program \"$it\" found for processing \"$target\"!\n\nFor ISO conversions, install one or more of these packages...\n\nAcetoneISO for: b5i cdi mdf nrg pdi\nnrg2iso for: nrg\ndaa2iso for: daa\nbchunk for: bin/cue\nccd2iso for: cdd\nuif2iso for: uif\n\ncdd2iso is available at: sourceforge.net/projects/ccd2iso\nuif2iso is available at: aluigi.altervista.org/mytoolz.htm\n\nthe rest are in the repositories." + base=`echo $target | sed 's/....$//'` + zenity --question --text="Source file is $target\n$ext to ISO conversion\nwhich will be named $base.iso" || exit 0 + new="$outdir/$base".iso + if test -s "$new".iso + then zenity --question --text="$new".iso" exists - Overwrite?" || new=`zenity --file-selection --filename="$outdir/$new" --save --confirm-overwrite --title="Choose a new file/folder"` || exit 0 + new="$new".iso + fi + prog=$ext"2iso" + oldsize=`du -a -b "$target" | awk '{print $1}'` + avwatcher "$new" "$prog" "$oldsize" $$ & + case $ext in + b?i|pdi) new="" ;; + esac + $prog "$target" "$new" >/tmp/$prog.$$ 2>&1 + ;; +esac + +} +# end of iso conversions +##### +# Text conversions +##### +myavtext() { +# +# processing text between formats and into other things + +# set -x + +case $it in + text) # image->avconvert sound->espeak html->txt2tags + out=" image sound html"; height=300 ;; + doc) # text->antiword + out=" text"; height=300 ;; + rtf) # text->unrtf html->unrtf + out=" text html"; height=300 ;; + odt) # text->odt2txt xml->odt2txt + out=" text xml"; height=300 ;; +esac + +out=`echo "$out" | sed -e 's/ $ext //' -e "s/ / FALSE /g"` + +# loop for output conversion type +while true +do +title=`mytranslate "Convert"` +text=`mytranslate "Source file format"` +text2=`mytranslate "Convert to format"` +choice=`zenity --list --height=$height --title="$title $target" --text="$text $show\n$ffident\n" --radiolist --column "$s1" --column "$text2" $out` || exit 0 + +if [ -n "$choice" ] + then break +fi +done + +# pre-check for installed application +case $it$choice in + textsound) if ! whereis espeak | grep / >/dev/null + then zenity --warning --title=HELP --text="\"espeak\" package needs to be installed" + exit 0 + fi ;; + texthtml) if ! whereis txt2tags | grep / >/dev/null + then zenity --warning --title=HELP --text="\"txt2tags\" package needs to be installed" + exit 0 + fi ;; + doctext) if ! whereis antiword | grep / >/dev/null + then zenity --warning --title=HELP --text="\"antiword\" package needs to be installed" + exit 0 + fi ;; +esac + +case $it$choice in + textimage) prog=convert; myavconvert 2>/tmp/avconvert.debug ;; + textsound) title=`mytranslate "Language"` + text=`mytranslate "Choose a language for pronunciation"` + pronun=`zenity --list --height=500 --title="$title" --text="$text" --radiolist --column "$s1" --column "$title" FALSE af_afrikaans FALSE bs_bosnian FALSE cs_czech FALSE cy_welsh FALSE de_german FALSE el_greek TRUE en_english FALSE es_spanish FALSE fi_finnish FALSE fr_french FALSE hi_hindi FALSE hr_croatian FALSE hu_hungarian FALSE is_icelandic FALSE it_italian FALSE la_latin FALSE mk_macedonian FALSE nl_dutch FALSE no_norwegian FALSE pl_polish FALSE pt_brazil FALSE ro_romanian FALSE ru_russian FALSE sk_slovak FALSE sr_serbian FALSE sv_swedish FALSE sw_swahihi FALSE vi_vietnam FALSE zh_Mandarin` || exit 0 + pronun=`echo $pronun | sed 's/_.*//'` + title=`mytranslate "Voice"` + text=`mytranslate "Choose voice to use"` + voice=`zenity --list --height=400 --title="$title" --text="$text" --radiolist --column "$s1" --column "$title" FALSE m1_male-1 FALSE m2_male-2 FALSE m3_male-3 FALSE m4_male-4 FALSE f1_female-1 TRUE f2_female-2 FALSE f3_female-3 FALSE f4_female-4 FALSE croak FALSE whisper` || exit 0 + voice=`echo $voice | sed 's/_.*//'` + text=`mytranslate "Pitch"` + pitch=`zenity --scale --text="$text" --min-value=0 --max-value=99 --value=50` || exit 0 + text=`mytranslate "Speed"` + speed=`zenity --scale --text="$text" --min-value=0 --max-value=99 --value=43` || exit 0 + speed=`expr $speed \* 4` + new=`echo "$target" | \ + sed -e 's/.txt$//' -e 's/$/.wav/'` + oldsize=`du -a -b "$target" | awk '{print $1}'` + avwatcher "$outdir/$new" "$prog" "$oldsize" $$ & + cat "$target" | espeak --stdin -v$pronun+$voice -p $pitch -s $speed -w "$outdir/$new" >/tmp/espeak.$$ 2>&1 + ;; + texthtml) new=`echo "$target" | \ + sed -e 's/.txt$//' -e 's/$/.html/'` + oldsize=`du -a -b "$target" | awk '{print $1}'` + avwatcher "$outdir/$new" "$prog" "$oldsize" $$ & + txt2tags --infile="$target" --outfile="$outdir/$new" -t xhtml >> /tmp/txt2tags.$$ 2>&1 + if test -s /tmp/txt2tags.$$ + then title=`mytranslate "program output"` + zenity --info --title="txt2tags $title" --text=`cat /tmp/txt2tags.$$` + fi + rm -f /tmp/txt2tags.$$ + ;; + doctext) new=`echo "$target" | \ + sed -e 's/.doc$//' -e 's/$/.txt/'` + title=`mytranslate "Options"` + text=`mytranslate "Include either of these? + +r = \"revisioning text\" +s = \"hidden text\""` + text2=`mytranslate "Embedded text"` + incl=`zenity --list --height=300 --title="$title" --text="$text" --checklist --column "$s1" --column "$text2" FALSE r FALSE s ` || exit 0 + case $incl in + '') ;; + *) opts=`echo "$incl" | sed 's/|/ /g' | \ + sed 's/^/ /' | sed 's/ / -/g'` ;; + esac + oldsize=`du -a -b "$target" | awk '{print $1}'` + avwatcher "$outdir/$new" "$prog" "$oldsize" $$ & + antiword $opts "$target" > "$outdir/$new" 2>>/tmp/antiword.$$ + if test -s /tmp/antiword.$$ + then zenity --info --title="antiword output" --text=`cat /tmp/antiword.$$` + fi + rm -f /tmp/antiword.$$ + ;; + *) text=`mytranslate "Not ready yet"` + zenity --info --title="OOPS!" --text="$text"; exit 0 ;; + +esac +} +# end of text + +##### +# Initial script +##### +PATH=$PATH:.; export PATH + +# check some stuff first... +# have we been renamed? +case `basename $0` in + avconvert) ;; + *) exec xterm -hold -geometry 70x2 -bg red -T "Please rename the script back to 'avconvert'" -e true ;; +esac +# if zenity is not installed, use xterm to display a warning +whereis zenity | grep / >/dev/null || exec xterm -hold -geometry 50x2 -bg red -T "OOPS! Must install zenity first!" -e true +# if imagemagick is not installed, display warning +whereis convert | grep / >/dev/null || exec zenity --warning --text="Must install \"ImageMagick\" package first!" +# if ffmpeg is not installed, display warning +whereis ffmpeg | grep / >/dev/null || exec zenity --warning --text="Must install \"ffmpeg\" package first!" + +# the config files are now moved.... +mkdir -p ~/.config/avconvert +if test -f ~/.avconvert + then for each in ~/.avconvert* + do + new=`echo "$each" | sed 's/^.*\/.//'` + mv $each ~/.config/avconvert/$new + done +fi + +# translation + +langlist=`curl --connect-timeout 2 -m 2 --retry 2 -s -A "Mozilla/5.0" \ + -d "hl=en" -d "ie=UTF8" -d text="testing" -d "langpair=en|de" \ + http://translate.google.com/translate_t | \ + gawk -F">Detect language<" '{print $2}' | tr ' ' '\012' | \ + grep "value=\".*\">" | egrep -v "input|Contribute|Tests|^$" | \ + sed -e 's/^value="//' -e 's/<.*//' -e 's/">/=/' | grep -v "^=$" | \ + sort | uniq` + +dlang=`echo "$LANG" | sed 's/_.*//'` +langlist=`echo "$langlist" | sed -e 's/^/FALSE /' -e "/ $dlang=/s/FALSE/TRUE/"` + +online=n +echo "$langlist" | grep English >/dev/null && online=y + +# if language preference file is out of date, remove it +if grep "lang=" ~/.config/avconvert/avconvert.lang >/dev/null 2>&1 + then : + else rm -f ~/.config/avconvert/avconvert.lang +fi + +# requirements for translations +if whereis curl | grep / >/dev/null + then curlok=y + else curlok=n; text="$text\n\tcurl" +fi +if whereis elinks | grep / >/dev/null + then linksok=y; links=elinks + else if whereis links | grep / >/dev/null + then linksok=y; links=links + else linksok=n; text="$text\n\telinks -OR- links" + fi +fi + +# if we are not online, do not ask about language +if [ "$online" = "n" ] + then lang=en + else +# check language +if test -s ~/.config/avconvert/avconvert.lang + then . ~/.config/avconvert/avconvert.lang + case $curlok$linksok in + *n*) if [ "$lang" = "en" ] + then : ok + else zenity --info --title="Required for translation" --text="Please install$text\nfor translation" + lang="en" + fi + ;; + esac + export lang service + else lang=`zenity --list --height=520 --title="Language" --text="Choose language for all text" --radiolist --column="Select" --column="Language" $langlist` || exit 0 + lang=`echo $lang | sed 's/=.*//'` + echo "lang=$lang" > ~/.config/avconvert/avconvert.lang + export lang + if [ "$lang" = "en" ] + then online=n + else text="Please install the package(s):\n" + case $curlok$linksok in + *n*) zenity --info --title="Packages needed" --text "$text\n\nfor the translation feature.\nProceeding in English until installed." + online=n ;; + esac + + service=`zenity --list --title="Service" --text="Which service should be used" --radiolist --column="Select" --column="Language" TRUE google FALSE babel` || exit 0 + echo "service=$service" >> ~/.config/avconvert/avconvert.lang + export lang service + fi + title=`mytranslate "Language Preference"` + text=`mytranslate "When the internet is available, this script will +send text through the translation service. + +If there is no internet connection, everything will be in English. +If the internet is slow, translations may not work well. Please +tell me if there are problems so that I can improve this. + +Your language is stored in ~/.config/avconvert/avconvert.lang +Remove or edit that file to change language."` + [ "$lang" = "en" ] && text="You have chosen to display text in English. + +You can change the language by editing or removing +~/.config/avconvert/avconvert.lang" + zenity --info --title="$title" --text="$text" +fi +fi + +# if language is EN, we do not need to translate +case $lang in + en) online=n ;; +esac + +if grep "trash=" ~/.config/avconvert/avconvert >/dev/null 2>&1 + then : UP TO DATE + else rm -f ~/.config/avconvert/[Aa]vconvert +fi + +if test -s ~/.config/avconvert/avconvert + then : defaults already set + else echo -e "destdir=n\nautoloop=n\nzenityfix=n\nquiet=n\ntrash=n" > ~/.config/avconvert/avconvert + title=`mytranslate "Set Defaults"` + text=`mytranslate "This is your first run of avconvert. + +The file ~/.config/avconvert/avconvert can save some default behaviors. You can create one now by selecting from the options below, +and you can change it at any time by editing it directly or by removing it, which will trigger this dialogue to reappear. + +Read each option below and choose your prefrence followed by OK, or click Cancel to defer this until later."` + p1=`mytranslate "Always pop up to ask for a destination into which to save converted files"` + p2=`mytranslate "When multiple files are selected, process each one in the same way"` + p3=`mytranslate "Check zenity defaults and offer to fix them so popups are OVER rather than UNDER"` + p4=`mytranslate "Quiet mode - use 'notification' instead of 'info' to show some conversion results"` + p5=`mytranslate "After conversions, offer to move originals to ~/Desktop/avconvert-Trash"` + behavior=`zenity --list --height=350 --title="$title" --text="$text" --checklist --column="" --column="Description" TRUE "$p1 (destdir=y)" TRUE "$p2 (autoloop=y)" TRUE "$p3 (zenityfix=y)" TRUE "$p4 (quiet=y)" FALSE "$p5 (trash=n)"` || exit 0 +echo "$behavior" | tr '|' '\012' | sed -e 's/^.*(//' -e 's/.$//' | grep "=" >> ~/.config/avconvert/avconvert + + title=`mytranslate "Set image default"` + text=`mytranslate "When converting images, the system can set a default for the type of file to be converted to. + +choose one of the following"` + col=`mytranslate "Default image extension"` + i1=`mytranslate "No default should be pre-selected"` + i2=`mytranslate "Create an image of the same type as the source"` + i3=`mytranslate "Default image type should be"` + imageext=none + imageext=`zenity --list --height=370 --title="$title" --text="$text" --radiolist --column="" --column="$col" TRUE "$i1 (imageext=none)" FALSE "$i2 (imageext=same)" FALSE "$i3 gif (imageext=gif)" FALSE "$i3 jpg (imageext=jpg)" FALSE "$i3 ico (imageext=ico)" FALSE "$i3 pdf (imageext=pdf)" FALSE "$i3 png (imageext=png)" FALSE "$i3 tif (imageext=tif)"` || exit 0 + +echo "$imageext" | tr '|' '\012' | sed -e 's/^.*(//' -e 's/.$//' >> ~/.config/avconvert/avconvert +. ~/.config/avconvert/avconvert + +echo "# Defaults file for avconvert, created `date` +destdir=$destdir +autoloop=$autoloop +zenityfix=$zenityfix +quiet=$quiet +trash=$trash +imageext=$imageext +" > ~/.config/avconvert/avconvert +fi + +# set everything to 'defaults' regardless of preferences file +# in case there's no file, or some are missing +destdir=y; autoloop=x; zenityfix=y; imageext=none; quiet=n trash=n + +# now "dot" the file if it is there +# due to google translator, be sure it is linked to Avconvert as well +if test -s ~/.config/avconvert/avconvert + then . ~/.config/avconvert/avconvert + if cmp ~/.config/avconvert/avconvert ~/.config/avconvert/Avconvert >/dev/null 2>&1 + then : alldone + else rm -f ~/.config/avconvert/Avconvert + ln ~/.config/avconvert/avconvert ~/.config/avconvert/Avconvert + fi +fi + +# here we go..... + +# let's get some common translated phrases in advance first: +# export them all!! +s1=`mytranslate "Select"`; export s1 + + +while true +do + case $1 in + --no-destdir) destdir=n; shift ;; + --no-loop) autoloop=n; shift ;; + --no-zenityfix) zenityfix=n; shift ;; + *) break ;; + esac +done + +case $1 in + '') title=`mytranslate "Select source files, all of same type (image/video/other)"` + files=`zenity --title="$title" --file-selection --multiple --separator="|"` || exit 0 + files=`echo "$files" | sed -e 's/^/"/' -e 's/$/"/' -e 's/|/" "/g'` + echo "avconvert $* $files" > /tmp/avconvert.rerun + sh /tmp/avconvert.rerun & + rm -f /tmp/avconvert.rerun + exit 0 + ;; +esac + +# if this is not a "fixable" zenity, do not try to fix it +# (at least) ubuntu 9.10 lacks the configuration file +if test -s /usr/share/zenity/zenity.glade + then : good + else zenityfix=n +fi +case $zenityfix in + n) ;; + *) +if test -s /usr/share/zenity/zenity.glade.orig + then : already done + else cat << ZenityFix > /tmp/zenity.fix +# zenity.fix +# written by +# marc brumlik, tailored softare inc +# distributed with +# avconvert, posted on gnome-look, to correct the behavior of zenity +# The driectory containing zenity.glade is: +DIR=/usr/share/zenity + +if test -s \$DIR/zenity.glade + then cd \$DIR + else echo -e "The file /usr/share/zenity/zenity.glade\ncan not be found!\n\nPlease modify the script /tmp/zenity.fix with the correct\nlocation of the file 'zenity.glade'.\nThen execute it directly from the command line.\n\nExiting now...\n\nPress Return \c"; read fred; exit 0 +fi +echo -e "\nModifying the file \$DIR/zenity.glade\n\nA safe copy of your file is being saved as zenity.glade.orig" +if test -s zenity.glade.orig + then echo "It appears that this has been run before." + echo "Doing it again..." + else cp zenity.glade zenity.glade.orig +fi +cat zenity.glade.orig | sed '/focus_on_map/s/False/True/' > zenity.glade +cp zenity.glade zenity.glade.progress-over +progline=\`grep -n "zenity_progress_dialog" zenity.glade | sed 's/:.*//'\` +focusline=\`sed -n "\$progline,\$"p < zenity.glade | grep -n focus_on_map | \ + head -1 | sed 's/:.*//'\` +targetline=\`echo -e "\$progline + \$focusline - 1 \n quit" | bc\` +sed "\$targetline s/True/False/" < zenity.glade.progress-over > zenity.glade.progress-under +chmod 666 /usr/share/zenity/zenity.glade +echo -e "/tmp/zenity.fix now exiting\n\nPress Return \c"; read fred +ZenityFix + chmod 755 /tmp/zenity.fix + if whereis xterm | grep / >/dev/null + then message=`mytranslate "Click OK if you would like this to be run for you right now, or if you prefer, click Cancel to prevent avconvert from doing this. If you Cancel, avconvert will create a script /tmp/zenity.fix which you can run as \'root\' manually. This will modify your Zenity defauts so its windows appear on top of any others."` + else message=`mytranslate "This fix can not be auto-run for you because you do not have \'xterm\' installed. Click Cancel and execute /tmp/zenity.fix as \'root\'. This will modify Zenity defaults so its windows appear on top of any others."` + fi + title=`mytranslate "Zenity defaults"` + text1=`mytranslate "The Linux utility that avconvert uses to pop up dialogs is called Zenity. In some releases, these dialogs pop up underneath existing windows. This makes reading the output and responding to prompts from avconvert very inconvenient. + +Your installed Zenity version is one which behaves this way. For your convenience, a small program named 'zenity.fix' has just been written in your /tmp directory."` + test2=`mytranslate "NOTE: this window and some others can be permanently silenced either with command line options or by creating a ~/.config/avconvert/avconvert config file. Read the end of the avconvert script for details. +Also, this window will not reappear once the zenity defaults are changed OR as long as the /tmp/zenity.fix file exists."` + zenity --question --title="$title" --text="$text1\n\n$message\n\n$text2" && xterm -e ' echo -e "To fix zenity requires Root \c"; su -c /tmp/zenity.fix ' +fi + ;; +esac + +case $quiet in + y) cp /usr/share/zenity/zenity.glade.progress-under /usr/share/zenity/zenity.glade 2>/dev/null ;; + n) cp /usr/share/zenity/zenity.glade.progress-over /usr/share/zenity/zenity.glade 2>/dev/null ;; +esac + +rm -f /tmp/avconvert.env /tmp/avffmpeg.env + +until [ -z "$1" ] +do + +fileargs="$fileargs +$1" + +echo "$1" > /tmp/files + +targetpath=$1; shift +target=`basename "$targetpath"` +# had used this due to an earlier bug, but dirname is better +# dir=`echo "$targetpath" | sed "s/\/\$target//"` +dir=`dirname "$targetpath"` +case "$dir" in + */*) ;; + *) dir=`pwd` ;; +esac + +test -d "$dir" && cd "$dir" +if test -f "$target" + then if test -s "$target" + then : OK + else text=`mytranslate "Source file is EMPTY!"` + exec zenity --warning --text="$target\n\n$text" + fi + else text=`mytranslate "Source file NOT FOUND!"` + exec zenity --warning --text="$target\n\n$text" +fi + +case $destdir in + n) outdir=`pwd` ;; +esac + +if test -z "$outdir" + then cwd=`pwd` +title=`mytranslate "Destination folder (Cancel for current directory)"` + outdir=`zenity --file-selection --filename="$cwd" --directory --title="$title"` + if test -z "$outdir" + then outdir=$cwd + fi +fi + +case "$target" in + *.*) ;; + *) zenity --question --title="What to do?" --text="It would be nice if \"$target\" had an extension...\nRenaming this file is recommended!\n\nTo have avconvert proceed anyway, press OK.\nTo exit now so you can rename the file, press Cancel" || exit 0 ;; +esac + +type=`file "$target" | tr '[A-Z]' '[a-z]' | sed 's/^.*://'` +mtype=`file -i "$target" | tr '[A-Z]' '[a-z]' | sed 's/^.*://'` +show=`file "$target" | awk -F: '{print $2}'` +case "$target" in + *.rm|*.rmvb|*.???|*.????) ext=`echo "$target" | sed 's/^.*\.//'` ;; + *) ext="" ;; +esac +# imagemagick identify does not properly execute mencoder on *avi files +# and instead generated a png image for every frame. +# until fixed, this like should be commented out. +## ident=`identify "$target" 2>/dev/null | sed "s/^.*$ext //"` +# ffmpeg provides lots of info anyway +ffident=`ffmpeg -i "$target" 2>&1 | tail -4 | head -3` +if echo "$ffident" | grep Unable >/dev/null + then ffident="" +fi +echo "$ffident" | grep audio >/dev/null && fftype=audio +echo "$ffident" | grep video >/dev/null && fftype=video +[ "$fftype" = "video" ] && echo "$ffident" | grep "bitrate: N/A" && fftype=image +[ "$fftype" = "image" ] && imident=`echo "$ffident" | grep Video | \ + awk -F, '{print $1, $2, $3, $4}' | sed 's/^.*://'` + +# based on source file, what might the destinations be? +# what application will we use to create them? +# the case wildcards are things we know how to convert FROM +# "prog" is the actual conversion program +# "out" is a list of formats we can choose to convert TO +it=""; av="" # for "image/text" and "audio/video" +# strings from file, and extensions, which imply input file type +case "$fftype$type$mtype$ext" in + *bin) + base=`echo "$target" | sed 's/.bin$//'` + if test -s "$base".cue + then prog=iso; it=bchunk + fi ;; + *cue) + base=`echo "$target" | sed 's/.cue$//'` + if test -s "$base".bin + then prog=iso; it=bchunk + fi ;; + *daa) + prog=iso; it=daa2iso ;; + *nrg) + prog=iso; it=nrg2iso ;; + *b?i) + prog=iso; it=b5i2iso ;; + *cdi) + prog=iso; it=csi2osi ;; + *mdf) + prog=iso; it=mdf2iso ;; + *pdi) + prog=iso; it=pdi2iso ;; + *ccd) + prog=iso; it=ccd2iso ;; + *uif) + prog=iso; it=uif2iso ;; + *text/plain*|*ASCII*) + # recognized plain text formats, out to other text or image + prog="text"; it="text" ;; + *image*|*pdf|*ico) + # recognized image formats, output will also be an image + prog="convert"; it="image" ;; + *video*|*3g2|*3gp|*ogv|*mpg|*wmv|*asf|*mp4|*ogg|*rm|*rmvb) + # recognized multimedia formats, output to multimedia or audio + prog="ffmpeg"; av="video" ;; + *audio*|*mp3|*wav|*m4a|*wma) + # recognized audio-only formats, output to audio + prog="ffmpeg"; av="audio" ;; + *msword*) + # micro$oft office word document, v2 / v6 or newer + prog=text; it="doc" ;; + text/html) + prog=text; it="html" ;; + *text/rtf*) + prog=text; it="rtf" ;; + *Unicode*) + prog=text; it="uni" ;; + *opendocument*|*openoffice*) + prog=text; it="odt" ;; + *openoffice*) + prog=text; it="oo" ;; + *) prog=`zenity --list --height=520 --title="Unknown!" --text="Not sure what to do with this file!\n\nTarget file: \"$target\"\n\nInformation found:\n$type\n$mtype\n$ffident$ident\n\n\nBut, it is likely that though this file type was not\nexplicitly recognized by avconvert, it can be handled\nby convert (Images) or ffmpeg (Audio/Video).\n\nIf you would like to TRY, choose the utility you feel\nwould be appropriate and avconvert will do its best.\n\n" --radiolist --column "Select" --column "Utility to use" FALSE convert FALSE ffmpeg` || exit 0 + case $prog in + ffmpeg) av=`zenity --list --title="Select" --text="Tell ffmpeg whether this file is:" --radiolist --column "Select" --column "Content type" FALSE audio FALSE video` || exit 0 ;; + esac + ;; + +esac + +# export everything we know so far and launch the appropriate function quality + +case $prog in + ffmpeg|convert) audiovideo=y ;; + *) audiovideo=n ;; +esac +case "$1$audiovideo$autoloop" in + ?*yx) autoloop=n + zenity --question --title="Auto-Loop though Source Files??" --text="You have selected multiple source files. Avconvert will loop through them and convert them all.\n\n*IF* you know that all source files are of the same type\n (images, audio, etc)\nand *IF* you want them all of them converted the same way\n (images->1024/jpg, audio->128bit/mp3, etc)\n*THEN* click OK\n\n But...\n\n*IF* they the source files are of different types\n (not ALL images or not ALL videos)\nor *IF* you want per-file control of how each source is handled\n*THEN* click Cancel\n\nOK will auto-loop, Cancel will treat each file separately." && autoloop=y + ;; +esac + +today=`date +%Y%m%d` +if grep "$today" ~/.config/avconvert/versioncheck >/dev/null 2>&1 + then : already checked + else echo "$today" > ~/.config/avconvert/versioncheck + versioncheck=`wget -q --timeout=3 --tries=1 \ + http://www.gtk-apps.org/CONTENT/content-files/92533-avconvert.tar.gz -O - | \ + gunzip 2>/dev/null | grep -a version= | head -1 | \ + sed -e 's/"$//' -e 's/^.*"//'` + case "$versioncheck" in + [0-9].[0-9][0-9]*) + case "$versioncheck" in + "$version") ;; + *) zenity --info --title="A newer version 'avconvert' is available for download" --text="You are running version\n\t$version\n\nAvailable for download\n\t$versioncheck" + ;; + esac + esac +fi + +export dir target ext type mtype show ident ffident it av prog autoloop base +myav$prog + +# this 'done' is for looping through multiple selected input files +done + +case $overwrite in + YES) ;; + *) case $trash in + y) totrash=`zenity --list --title="Send to Trash?" --height=210 --text="You can move the source file(s) to\n$HOME/Desktop/avconvert-Trash" --radiolist --column "Select" --column "Trashcan the source files?" TRUE NO FALSE YES` || exit 0 + case $totrash in + NO) ;; + YES) mkdir -p ~/Desktop/avconvert-Trash/$$ 2>&1 + echo "$fileargs" | while read each + do mv "$each" ~/Desktop/avconvert-Trash/$$; done + ;; + esac + ;; + esac + ;; +esac + +exit 0 + +##### +# READ ME +##### +avconvert + +marc brumlik, tailored software inc, Thu Nov 13 18:50:35 CST 2008 +tsi-inc@comcast.net + +####### +# IF YOU READ NO FURTHER THAN THIS, please note that when using +# "kcolorchooser" in text-to-image, there is a delay after choosing your +# color before the next window from avconvert comes up. I have no idea why +# kcolorchooser is behaving this way. +####### + +This project started out because I needed to create jpg files of numerous +resolutions from a number of source files and wanted an automatic way to +generate them more quickly. Then my daughter asked for a way to convert +"unplugged" YouTube files into formats her friends could view. +Combining these two short scripts is where avconvert began. + +Upon completion of each use of avconvert, a file for debugging purposes +is written to, with lots of output showing exactly what the script +has done. This can help a lot if you are getting unexpected results. +The file name is derived from the conversion, followed by "dot" PID. In the +case of text->image and if intermediary files were generated, there will be +another "dot" and a sequence number. These files will be named: + /tmp/convert.$$ + /tmp/convert.$$.$count + /tmp/ffmpeg.$$ + /tmp/avconvert.debug + /tmp/txt2tags.$$ + /tmp/antiword.$$ +and more may be added in the future. + +You can create a startup file ~/.config/avconvert/avconvert to contain preferences. +Currently there are three items that can be specified there. +A ~/.config/avconvert/avconvert which specifies the defaults for these would contain this: + destdir=y + autoloop=y + zenityfix=y +The line "destdir" specifies whether or not there should be a popup prompting +for a destination directory for converted files. The line "autoloop" determines +whether, if multiple files are selected, you will be prompted and asked if you +want to treat them all the same way. Y means prompt, N means always treat the +files individually. THe line "zenityfix" has to do with the prompt which offers +to fix zenity popups so they appear above (instead of below) other items on the +desktop. Y means detect "popunder" and offer to fix it, N means ignore current +zentiy configuration. + +Things you might want to customize (starting from the top of the script): + +Too much verbage that gives information about source files? + comment out the "ident=" and "ffident=" lines + +Too much window activity and want to eliminate "progress" window? + uncomment the "exit 0" at the top of "myavconvert-watch" + +To add more extensions to recognized file types for image/video/audio: + the script uses two different forms of output from the + "file" command plus the source file extension, to decide + what type of file it has to work with. "file" isn not + always useful, which is why extensions are needed at all. + find the comment "# strings from file". Below that are + four cases. Each contains first something that may have + been output by "file", followed by a set of extensions. + Just follow the example to add more extensions. + +To add more extensions to the default list of output file types: + Find the comment line beginning "Show appropriate output". + Below that are four entries - two for "convert" and two + for "ffmpeg". These are each divided into two more. + Just add any extension you like into that space-separated + list (do NOT remove the leading space in the list). + +To prevent a "default" output type for images: + Currently the default output for images is the same as + the source file type. To prevent this, find the comment + "This line sets default" and, on the line for "convert", + and comment out the "out=" line below that. + +To change the list of image resolutions presented: + Find the comment "# set resolution here". Add or + remove any resolutions from the list. Also, setting + one or more from FALSE to TRUE will cause them to be + checkboxed when the window appears. + +To change the list of jpg quality settings: + Find the comment "# if this is a jpeg". Add or remove. + You may also set the default by changing a FALSE to TRUE + +To change the list of font sizes: + Modify the line beginning "sizelist=". + +To change bitrate choices for ffmpeg audio conversion: + Find the comment line "# audio bitrate". + To set a default bitrate, change one of the FALSE to TRUE. + +To prevent the final window showing summary after completion: + (Not recommeded, since this is ALSO where you might see + diagnostic output after a failure) + Find the comment " Show results summary" and comment out the + "zenity" line that follows it. + + +COMMENTS WELCOME! diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/calsize nautilus-actions-extra-3.4.0/bins/calsize --- nautilus-actions-extra-0.7.3~ppa1/bins/calsize 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/calsize 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,7 @@ +#!/bin/bash +#dr3mro@gmail.com +#calculate file / folder size +#0.1 +filename="$1" +size=`du -h --max-depth=0 "$filename" | awk '{ print $1 }'` +zenity --info --text=$size diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/drop_share nautilus-actions-extra-3.4.0/bins/drop_share --- nautilus-actions-extra-0.7.3~ppa1/bins/drop_share 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/drop_share 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,147 @@ +#!/bin/bash +#modified by dr3mro@gmail.com for compitability with nautilus-actions +#edit: +USENOTIFYOSD=yes #yes or no to use NotifyOSD +#-------------------------- + +#do not edit: +if [[ -e ~/.dropbox/host.db ]]; then + LOCATION="`cat ~/.dropbox/host.db | sed -n 2p | base64 -d`/Public/" +else +#thanks to this: http://forums.dropbox.com/topic.php?id=24265&replies=3#post-152444 + LOCATION="`sqlite3 ~/.dropbox/config.db "select * from config where key like '%path%'" | grep "dropbox_path|" | sed -e "s/dropbox\_path|//g"`/Public/" +# is used just in case +fi + +#check if Public folder exists: +if [[ ! -e $LOCATION ]]; then + + notify-send --icon="dropbox" "Error: Dropbox Share" "You don't seem to have a Public folder in your Dropbox directory. Please check your Dropbox folder (maybe you use selective sync?)." + exit 0 + +fi + + +#check if dropbox is running: +if ps -e | grep dropbox; then + echo +else + if [ $USENOTIFYOSD = yes ]; then + notify-send --icon="dropbox" "Dropbox is not running" "Starting Dropbox..." + else + return + fi +dropbox start +sleep 15 +fi + +#-------------------------- +#remove emblems for files which have been manually removed from the Dropbox Public folder +#-------------------------- + +if [[ ! -e ~/.dropboxshare/history ]]; then + mkdir -p ~/.dropboxshare + touch ~/.dropboxshare/history +fi + +ISINHISTORY=$(cat ~/.dropboxshare/history | awk -F/ '{print $NF}') +IFS=$'\n' +for PUBLICFILE in $ISINHISTORY; do + ISINDROPBOX=$(ls $LOCATION | grep "$PUBLICFILE") + if [[ ! $ISINDROPBOX ]]; then + REMOVEEMBLEM=$(cat ~/.dropboxshare/history | grep "$PUBLICFILE") + gvfs-set-attribute "$REMOVEEMBLEM" -t unset metadata::emblems + + if [ -d $REMOVEEMBLEM ]; then + find "$REMOVEEMBLEM" -name 'dropbox-index.html' -exec rm {} \; + fi + + FORMATFORSEDREMOVEEMBLEM=$(echo $REMOVEEMBLEM | sed -e 's/\//\\\//g') + sed -i "/$FORMATFORSEDREMOVEEMBLEM/d" ~/.dropboxshare/history + else + echo + fi +done + +#------------------------------------------------------------------------------------------------------ + + +#setting the file emblems needs to be done immediately after the user shares them, or else Nautilus is not refreshed and the emblems do not show up. For this reason, we'll have the "for" loop twice: once for the emblems metadata and a second time for actually sharing the folders and copying the URLs to the clipboad: + + IFS=$'\n' + for FILENAME in $@ + do + echo "$FILENAME" >> ~/.dropboxshare/history + #create emblem for the shared files: + gvfs-set-attribute "$FILENAME" -t stringv metadata::emblems dropbox + + done + #refresh Nautilus. It's a hack, but there is no other way of doing this (really!): + xte 'keydown Control_L' 'key R' 'keyup Control_L' + #xsendkeycode 71 1 + #xsendkeycode 71 0 + + if [ $USENOTIFYOSD = yes ]; then + notify-send --icon="dropbox" "Dropbox Share - Uploading" "Please wait while Dropbox uploads your shared files" + else + return + fi + + +#ok, now the emblems should be ok, we can start uploading the files to dropbox (creating the symbolic links and copying the public URLs to the clipboard): + + IFS=$'\n' + for FILENAME in $@ + do + + DROPBOXFILE=`echo $FILENAME | awk -F/ '{print $NF}'` + if [ -f $FILENAME ]; then #files + + + ln -s "$FILENAME" "$LOCATION" + + #copy the links to the clipboard: + list="$list `dropbox puburl "$LOCATION"/"$DROPBOXFILE"`" + echo -n $list > ~/.dropboxshare/lasturl + echo -n $list | xclip -selection clipboard + + + elif [ -d $FILENAME ]; then #folders + + + DROPBOXFILE=`echo $FILENAME | awk -F/ '{print $NF}'` + ln -s "$FILENAME" "$LOCATION" + + /usr/bin/dropbox-index -R "$LOCATION"/"$DROPBOXFILE" #write dropbox-index.html for each folder we shared (recursively) + + #copy the links to the clipboard: + list="$list `dropbox puburl "$LOCATION"/"$DROPBOXFILE"`/dropbox-index.html" + echo -n $list > ~/.dropboxshare/lasturl + echo -n $list | xclip -selection clipboard + + else #something is wrong + return + # notify-send "Something doesnt work" "$@" #debugging + fi + + done + + + +#find out when Dropbox finishes to upload our files; we don't care about the overall Dropbox status, only about our files status. If this part would have been 6 lines upper in the script, it would have been shorter, but each uploaded file would have been in the loop which checks the file status and that slows down the process, especially when uploading many folders. + IFS=$'\n' + for FILENAME in $@ + do + DROPBOXFILE=`echo $FILENAME | awk -F/ '{print $NF}'` + DROPSTATUS=$(dropbox filestatus "$LOCATION"/"$DROPBOXFILE" | awk -F: '{print $NF}') + while [ $DROPSTATUS = " syncing" ]; do + sleep 5 + DROPSTATUS=$(dropbox filestatus "$LOCATION"/"$DROPBOXFILE" | awk -F: '{print $NF}') + done + done + if [ $USENOTIFYOSD = yes ]; then + notify-send --icon="dropbox" "Dropbox Share - DONE!" "Check your clipboard (Ctrl + V)" + exit + else + exit + fi diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/drop_unshare nautilus-actions-extra-3.4.0/bins/drop_unshare --- nautilus-actions-extra-0.7.3~ppa1/bins/drop_unshare 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/drop_unshare 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,79 @@ +#!/bin/bash +#modified by dr3mro@gmail.com for compitability with nautilus-actions +#credits for the Dropbox Unshare script: Nicolas @ http://blog.nicolargo.com/2010/09/scripts-nautilus-pour-partagerdepartager-ses-fichiers-avec-dropbox.html + +if [[ -e ~/.dropbox/host.db ]]; then + LOCATION="`cat ~/.dropbox/host.db | sed -n 2p | base64 -d`/Public/" +else +#thanks to this: http://forums.dropbox.com/topic.php?id=24265&replies=3#post-152444 + LOCATION="`sqlite3 ~/.dropbox/config.db "select * from config where key like '%path%'" | grep "dropbox_path|" | sed -e "s/dropbox\_path|//g"`/Public/" +# is used just in case +fi + +#check if Public folder exists: +if [[ ! -e $LOCATION ]]; then + + notify-send --icon="dropbox" "Error: Dropbox Share" "You don't seem to have a Public folder in your Dropbox directory. Please check your Dropbox folder (maybe you use selective sync?)." + exit 0 + +fi + +#-------------------------- remove emblems for files which have been manually removed from the Dropbox Public folder ------------- + +if [[ ! -e ~/.dropboxshare/history ]]; then + mkdir -p ~/.dropboxshare + touch ~/.dropboxshare/history +fi + +ISINHISTORY=$(cat ~/.dropboxshare/history | awk -F/ '{print $NF}') +IFS=$'\n' +for PUBLICFILE in $ISINHISTORY; do + ISINDROPBOX=$(ls $LOCATION | grep "$PUBLICFILE") + if [[ ! $ISINDROPBOX ]]; then + REMOVEEMBLEM=$(cat ~/.dropboxshare/history | grep "$PUBLICFILE") + gvfs-set-attribute "$REMOVEEMBLEM" -t unset metadata::emblems + + if [ -d $REMOVEEMBLEM ]; then + find "$REMOVEEMBLEM" -name 'dropbox-index.html' -exec rm {} \; + fi + + FORMATFORSEDREMOVEEMBLEM=$(echo $REMOVEEMBLEM | sed -e 's/\//\\\//g') + sed -i "/$FORMATFORSEDREMOVEEMBLEM/d" ~/.dropboxshare/history + else + echo + fi +done + +#------------------------------------------------------------------------------------------------------ + + +#setting the file emblems needs to be done immediately after the user shares them, or else Nautilus is not refreshed and the emblems do not show up. For this reason, we'll have the "for" loop twice: once for the emblems metadata and a second time for actually sharing the folders and copying the URLs to the clipboad: + +IFS=$'\n' +for FILENAME in $@ +do + gvfs-set-attribute "$FILENAME" -t unset metadata::emblems + +done +#refresh Nautilus. It's a hack, but there is no other way of doing this (really!): +xte 'keydown Control_L' 'key R' 'keyup Control_L' +#xsendkeycode 71 1 +#xsendkeycode 71 0 + + +IFS=$'\n' +for FILENAME in $@ +do + + if [ -d $FILENAME ]; then + find "$FILENAME" -name 'dropbox-index.html' -exec rm {} \; + fi + + DROPBOXFILE=`echo $FILENAME | awk -F/ '{print $NF}'` + rm -f "$LOCATION"/"$DROPBOXFILE" + FORMATFORSEDREMOVEEMBLEM=$(echo $FILENAME | sed -e 's/\//\\\//g') + sed -i "/$FORMATFORSEDREMOVEEMBLEM/d" ~/.dropboxshare/history + + list="$list $LOCATION/$DROPBOXFILE" +done +notify-send --icon="dropbox" "UnShared from Dropbox" "Unshared: $list" diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/filetype nautilus-actions-extra-3.4.0/bins/filetype --- nautilus-actions-extra-0.7.3~ppa1/bins/filetype 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/filetype 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,6 @@ +#!/bin/bash +# dr3mro@gmail.com +#0.3 + +filetype=`file -b "$1"` +zenity --info --title "File-Type Checker" --text "$filetype" diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/gendirmd5 nautilus-actions-extra-3.4.0/bins/gendirmd5 --- nautilus-actions-extra-0.7.3~ppa1/bins/gendirmd5 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/gendirmd5 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,16 @@ +#!/bin/bash +#dr3mro@gmail.com +#0.7 +basename=`basename "$1"`; +dirname=`dirname "$1" `; + +if [ -f "${dirname}/checksum.md5" ] ;then + rm "${dirname}/checksum.md5" +fi + +`md5deep -r "$1" | tee >(zenity --progress --pulsate) > /tmp/"${basename}.md5"` + +if [ -f /tmp/"${basename}.md5" ] ;then + sed -i 's%'$1'%.%'g /tmp/"${basename}.md5" + cat /tmp/"${basename}.md5" | grep -v ${basename} > "$1"/"${basename}.md5" +fi diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/genmd5 nautilus-actions-extra-3.4.0/bins/genmd5 --- nautilus-actions-extra-0.7.3~ppa1/bins/genmd5 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/genmd5 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,27 @@ +#!/bin/bash + +# AUTHOR: (c) Tony Mattsson +# VERSION: 1.0 +# LICENSE: GPL (http://www.gnu.org/licenses/gpl.html) +# REQUIRES: +# NAME: Make md5 +# DESCRIPTION: + +# Check that the user didn't select directories +for File in "$@" +do +if [ -d "$File" ]; then +zenity --error --text="'$File' is a directory. +Make md5 cannot handle directories." +exit +fi +done +path=`dirname "$1"` +cd $path +#Enter the checksum filename to create +CheckName=`zenity --entry --title="Make md5" --entry-text "checksum.md5" --text="Enter the name of your md5 checksum file"` +if [ "$?" == 1 ] ; then exit ; fi + +# 1 Check the md5 file +(md5sum "$@" > "$path/$CheckName") 2>&1 | zenity --progress --title "Make md5" --text "Making: $CheckName" --pulsate --auto-close +`sed -i 's%'$path'%.%'g "$path"/"$CheckName"` diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/hider nautilus-actions-extra-3.4.0/bins/hider --- nautilus-actions-extra-0.7.3~ppa1/bins/hider 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/hider 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,68 @@ +#!/bin/bash +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# Dr. Amr Osman +# hide 2.1 +#set -x + +#this is the temp hidden file +tmp_hidden=/tmp/.hidden + +#this is the cleaned temp hidden file +tmp_hidden_clean=/tmp/.hidden_clean + +#this is a variable of hidden files from .hidden +hidden_files=`cat "$tmp_hidden"` + +#this is the dir name containing the current selection +dname=`dirname "$1"` +#fix bug while migrating from nautilus actions to nautilus python +cd "${dname}" +#prepare files + +#touching the .hidden in order to not clear the data if there is +touch "${dname}"/.hidden + +#clear up temp hidden +echo "" > $tmp_hidden + +#clear up temp hidden clean +echo "" > $tmp_hidden_clean + +#read the current hidden files and store it in $tmp_hidden variable +cat "$dname"/.hidden | sort | uniq 2>/dev/null 1> $tmp_hidden + +#This loop is to add current selection to the current hidden +for i in "$@"; do + fname=`basename "$i"` + echo "$fname" >> $tmp_hidden +done + +#this is the line count of the .hidden file +hidden_length=`cat "$tmp_hidden" | wc -l` + +#this loop is to remove lines contain files that no longer exist +for line in `seq 1 ${hidden_length}`;do + current_line=`cat $tmp_hidden | sed -n "$line"'p'` + if [ -e "$current_line" ];then + echo "$current_line" >> $tmp_hidden_clean + fi +done + +#finally sort , remove duplicate and empty lines and save the hidden conf in .hidden +cat $tmp_hidden_clean | sort | uniq | sed /^$/d > "$dname"/.hidden + +#this is the refresh hack :) +xte 'keydown Control_L' 'key R' 'keyup Control_L' diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/mountiso nautilus-actions-extra-3.4.0/bins/mountiso --- nautilus-actions-extra-0.7.3~ppa1/bins/mountiso 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/mountiso 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,22 @@ +#!/bin/bash +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# Amr Osman +# 0.4 + +filename=`basename "$1"` +mkdir /media/"$filename" +mount -o loop "$1" /media/"$filename" diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/pastebin nautilus-actions-extra-3.4.0/bins/pastebin --- nautilus-actions-extra-0.7.3~ppa1/bins/pastebin 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/pastebin 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,80 @@ +#!/bin/bash +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 2 of the License, or +#(at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +#MA 02110-1301, USA. +#dr3mro@gmail.com +#version 0.3 +#set -x +#setting variables + +if [ ! "$1" ] ;then + exit; +fi + +filename="$1" +basename=`basename "$1"` +sites=`pastebinit -l | sed '1'd | awk '{print "FALSE "$2}' | sed s'/FALSE paste.ubuntu.com/TRUE paste.ubuntu.com/'` + +paste() { + pleasewait + link=`pastebinit -b $site "$filename" 2>/dev/null | grep http` + + if [ $link ] ;then + echo $link | xclip -selection clipboard + success + else + siteisdown + return + fi + } + +success() { + + notify-send --icon=info "pastebin" "File named $basename was uploaded sucessfully to $selection, Please check your clipboard for the link or press CTRL+V, Thank you!" + return + } + +siteisdown() { + notify-send --icon=error "pastebin" "Sorry but it appears you have no access to $site either your internet is down or the selected site is down please retry" + exit 1; + } + +testinternet() { + pingout=`ping $selection -c 1 ` + status=`echo $pingout | grep unknow` + + if [ ! $status ] ;then + return + else + siteisdown + fi + } + +pleasewait(){ + notify-send --icon=info "pastebin" "File named $basename is being uploaded to $selection, Please Wait while uploading!" +} + +main(){ + selection=`zenity --height="480" --width="100" --list --radiolist --column status --column sites $sites` + + if [ ! $selection ] ;then + exit + fi + site="http://"$selection + testinternet + paste + exit + } + +main diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/unhider nautilus-actions-extra-3.4.0/bins/unhider --- nautilus-actions-extra-0.7.3~ppa1/bins/unhider 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/unhider 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,45 @@ +#!/bin/bash +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# Dr. Amr Osman +# unhide 2.1 + +#set -x + +dname=`dirname "$1"` + +#fix bug while migrating from nautilus actions to nautilus python +cd "${dname}" + +hidden_file="$dname"/.hidden +touch "$hidden_file" +hidden_length=`cat "$hidden_file" | wc -l` + +#this is the main loop to remove the current selection from .hidden +for i in "$@" ; do + fname=`basename "$i"` + sed -i "/$fname/d" $hidden_file +done + +#this loop is to remove lines contain files that no longer exist +for line in `seq 1 ${hidden_length}`;do + current_line=`cat $hidden_file | sed -n "$line"'p'` + if [ ! -e "$current_line" ];then + sed -i "/$current_line/d" $hidden_file + fi +done + +#this is the refresh hack :) +xte 'keydown Control_L' 'key R' 'keyup Control_L' diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/unmountiso nautilus-actions-extra-3.4.0/bins/unmountiso --- nautilus-actions-extra-0.7.3~ppa1/bins/unmountiso 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/unmountiso 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/bash +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. +# +# Amr Osman +# 0.4 +#dr3mro@gmail.com +#0.4 +#unmount ISO + +filename=`basename "$1"` + +umount "/media/"$filename"/" && zenity --info --text "Successfully unmounted /media/$(echo "$filename")/" && sudo rmdir "/media/"$filename"/" diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/verifymd5 nautilus-actions-extra-3.4.0/bins/verifymd5 --- nautilus-actions-extra-0.7.3~ppa1/bins/verifymd5 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/verifymd5 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,53 @@ +#!/bin/bash + +# AUTHOR: (c) Tony Mattsson +# VERSION: 1.0 +# LICENSE: GPL (http://www.gnu.org/licenses/gpl.html) +# REQUIRES: gxmessage, md5sum, mawk, zenity +# NAME: Check md5 +# DESCRIPTION: Checks the md5 hash checksum of files listed in a .md5-file + +# Language settings + + Passed="OK" + Failed="FAILED" + PrintAllOk="All files are OK!" + PrintFail1="file(s) are OK and" + PrintFail2="file(s) are corrupt!" + +case $LANG in + sv* ) + Passed="OK" + Failed="MISSLYCKADES" + PrintAllOk="Alla filer är OK!" + PrintFail1="fil(er) är OK och" + PrintFail2="fil(er) är korrupta!" +esac +path=`dirname "$1"`; +cd $path +for File in "$@" +do +# if [[ ${File:(( ${#File} -4 )):4} != ".md5" ]];then +# zenity --error --title="Check md5"--text="This is not a '.md5' checksum file." +# exit +# fi +# 1 Check the md5 file +(md5sum -c "$File" > /tmp/checktext.txt) 2>&1 | zenity --progress --title "Check md5" --text "Checking: $File" --pulsate --auto-close + + +# 2 Display the results! + +# Print a little repport about how many failed and how many passed +NumberOK=`cat /tmp/checktext.txt | fgrep -o -e "$Passed" | wc -l` +NumberFailed=`cat /tmp/checktext.txt | fgrep -o -e "$Failed" | wc -l` + if [ $NumberFailed == 0 ]; then + StatusMessage="$PrintAllOk" + else + StatusMessage="$NumberOK $PrintFail1 $NumberFailed $PrintFail2" + fi +echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-" >> /tmp/checktext.txt +echo "$StatusMessage" >> /tmp/checktext.txt + +zenity --text-info --title "$File" --width=640 --height=480 --filename=/tmp/checktext.txt + +done diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/viewmd5 nautilus-actions-extra-3.4.0/bins/viewmd5 --- nautilus-actions-extra-0.7.3~ppa1/bins/viewmd5 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/viewmd5 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,10 @@ +#!/bin/bash +#dr3mro@gmail.com +#0.1 +dirname=`dirname "$1"` +method=`zenity --list --text="Choose a checksum file to create:" --column=Method md5sum cksum sha1sum ` + +if [[ -n "$method" ]]; then + cd $dirname + zenity --info --text "`find "$@" -type f -exec $method \"{}\" \";\"`"; +fi diff -Nru nautilus-actions-extra-0.7.3~ppa1/bins/wallpaper-changer nautilus-actions-extra-3.4.0/bins/wallpaper-changer --- nautilus-actions-extra-0.7.3~ppa1/bins/wallpaper-changer 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/bins/wallpaper-changer 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,48 @@ +#!/bin/bash +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 2 of the License, or +#(at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not, write to the Free Software +#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +#MA 02110-1301, USA. +#version : 1.1 +#this script was developed by Dr.Amr Osman +#dr3mro@gmail.com +#Nov 6th 2011 +#updated 14th Dec 2011 + +#variables +render="FALSE none FALSE wallpaper FALSE centered FALSE scaled FALSE stretched FALSE zoom FALSE spanned" +current=`gsettings get org.gnome.desktop.background picture-options | tr "\'" " "` +list=`echo $render | sed s/"FALSE$current"/"TRUE$current"/` +set=`zenity --list\ + --height="300"\ + --width="230"\ + --radiolist\ + --column ""\ + --column "options" $list\ + --text "Please Select Rendering:"\ + --title "Wallpaper Changer"` + +#check if user input something or not +if [ ! $set ];then + #set=$current + exit 0 +fi + +#setting render and wallpaper with gsettings +gsettings set org.gnome.desktop.background picture-options $set +gsettings set org.gnome.desktop.background picture-uri "\"$@\"" + +#only for backward compitability with gnome 2.x +gconftool-2 --type string --set /desktop/gnome/background/picture_filename "\"$@\"" +gconftool-2 --type string --set /desktop/gnome/background/picture_options $set +#EOF diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/bzr-builder.manifest nautilus-actions-extra-3.4.0/debian/bzr-builder.manifest --- nautilus-actions-extra-0.7.3~ppa1/debian/bzr-builder.manifest 2012-01-18 15:06:52.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/bzr-builder.manifest 2012-11-17 17:45:48.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0~92 -lp:nautilus-actions-extra revid:dr3mro@gmail.com-20120118145505-e6wyc15w9cptqkat +# bzr-builder format 0.3 deb-version {debupstream}-0~4 +lp:nautilus-actions-extra revid:dr3mro@gmail.com-20121113213904-7vyexgwetjda3v6c diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/changelog nautilus-actions-extra-3.4.0/debian/changelog --- nautilus-actions-extra-0.7.3~ppa1/debian/changelog 2012-01-18 15:06:52.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/changelog 2012-11-17 17:45:48.000000000 +0000 @@ -1,365 +1,24 @@ -nautilus-actions-extra (0.7.3~ppa1-0~92~oneiric1) oneiric; urgency=low +nautilus-actions-extra (3.4.0-0~4~oneiric1) oneiric; urgency=low * Auto build. - -- Dr. Amr Osman Wed, 18 Jan 2012 15:06:52 +0000 + -- Dr. Amr Osman Sat, 17 Nov 2012 17:45:48 +0000 -nautilus-actions-extra (0.7.3~ppa1) oneiric; urgency=high +nautilus-actions-extra (3.4.0-3) precise; urgency=high - * migrate open terminal to python + * Nguyễn Hồng Quân 2012-10-05 - Correct indentation. + * Nguyễn Hồng Quân 2012-10-03 - Handle the case that path name has "space" character. - -- Wed, 18 Jan 2012 16:54:00 +0200 + -- Amr Osman Sat, 16 Jun 2012 21:00:00 +0200 -nautilus-actions-extra (0.7.2~ppa2) oneiric; urgency=high +nautilus-actions-extra (3.4.0-2) precise; urgency=high - * update the nauiltus open as root package name + * fix package issue - -- Tue, 17 Jan 2012 15:33:10 +0200 + -- Amr Osman Sat, 16 Jun 2012 21:00:00 +0200 -nautilus-actions-extra (0.7.2~ppa1) oneiric; urgency=high +nautilus-actions-extra (3.4.0-1) precise; urgency=high - * Closes(#917482) + * Initial Repackaging into single source package to ease development - -- Tue, 17 Jan 2012 14:58:40 +0200 - -nautilus-actions-extra (0.7.1~ppa1) oneiric; urgency=high - - * New release - - -- Fri, 13 Jan 2012 22:20:40 +0200 - -nautilus-actions-extra (0.7.0~ppa1) oneiric; urgency=high - - * migration to python-nautilus completed - - -- Sat, 07 Jan 2012 12:54:00 +0200 - -nautilus-actions-extra (0.6.3~ppa1) oneiric; urgency=high - - * replace pyrenamer with nautilus renamer and split it to indepndent package - - -- Fri, 06 Jan 2012 03:29:00 +0200 - -nautilus-actions-extra (0.6.2~ppa1) oneiric; urgency=high - - * adding nautilus-advanced-menu as dependency - - -- Thu, 05 Jan 2012 22:55:10 +0200 - -nautilus-actions-extra (0.6.1~ppa1) oneiric; urgency=high - - * post advanced menu to python and split it to a independent package - - -- Thu, 05 Jan 2012 22:34:10 +0200 - -nautilus-actions-extra (0.6.0~ppa1) oneiric; urgency=high - - * remove nautilus filename repairer from the dependencies - - -- Thu, 05 Jan 2012 01:34:10 +0200 - -nautilus-actions-extra (0.5.9~ppa1) oneiric; urgency=high - - * split nautilus-bin-install into a separate package - - * port nautilus-bin-install into python extension - - -- Wed, 04 Jan 2012 20:13:50 +0200 - -nautilus-actions-extra (0.5.8~ppa1) oneiric; urgency=high - - * split scripts for multimedia menu itto separate package - - -- Wed, 04 Jan 2012 17:05:10 +0200 - -nautilus-actions-extra (0.5.7~ppa1) oneiric; urgency=high - - * migrate execute as into nautilus python and split it to separate package - - -- Wed, 04 Jan 2012 00:53:50 +0200 - -nautilus-actions-extra (0.5.6~ppa1) oneiric; urgency=high - - * migrate gedit as into nautilus python and split it to separate package - - -- Mon, 02 Jan 2012 17:23:20 +0200 - -nautilus-actions-extra (0.5.5~ppa1) oneiric; urgency=high - - * split (un)hide into a separate package - - -- Sun, 01 Jan 2012 20:51:10 +0200 - -nautilus-actions-extra (0.5.4~ppa2) oneiric; urgency=high - - * add nautilus-wallpaper-changer as dependency - - -- Sun, 01 Jan 2012 20:51:10 +0200 - -nautilus-actions-extra (0.5.4~ppa1) oneiric; urgency=high - - * move set as wallpaper into independent package - - -- Sun, 01 Jan 2012 20:51:10 +0200 - -nautilus-actions-extra (0.5.3~ppa1) oneiric; urgency=high - - * move emblemize2 into independent package - - -- Sun, 01 Jan 2012 15:20:10 +0200 - -nautilus-actions-extra (0.5.2~ppa1) oneiric; urgency=high - - * move multimedia menu into nautilus-multimedia-menu - - -- Sat, 31 Dec 2011 22:50:30 +0200 - -nautilus-actions-extra (0.5.1~ppa1) oneiric; urgency=high - - * split nautilus-search into a separate package - - -- Sat, 31 Dec 2011 16:58:30 +0200 - -nautilus-actions-extra (0.5.0~ppa2) oneiric; urgency=high - - * split imgizor into an independent package - - -- Fri, 30 Dec 2011 16:15:10 +0200 - -nautilus-actions-extra (0.5.0~ppa1) oneiric; urgency=high - - * add 64bit support - - * push imgizor to version 0.5 - - * minor bug fixes - - -- Sat, 24 Dec 2011 11:40:12 +0200 - -nautilus-actions-extra (0.4.9~ppa3) oneiric; urgency=high - - * add libgtk-3-0 as dependency - - -- Fri, 23 Dec 2011 23:03:15 +0200 - -nautilus-actions-extra (0.4.9~ppa2) oneiric; urgency=high - - * update postinst script - - -- Fri, 23 Dec 2011 22:18:15 +0200 - -nautilus-actions-extra (0.4.9~ppa1) oneiric; urgency=high - - * Fix bug in imgizor with files with file name with spaces - - -- Wed, 21 Dec 2011 11:18:15 +0200 - -nautilus-actions-extra (0.4.8~ppa1) oneiric; urgency=high - - * update imagizor to 0.4 - - -- Wed, 21 Dec 2011 11:18:15 +0200 - -nautilus-actions-extra (0.4.7~ppa4) oneiric; urgency=high - - * repackaging - - -- Tue, 20 Dec 2011 21:25:55 +0200 - -nautilus-actions-extra (0.4.7~ppa3) oneiric; urgency=high - - * repackaging - - -- Tue, 20 Dec 2011 20:55:55 +0200 - -nautilus-actions-extra (0.4.7~ppa2) oneiric; urgency=high - - * fix miss packaging - - -- Tue, 20 Dec 2011 20:37:55 +0200 - -nautilus-actions-extra (0.4.7~ppa1) oneiric; urgency=high - - * update imgizor to 0.3 - - -- Tue, 20 Dec 2011 17:29:15 +0200 - -nautilus-actions-extra (0.4.6~ppa1) oneiric; urgency=high - - * update imgizor to 0.2 - - -- Tue, 20 Dec 2011 15:24:15 +0200 - -nautilus-actions-extra (0.4.5~ppa1) oneiric; urgency=high - - * push to version 4.5 - - -- Tue, 20 Dec 2011 13:24:15 +0200 - -nautilus-actions-extra (0.4.4~ppa3) oneiric; urgency=high - - * Fix missing glade file packaging bug. - - -- Tue, 20 Dec 2011 00:24:15 +0200 - -nautilus-actions-extra (0.4.4~ppa2) oneiric; urgency=high - - * Fix missing action after install packaging bug. - - -- Tue, 20 Dec 2011 00:10:15 +0200 - -nautilus-actions-extra (0.4.4~ppa1) oneiric; urgency=high - - * Remove nautilus-image-converter - - * Add Image Resize and Rotate - - -- Mon, 19 Dec 2011 23:55:15 +0200 - -nautilus-actions-extra (0.4.3~ppa1) oneiric; urgency=high - - * Temprarily fix bug in nautilus-gksu until a fix is released - - -- Fri, 16 Dec 2011 18:08:15 +0200 - -nautilus-actions-extra (0.4.2~ppa1) oneiric; urgency=high - - * replace nautilus-image-manipulator with nautilus-image-converter - - -- Fri, 16 Dec 2011 09:12:15 +0200 - -nautilus-actions-extra (0.4.1~ppa4) oneiric; urgency=high - - * tweak postinst script - - -- Fri, 16 Dec 2011 08:28:15 +0200 - -nautilus-actions-extra (0.4.1~ppa3) oneiric; urgency=high - - * tweak postinst script - - -- Fri, 16 Dec 2011 08:00:15 +0200 - -nautilus-actions-extra (0.4.1~ppa2) oneiric; urgency=high - - * add gnome-icon-theme-full as dependency - - -- Thu, 15 Dec 2011 21:48:15 +0200 - -nautilus-actions-extra (0.4.1~ppa1) oneiric; urgency=high - - * fix bug in desktop jpg case missmatch - - -- Thu, 15 Dec 2011 21:48:15 +0200 - -nautilus-actions-extra (0.4.0~ppa1) oneiric; urgency=high - - * update image convert script to fix bug with spaces in file names - - -- Thu, 15 Dec 2011 20:40:15 +0200 - -nautilus-actions-extra (0.3.9~ppa4) oneiric; urgency=high - - * fix install script - - -- Thu, 15 Dec 2011 10:17:15 +0200 - -nautilus-actions-extra (0.3.9~ppa3) oneiric; urgency=high - - * fix typo in postinst - - -- Thu, 15 Dec 2011 10:17:15 +0200 - -nautilus-actions-extra (0.3.9~ppa2) oneiric; urgency=high - - * update postinstall script - - -- Thu, 15 Dec 2011 10:17:15 +0200 - -nautilus-actions-extra (0.3.9~ppa1) oneiric; urgency=high - - * update wallpaper changer script to version 1.1 - - -- Wed, 14 Dec 2011 21:25:15 +0200 - -nautilus-actions-extra (0.3.8~ppa2) oneiric; urgency=high - - * fix missed commit - - -- Wed, 14 Dec 2011 17:12:15 +0200 - -nautilus-actions-extra (0.3.8~ppa1) oneiric; urgency=high - - * tweak postinst script - - * update wallpaper-changer to 1.0 - - -- Wed, 14 Dec 2011 16:05:15 +0200 - -nautilus-actions-extra (0.3.7~ppa2) oneiric; urgency=high - - * tweak postinst script - - -- Sun, 11 Dec 2011 02:11:15 +0200 - -nautilus-actions-extra (0.3.7~ppa1) oneiric; urgency=high - - * fix bug in emblemize 2.0 - - -- Sun, 11 Dec 2011 02:11:15 +0200 - -nautilus-actions-extra (0.3.6~ppa1) oneiric; urgency=high - - * clean up emblemize 2.0 - - -- Sat, 10 Dec 2011 21:37:15 +0200 - -nautilus-actions-extra (0.3.5~ppa1) oneiric; urgency=high - - * add emblemize 2.0 - - -- Sat, 10 Dec 2011 20:37:15 +0200 - -nautilus-actions-extra (0.3.4~ppa2) oneiric; urgency=high - - * tweak post install script fix bug in nauitlus gksu - - -- Fri, 10 Dec 2011 14:37:15 +0200 - -nautilus-actions-extra (0.3.4~ppa1) oneiric; urgency=high - - * tweak pastebin script - - -- Fri, 9 Dec 2011 13:47:15 +0200 - -nautilus-actions-extra (0.3.3~ppa1) oneiric; urgency=high - - * hide script rewritten - - * unhide script rewritten - - -- Fri, 9 Dec 2011 12:47:15 +0200 - -nautilus-actions-extra (0.3.2~ppa1) oneiric; urgency=high - - * pastebin rewrite and porting from python to bash - - -- Fri, 9 Dec 2011 12:14:15 +0200 - -nautilus-actions-extra (0.3.1~ppa1) oneiric; urgency=high - - * tweak emblemize script and fix bug when user press cancel - - -- Fri, 9 Dec 2011 09:14:15 +0200 - -nautilus-actions-extra (0.3.0~ppa1) oneiric; urgency=high - - * Add emblemize script - - -- Thu, 8 Dec 2011 08:14:15 +0200 - -nautilus-actions-extra (0.2.9~ppa1) oneiric; urgency=low - - * Initial release - - -- Thu, 10 Nov 2011 08:14:15 +0200 + -- Amr Osman Sat, 16 Jun 2012 20:01:05 +0200 diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/control nautilus-actions-extra-3.4.0/debian/control --- nautilus-actions-extra-0.7.3~ppa1/debian/control 2012-01-18 15:06:52.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/control 2012-11-17 17:45:48.000000000 +0000 @@ -2,33 +2,124 @@ Section: gnome Priority: optional Maintainer: Amr Osman -Build-Depends:debhelper (>= 7.0.50~) +Build-Depends: debhelper (>= 8.0.0) +Standards-Version: 3.9.3 +Homepage: Package: nautilus-actions-extra -Conflicts: nautilus-open-terminal,nautilus-gksu Architecture: all -Depends: nautilus-advanced-menu,nautilus-bin-install,nautilus-execute,nautilus-gedit,nautilus-hide,nautilus-wallpaper-changer,nautilus-multimedia-menu,nautilus-search,nautilus-open-terminal-here,nautilus-renamer,nautilus-open-as-root +Depends: ${misc:Depends} , nautilus-advanced-menu,nautilus-bin-install,nautilus-execute,nautilus-gedit,nautilus-hide,nautilus-wallpaper-changer,nautilus-multimedia-menu,nautilus-search,nautilus-open-terminal-here,nautilus-renamer,nautilus-open-as-root , seahorse-nautilus Description: This is a collection of must have scripts that are added to nautilus - through nautilus-actions to give it extra functionalities and make nautilus more usable - example: - advanced search - audio convert - calculate size - avconvert - check file type - checksum view and save - convert gif png jpg iso - gedit it as root/user - hide/unhide - iconv (utf8-arabic windows) - install bin - mount/unmount ISO - Optimize PNG - nautilus renamer - verify Checksums - set wallpaper - open as administrator - open in Terminal - nautilus image resize - emblemizer2.0 - emblemize + through nautilus-actions to give it extra functionalities and make nautilus more usable + +Package: nautilus-advanced-menu +Architecture: all +Depends: ${misc:Depends},pastebinit,emblemize (>=3.0) ,python-nautilus,coreutils,mount,mount,file,gawk,bc,zenity +Description: nautilus-advanced-menu + add various advanced actions to nautilus context menu for example: + paste text to pastebin.com and other sites + set emblem + check file type + check file size + mount / unmount iso + convert character encoding between utf8 and windows-1256 + +Package: nautilus-bin-install +Architecture: all +Depends: ${misc:Depends},gnome-terminal,sudo,python-nautilus +Description: nautilus-bin-install + add install bin files to nautilus context menu + +Package: nautilus-checksum-menu +Architecture: all +Depends: ${misc:Depends},python-nautilus,md5deep,coreutils,bash +Description: nautilus-checksum-menu + Adds checksum actions to nautilus context menu + +Package: nautilus-emblemize +Architecture: any +Depends: ${misc:Depends},emblemize (>=3.0) +Description: nautilus-emblemize + add set emblem to nautilus context menu to rapidly launch imblemize3 + +Package: nautilus-execute +Architecture: all +Depends: ${misc:Depends},gksu,bash,python,python-nautilus +Description: nautilus-execute + add option to execute a script as a regular user or as a root to nautilus context + menu of files that mime type is executable + +Package: nautilus-gedit +Architecture: all +Depends: ${misc:Depends},gedit,gksu,python-nautilus +Description: nautilus gedit + add option to gedit a file as a regular user or as a root to nautilus context + menu of files that mime type is text/* + +Package: nautilus-hide +Architecture: all +Depends: ${misc:Depends},coreutils,python-nautilus +Description: nautilus-(un)hide + add hide /unide option to nautilus context menu so you can hide + files like movies subtitles without preceeding it with a dot + and keep the same name :) + +Package: nautilus-imgizor +Architecture: all +Depends: ${misc:Depends},imgizor,python-nautilus +Description: nautilus imgizor + add rotate and resize to nautilus context menu + + +Package: nautilus-multimedia-bin +Architecture: all +Depends: ${misc:Depends},zenity,coreutils,libc-bin,gnome-terminal,file,gawk,mplayer,lame,vorbis-tools,libid3tag0,musepack-tools,flac,faac,libfaad2,mencoder,xterm,ffmpeg,imagemagick,bc, libsox-fmt-ffmpeg,imageshack-uploader,imgizor,python,bash,uif2iso,daa2iso,transcode,nrg2iso +Description: nautilus-multimedia-bin + various scripts needed by nautilus-multimedia-menu package + +Package: nautilus-multimedia-menu +Architecture: all +Depends: ${misc:Depends},python-nautilus,nautilus-multimedia-bin,imageshack-uploader,imgizor +Description: nautilus-multimedia-menu + Multimedia Context menu for nautilus actions extra + +Package: nautilus-open-as-root +Architecture: all +Depends: ${misc:Depends},gksu,python-nautilus +Description: nautilus-open-as-root + adds open as root to nautilus context menu + +Package: nautilus-open-terminal-here +Architecture: all +Depends: ${misc:Depends},python-nautilus,gnome-terminal +Description: nautilus-open-terminal-here + nautilus-open-terminal-here is a Nautilus pyhton extension which allows you to + open a terminal in arbitrary local or distant folders. + +Package: nautilus-refresh +Architecture: all +Depends: python-nautilus,xautomation +Description: For those who are comming from windows world and misses the refresh option .. here it is finally lands to ubuntu by Dr. Amr osman + +Package: nautilus-search +Architecture: all +Depends: ${misc:Depends},gnome-search-tool,python-nautilus +Description: nautilus-search + Add gnome-search-tool to context menu + +Package: nautilus-wallpaper-changer +Architecture: all +Depends: ${misc:Depends},zenity,python-nautilus +Description: nautilus-wallpaper-changer + add `set as wallpaper` to nautilus context menu so you can easily change + your background with a simple click + +Package: nautilus-dropbox-share +Architecture: all +Conflicts:dropbox-share +Replaces:drop-share +Depends: python-nautilus, nautilus-dropbox, dropbox-index,xclip,xautomation +Description: nautilus dropbox share scripts + Those are modified scripts to share files and folders in nautilus dropbox folder + modified from package dropbox-share to be compatible with nautilus python not + nautilus scripts by dr3mro@gmail.com diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/copyright nautilus-actions-extra-3.4.0/debian/copyright --- nautilus-actions-extra-0.7.3~ppa1/debian/copyright 2012-01-18 15:06:52.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/copyright 2012-11-17 17:45:48.000000000 +0000 @@ -5,56 +5,20 @@ Files: * Copyright: -License: GPL-3.0+ +License: + + + . + +# If you want to use GPL v2 or later for the /debian/* files use +# the following clauses, or change it to suit. Delete these two lines Files: debian/* -Copyright: 2011 root -daemon -bin -sys -sync -games -man -lp -mail -news -uucp -proxy -www-data -backup -Mailing List Manager -ircd -Gnats Bug-Reporting System (admin) -nobody - - -colord colour management daemon - -Light Display Manager -Avahi autoip daemon -Avahi mDNS daemon -usbmux daemon -Kernel Oops Tracking Daemon -PulseAudio daemon -RealtimeKit -Speech Dispatcher -HPLIP system user - -noob -CouchDB Administrator -Dictd Server - - - - - - -License: GPL-3.0+ - -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify +Copyright: 2012 Amr Osman +License: GPL-2+ + This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or + the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This package is distributed in the hope that it will be useful, @@ -63,10 +27,12 @@ GNU General Public License for more details. . You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". # Please also look if there are files or directories which have a # different copyright/license attached and list them here. +# Please avoid to pick license terms that are more restrictive than the +# packaged work, as it may make Debian's contributions unacceptable upstream. diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-actions-extra.install nautilus-actions-extra-3.4.0/debian/nautilus-actions-extra.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-actions-extra.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-actions-extra.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,3 @@ +pyext/dropshare.py /usr/share/nautilus-python/extensions/ +bins/drop_share /usr/bin/ +bins/drop_unshare /usr/bin diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-advanced-menu.install nautilus-actions-extra-3.4.0/debian/nautilus-advanced-menu.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-advanced-menu.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-advanced-menu.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,6 @@ +pyext/advanced.py /usr/share/nautilus-python/extensions/ +bins/pastebin /usr/bin/ +bins/calsize /usr/bin/ +bins/filetype /usr/bin/ +bins/mountiso /usr/bin/ +bins/unmountiso /usr/bin/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-bin-install.install nautilus-actions-extra-3.4.0/debian/nautilus-bin-install.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-bin-install.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-bin-install.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/installbin.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-checksum-menu.install nautilus-actions-extra-3.4.0/debian/nautilus-checksum-menu.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-checksum-menu.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-checksum-menu.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,5 @@ +pyext/checksums.py /usr/share/nautilus-python/extensions/ +bins/gendirmd5 /usr/bin/ +bins/genmd5 /usr/bin/ +bins/verifymd5 /usr/bin/ +bins/viewmd5 /usr/bin/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-emblemize.install nautilus-actions-extra-3.4.0/debian/nautilus-emblemize.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-emblemize.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-emblemize.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/emblemize.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-execute.install nautilus-actions-extra-3.4.0/debian/nautilus-execute.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-execute.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-execute.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/executeas.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-gedit.install nautilus-actions-extra-3.4.0/debian/nautilus-gedit.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-gedit.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-gedit.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/geditas.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-hide.install nautilus-actions-extra-3.4.0/debian/nautilus-hide.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-hide.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-hide.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,3 @@ +bins/hider /usr/bin/ +bins/unhider /usr/bin/ +pyext/visibility.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-imgizor.install nautilus-actions-extra-3.4.0/debian/nautilus-imgizor.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-imgizor.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-imgizor.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/imgizor.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-multimedia-bin.install nautilus-actions-extra-3.4.0/debian/nautilus-multimedia-bin.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-multimedia-bin.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-multimedia-bin.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,5 @@ +bins/2GIF /usr/bin/ +bins/2JPG /usr/bin/ +bins/2PNG /usr/bin/ +bins/avconvert /usr/bin/ +bins/ConvertAudioFile /usr/bin/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-multimedia-menu.install nautilus-actions-extra-3.4.0/debian/nautilus-multimedia-menu.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-multimedia-menu.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-multimedia-menu.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/multimedia.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-open-as-root.install nautilus-actions-extra-3.4.0/debian/nautilus-open-as-root.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-open-as-root.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-open-as-root.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/open-as-root.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-open-terminal-here.install nautilus-actions-extra-3.4.0/debian/nautilus-open-terminal-here.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-open-terminal-here.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-open-terminal-here.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/open-terminal-here.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-refresh.install nautilus-actions-extra-3.4.0/debian/nautilus-refresh.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-refresh.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-refresh.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/refresh.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-search.install nautilus-actions-extra-3.4.0/debian/nautilus-search.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-search.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-search.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1 @@ +pyext/searchhere.py /usr/share/nautilus-python/extensions/ diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-wallpaper-changer.install nautilus-actions-extra-3.4.0/debian/nautilus-wallpaper-changer.install --- nautilus-actions-extra-0.7.3~ppa1/debian/nautilus-wallpaper-changer.install 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/nautilus-wallpaper-changer.install 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,2 @@ +pyext/set_as_wallpaper.py /usr/share/nautilus-python/extensions/ +bins/wallpaper-changer /usr/bin diff -Nru nautilus-actions-extra-0.7.3~ppa1/debian/rules nautilus-actions-extra-3.4.0/debian/rules --- nautilus-actions-extra-0.7.3~ppa1/debian/rules 2012-01-18 15:06:52.000000000 +0000 +++ nautilus-actions-extra-3.4.0/debian/rules 2012-11-17 17:45:48.000000000 +0000 @@ -1,13 +1,21 @@ #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. +# # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +# This has to be exported to make some magic below work. +export DH_OPTIONS + + %: dh $@ diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/advanced.py nautilus-actions-extra-3.4.0/pyext/advanced.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/advanced.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/advanced.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,187 @@ +#dr3mro@gmail.com +#nautilus python advanced context menu +#v 0.1 + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib +import shutil + + +class AdvancedMenu(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + def pastebin_run(self,menu,file): + path=self.url2path(file) + subprocess.Popen(['/usr/bin/pastebin',path]) + return + + + def emblemize3_run(self,menu,file): + path=self.url2path(file) + subprocess.Popen(['/usr/bin/emblemize3',path]) + return + + def calculate_run(self,menu,file): + path=self.url2path(file) + subprocess.Popen(['/usr/bin/calsize',path]) + return + + def filetype_run(self,menu,file): + path=self.url2path(file) + subprocess.Popen(['/usr/bin/filetype',path]) + return + + def utf2cp1256_run(self,menu,file): + path=self.url2path(file) + backup=path+'.old' + shutil.copyfile(path,backup) + exe=['iconv','-f','utf-8','-t','windows-1256',path,'-o',path] + subprocess.Popen(exe) + return + + def cp12562utf_run(self,menu,file): + path=self.url2path(file) + backup=path+'.old' + shutil.copyfile(path,backup) + exe=['iconv','-f','windows-1256','-t','utf-8',path,'-o',path] + subprocess.Popen(exe) + return + + + def mount_run(self,menu,file): + path=self.url2path(file) + pathdir=os.path.dirname(path) + os.chdir(pathdir) + subprocess.Popen(['gksu','bash','mountiso',path]) + return + + + def unmount_run(self,menu,file): + path=self.url2path(file) + pathdir=os.path.dirname(path) + os.chdir(pathdir) + subprocess.Popen(['gksu','bash','unmountiso',path]) + return + + def paste_mimes(self,file): + mime= file.get_mime_type() + allowedmimes=['application/x-shellscript','text/x-python','application/x-subrip'] + if mime in allowedmimes: + supported=True + elif mime[:4] == 'text': + supported=True + else: + supported=False + return supported + + def mount_mimes(self,file): + mime= file.get_mime_type() + allowedmimes=['application/x-cd-image'] + if mime in allowedmimes: + supported=True + else: + supported=False + return supported + + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + pastebin_supported=self.paste_mimes(file) + mountable=self.mount_mimes(file) + #topmenu + AdvancedTopMenu = Nautilus.MenuItem(name='TopMenuItem::Advanced', + label='Advanced', + tip='Advanced Menu', + ) + + AdvancedSubMenu = Nautilus.Menu() + AdvancedTopMenu.set_submenu(AdvancedSubMenu) + + #pastebin + if filecount ==1 and pastebin_supported and os.path.exists('/usr/bin/pastebin'): + PastebinMenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::Pastebinit', + label='Pastebin uploader', + tip='upload to pastebin', + ) + PastebinMenuItem.connect('activate',self.pastebin_run,file) + AdvancedSubMenu.append_item(PastebinMenuItem) + + #emblemize3 + if filecount ==1 and os.path.exists('/usr/bin/emblemize3'): + Emblemize3MenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::Emblemize3', + label='Set emblem', + tip='emblemize 3.x', + ) + Emblemize3MenuItem.connect('activate',self.emblemize3_run,file) + AdvancedSubMenu.append_item(Emblemize3MenuItem) + + #calculate size + if filecount ==1 and os.path.exists('/usr/bin/calsize'): + CalculateMenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::Calculate', + label='Calculate size', + tip='Calculate size', + ) + CalculateMenuItem.connect('activate',self.calculate_run,file) + AdvancedSubMenu.append_item(CalculateMenuItem) + + #Check file type + if filecount ==1 and os.path.exists('/usr/bin/filetype'): + FileTypeMenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::FileType', + label='Check file type', + tip='Check file type', + ) + FileTypeMenuItem.connect('activate',self.filetype_run,file) + AdvancedSubMenu.append_item(FileTypeMenuItem) + + #convert char encoding utf2cp1256 + if filecount ==1 and os.path.exists('/usr/bin/iconv') and pastebin_supported: + utf2cp1256MenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::utf2cp1256', + label='convert utf8 to cp-1256', + tip='convert utf8 to cp-1256', + ) + utf2cp1256MenuItem.connect('activate',self.utf2cp1256_run,file) + AdvancedSubMenu.append_item(utf2cp1256MenuItem) + + + #convert char encoding utf2cp1256 + if filecount ==1 and os.path.exists('/usr/bin/iconv') and pastebin_supported: + cp12562utfMenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::cp12562utf', + label='convert cp-1256 to utf8', + tip='convert cp-1256 to utf8', + ) + cp12562utfMenuItem.connect('activate',self.cp12562utf_run,file) + AdvancedSubMenu.append_item(cp12562utfMenuItem) + + + #mount ISO + if filecount ==1 and mountable and os.path.exists('/usr/bin/mountiso'): + MountISOMenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::MountISO', + label='Mount ISO', + tip='Mount ISO file', + ) + MountISOMenuItem.connect('activate',self.mount_run,file) + AdvancedSubMenu.append_item(MountISOMenuItem) + + #unmount ISO + if filecount ==1 and mountable and os.path.exists('/usr/bin/unmountiso'): + UNMountISOMenuItem = Nautilus.MenuItem(name='AdvancedSubMenu::UNMountISO', + label='UnMount ISO', + tip='UnMount ISO file', + ) + UNMountISOMenuItem.connect('activate',self.unmount_run,file) + AdvancedSubMenu.append_item(UNMountISOMenuItem) + + return AdvancedTopMenu, diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/checksums.py nautilus-actions-extra-3.4.0/pyext/checksums.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/checksums.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/checksums.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,138 @@ +#checksum +#dr3mro@gmail.com +#0.2 + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + +class Checksum(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + def genmd5(self,menu,files): + exe=['genmd5'] + for file in files: + path=self.url2path(file) + exe.append(path) + subprocess.Popen(exe) + return + + def viewmd5(self,menu,files): + exe=['viewmd5'] + for file in files: + path=self.url2path(file) + exe.append(path) + subprocess.Popen(exe) + return + + def gendirmd5(self,menu,files): + for file in files: + path=self.url2path(file) + subprocess.Popen(['gendirmd5',path]) + return + + + def isdir(self,files): + isdir=False + for file in files: + mime= file.get_mime_type() + if mime =='inode/directory': + isdir=True + return isdir + else: + isdir=False + return isdir + + def isfile(self,files): + isfile=False + for file in files: + mime= file.get_mime_type() + if mime !='inode/directory': + isfile=True + return isfile + else: + isfile=False + return isfile + + def ishash(self,file): + path=self.url2path(file) + extension = os.path.splitext(path)[1] + ext=extension.lower() + if ext == '.md5': + return True + name=os.path.splitext(path)[0] + if 'md5' in name: + return True + return False + + + + def verifymd5(self,menu,file): + path=self.url2path(file) + subprocess.Popen(['verifymd5',path]) + return + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + parent_path=self.url2path(file) + + ishash=self.ishash(file) + isdir=self.isdir(files) + isfile=self.isfile(files) + else: + return + + + ChecksumTopMenu = Nautilus.MenuItem(name='TopMenuItem::Checksum', + label='Checksum', + tip='Checksum', + ) + ChecksumSubMenu = Nautilus.Menu() + ChecksumTopMenu.set_submenu(ChecksumSubMenu) + + if os.path.exists('/usr/bin/genmd5') and not isdir and isfile: + GenMD5Item = Nautilus.MenuItem(name='ChecksumSubMenu::GenMD5', + label='Generate and save MD5', + tip='Generate and save MD5', + ) + GenMD5Item.connect('activate',self.genmd5,files) + ChecksumSubMenu.append_item(GenMD5Item) + + if os.path.exists('/usr/bin/viewmd5') and not isdir and isfile: + ViewMD5Item = Nautilus.MenuItem(name='ChecksumSubMenu::ViewMD5', + label='Generate and view MD5', + tip='Generate and view MD5', + ) + ViewMD5Item.connect('activate',self.viewmd5,files) + ChecksumSubMenu.append_item(ViewMD5Item) + + if os.path.exists('/usr/bin/gendirmd5') and isdir and not isfile: + GenDirMD5Item = Nautilus.MenuItem(name='ChecksumSubMenu::GenDirMD5', + label='Generate MD5 for selected folder(s)', + tip='Generate MD5 for selected folder(s)', + ) + GenDirMD5Item.connect('activate',self.gendirmd5,files) + ChecksumSubMenu.append_item(GenDirMD5Item) + + if filecount == 1 and os.path.exists('/usr/bin/verifymd5') and ishash: + VerifyMD5Item = Nautilus.MenuItem(name='ChecksumSubMenu::VerifyMD5', + label='Verify MD5', + tip='Verify MD5', + ) + VerifyMD5Item.connect('activate',self.verifymd5,file) + ChecksumSubMenu.append_item(VerifyMD5Item) + + + return [ChecksumTopMenu] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/dropshare.py nautilus-actions-extra-3.4.0/pyext/dropshare.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/dropshare.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/dropshare.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,79 @@ +#Drop-share 0.2 +#dr3mro@gmail.com + + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + +class DropShare(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + + def drop_share(self,menu,files): + files_path=['drop_share'] + for file in files: + dropshare_path=self.url2path(file) + files_path.append(dropshare_path) + subprocess.Popen(files_path) + return + + + def drop_unshare(self,menu,files): + files_path=['drop_unshare'] + for file in files: + dropshare_path=self.url2path(file) + files_path.append(dropshare_path) + subprocess.Popen(files_path) + return + + + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + parent_path=self.url2path(file) + parent_path_list=parent_path.split('/') + if 'Dropbox' in parent_path_list: + return + else: + return + + + + DropBoxTopMenu = Nautilus.MenuItem(name='TopMenuItem::DropBox', + label='Dropbox', + tip='Dropbox', + ) + DropBoxSubMenu = Nautilus.Menu() + DropBoxTopMenu.set_submenu(DropBoxSubMenu) + + if os.path.exists('/usr/bin/drop_share'): + DropShareMenuItem = Nautilus.MenuItem(name='DropShareSubMenu::DropShare', + label='Share', + tip='share with dropbox', + ) + DropShareMenuItem.connect('activate',self.drop_share,files) + DropBoxSubMenu.append_item(DropShareMenuItem) + + if os.path.exists('/usr/bin/drop_unshare'): + DropUnshareMenuItem = Nautilus.MenuItem(name='DropUnshareSubMenu::DropUnshare', + label='Unshare', + tip='unshare with dropbox', + ) + DropUnshareMenuItem.connect('activate',self.drop_unshare,files) + DropBoxSubMenu.append_item(DropUnshareMenuItem) + + return [DropBoxTopMenu] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/emblemize.py nautilus-actions-extra-3.4.0/pyext/emblemize.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/emblemize.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/emblemize.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,38 @@ +from gi.repository import Nautilus, GObject +import subprocess +import urllib +import os + +class Emblemize(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + def emblemize_run(self,menu,file): + emblemize_path=self.url2path(file) + subprocess.Popen(['/usr/bin/emblemize3',emblemize_path]) + return + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + else: + return + + if filecount ==1 and os.path.exists('/usr/bin/emblemize3'): + file = files[0] + item = Nautilus.MenuItem( + name="EmblemizeMenu::Emblemize", + label="set emblem", + tip="set emblem" + ) + item.connect('activate', self.emblemize_run, file) + return [item] + else: + return diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/executeas.py nautilus-actions-extra-3.4.0/pyext/executeas.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/executeas.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/executeas.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,84 @@ +#execute as menu +#Dr. Amr Osman +#dr3mro@gmail.com +#0.2 + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + +class ExcuteAs(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + + def as_user(self,menu,file): + file_path=self.url2path(file) + dirname=os.path.dirname(file_path) + script=os.path.basename(file_path) + os.chdir(dirname) + dotslash='./'+script + subprocess.Popen([dotslash]) + return + + + def as_root(self,menu,file): + file_path=self.url2path(file) + dirname=os.path.dirname(file_path) + script=os.path.basename(file_path) + os.chdir(dirname) + dotslash='./'+script + subprocess.Popen(['gksu',dotslash]) + return + + + def check_mimes(self,file): + mime= file.get_mime_type() + allowedmimes=['application/x-shellscript','text/x-python','application/x-executable'] + if mime in allowedmimes: + supported=True + else: + supported=False + return supported + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + supported=self.check_mimes(file) + ExecuteAsTopMenu = Nautilus.MenuItem(name='TopMenuItem::ExecuteAs', + label='Execute as', + tip='Execute as', + ) + ExecuteAsSubMenu = Nautilus.Menu() + ExecuteAsTopMenu.set_submenu(ExecuteAsSubMenu) + + + + if filecount == 1 and supported: + UserMenuItem = Nautilus.MenuItem(name='ExecuteAsSubMenu::User', + label='User', + tip='excute this script as user', + ) + UserMenuItem.connect('activate',self.as_user,file) + ExecuteAsSubMenu.append_item(UserMenuItem) + + if filecount == 1 and supported: + RootMenuItem = Nautilus.MenuItem(name='ExecuteAsSubMenu::Root', + label='Root', + tip='execute this script as root', + ) + RootMenuItem.connect('activate',self.as_root,file) + ExecuteAsSubMenu.append_item(RootMenuItem) + + return [ExecuteAsTopMenu] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/geditas.py nautilus-actions-extra-3.4.0/pyext/geditas.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/geditas.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/geditas.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,90 @@ +#gedit as menu +#dr3mro@gmail.com +#0.2 + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + +class Geditas(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + + def as_user(self,menu,files): + files_path=['gedit'] + for file in files: + gedit_path=self.url2path(file) + files_path.append(gedit_path) + subprocess.Popen(files_path) + return + + + def as_root(self,menu,files): + files_path=['gksu','gedit'] + for file in files: + gedit_path=self.url2path(file) + files_path.append(gedit_path) + subprocess.Popen(files_path) + return + + + def check_mimes(self,files): + for file in files: + mime= file.get_mime_type() + mime_list=mime.split('/') + allowedmimes=['application/x-designer','application/x-shellscript','application/xml'] + if mime_list[0] =='text': + none_text=False + elif mime in allowedmimes: + none_text=False + else: + none_text=True + return none_text + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + else: + return + + + GeditAsTopMenu = Nautilus.MenuItem(name='TopMenuItem::GeditAs', + label='Gedit as', + tip='gedit as', + ) + GeditAsSubMenu = Nautilus.Menu() + GeditAsTopMenu.set_submenu(GeditAsSubMenu) + + + none_text=self.check_mimes(files) + + + if os.path.exists('/usr/bin/gedit') and not none_text: + UserMenuItem = Nautilus.MenuItem(name='GeditAsSubMenu::User', + label='User', + tip='open this file in gedit as user', + ) + UserMenuItem.connect('activate',self.as_user,files) + GeditAsSubMenu.append_item(UserMenuItem) + + if os.path.exists('/usr/bin/gedit') and os.path.exists('/usr/bin/gksu') and not none_text: + RootMenuItem = Nautilus.MenuItem(name='GeditAsSubMenu::Root', + label='Root', + tip='open this file in gedit as root', + ) + RootMenuItem.connect('activate',self.as_root,files) + GeditAsSubMenu.append_item(RootMenuItem) + + return [GeditAsTopMenu] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/imgizor.py nautilus-actions-extra-3.4.0/pyext/imgizor.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/imgizor.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/imgizor.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,39 @@ +from gi.repository import Nautilus, GObject +import subprocess +import urllib +import os + +class Imgizor(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + def imgizor_run(self,menu,file): + imgizor_path=self.url2path(file) + subprocess.Popen(['/usr/bin/imgizor',imgizor_path]) + return + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + mimetype=file.get_mime_type() + else: + mimetype="" + + if filecount ==1 and mimetype[:5] == 'image' and os.path.exists('/usr/bin/imgizor'): + file = files[0] + item = Nautilus.MenuItem( + name="ImgizorMenu::Imgizor", + label="open with Imgizor", + tip="open with Imgizor" + ) + item.connect('activate', self.imgizor_run, file) + return [item] + else: + return diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/installbin.py nautilus-actions-extra-3.4.0/pyext/installbin.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/installbin.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/installbin.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,57 @@ +#install dot bin +#Dr. Amr Osman +#dr3mro@gmail.com +#0.2 + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + +class InstallBin(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + def install(self,menu,file): + file_path=self.url2path(file) + dirname=os.path.dirname(file_path) + script=os.path.basename(file_path) + os.chdir(dirname) + dotslash='./'+script + subprocess.Popen(['gnome-terminal','-x','sudo','sh',dotslash]) + return + + + def check_mimes(self,file): + mime= file.get_mime_type() + allowedmimes=['application/octet-stream'] + if mime in allowedmimes: + supported=True + else: + supported=False + return supported + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + supported=self.check_mimes(file) + else: + return + + if filecount == 1 and supported: + InstallMenu = Nautilus.MenuItem(name='MenuItem::Install', + label='Install', + tip='install', + ) + InstallMenu.connect('activate',self.install,file) + return [InstallMenu] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/meld.py nautilus-actions-extra-3.4.0/pyext/meld.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/meld.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/meld.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,219 @@ +# --*-- encoding: utf-8 --*-- + +# Nautilus-Meld +# Nautilus extension to invoke Meld for comparing selected files/folders +# ng.hong.quan@gmail.com +# Require Python >= 2.7 + +_VERSION = '0.1' + +import os +import subprocess +import urllib +from collections import deque +from gi.repository import Nautilus, GObject + +class DequeSet(deque): + ''' Data type like collections.deque, but only allow 1 occurence of each element ''' + def append(self, x): + if len(self) and self[-1] == x: + return + if x in self: + self.remove(x) + super(DequeSet, self).append(x) + + def appendleft(self, x): + if len(self) and self[0] == x: + return + if x in self: + self.remove(x) + super(DequeSet, self).appendleft(x) + + def extend(self, iterable): + dup = [x for x in self if x in iterable] + [self.remove(x) for x in dup] + super(DequeSet, self).extend(iterable) + + def extendleft(self, iterable): + dup = [x for x in self if x in iterable] + [self.remove(x) for x in dup] + super(DequeSet, self).extendlef(iterable) + + +class MeldExtension(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + try: + meldbin = subprocess.check_output(['which', 'meld']) + self.meldbin = meldbin.strip() + except subprocess.CalledProcessError: + self.meldbin = None + return + + self.queue = DequeSet([], 3) + + # Create menu items, not attach to Nautilus menu yet + self.item_meld = Nautilus.MenuItem( + name='MeldExtension::meld_item', + label='Compare in Meld', + tip='Compare in Meld', + icon='meld') + self._makeitem_compare_each_other() + self._makeitem_compare_with_last() + self._makeitem_queue() + self._makeitem_empty() + + def _makeitem_compare_each_other(self): + self.item_comp_each = Nautilus.MenuItem( + name='MeldExtension::compare_each', + label='Compare each other', + tip='Compare each other', + icon='edit-copy') + + def _makeitem_compare_with_last(self): + self.item_comp_last = Nautilus.MenuItem( + name='MeldExtension::compare_last', + label='Compare', + tip='Compare', + icon='edit-copy') + + def _makeitem_queue(self): + self.item_queue = Nautilus.MenuItem( + name='MeldExtension::add_file', + label='Queue', + tip='Add to queue', + icon='document-import') + + def _makeitem_empty(self): + self.item_empt = Nautilus.MenuItem( + name='MeldExtension::empty_queue', + label='Empty queue', + tip='Empty queue', + icon='edit-clear') + + def get_file_items(self, window, files): + if self.meldbin is None: + return + + qlen = len(self.queue) + flen = len(files) + if flen == 0 or flen + qlen > 3: + return + + if not arelocal(files): + return + + fls = [get_location(f) for f in files] + meldmenu = self.attach_meldmenu() + if qlen > 0: + self.opt_compare_with_last(meldmenu, fls) + elif flen > 1: + self.opt_compare_each_other(meldmenu, fls) + + if qlen + flen < 3: + self.opt_queue(meldmenu, fls) + + if qlen > 0: + self.opt_empty(meldmenu) + + return (self.item_meld,) # 1-tuple + + + def opt_compare_each_other(self, menu, files): + self.remove_old_handler(self.item_comp_each) + hl = self.item_comp_each.connect('activate', self.launch_meld_batch, files) + self.item_comp_each.handler = hl + menu.append_item(self.item_comp_each) + + def opt_compare_with_last(self, menu, files): + self.remove_old_handler(self.item_comp_last) + last = self.queue[-1] + last = os.path.basename(last) + label = 'Compare with {0}'.format(mid_ellipsis(last).replace('_', '__')) + self.item_comp_last.set_property('label', label) + self.item_comp_last.set_property('tip', 'Compare with {0}'.format(last)) + hl = self.item_comp_last.connect('activate', self.add_to_meld, files) + self.item_comp_last.handler = hl + menu.append_item(self.item_comp_last) + + def opt_queue(self, menu, files): + self.remove_old_handler(self.item_queue) + if len(files) == 1: + f = os.path.basename(files[0]) + self.item_queue.set_property('label', 'Queue {0}'.format(mid_ellipsis(f).replace('_', '__'))) + self.item_queue.set_property('tip', 'Add {0} to queue'.format(f)) + else: + self.item_queue.set_property('label', 'Queue these files') + self.item_queue.set_property('tip', 'Add these files to queue') + + hl = self.item_queue.connect('activate', self.add_files, files) + self.item_queue.handler = hl + menu.append_item(self.item_queue) + + def opt_empty(self, menu): + self.remove_old_handler(self.item_empt) + hl = self.item_empt.connect('activate', self.empty_queue) + self.item_empt.handler = hl + menu.append_item(self.item_empt) + + def add_file(self, menu, file): + self.queue.append(file) + + def add_files(self, menu, files): + self.queue.extend(files) + + def empty_queue(self, menu): + self.queue.clear() + + def add_to_meld(self, menu, files): + self.queue.extend(files) + opts = ' '.join([wrap_filename(f) for f in self.queue]) + self.queue.clear() + comm = '{0} {1} &'.format(self.meldbin, opts) + os.system(comm) + + def launch_meld_batch(self, menu, files): + opt = ' '.join([wrap_filename(f) for f in files]) + self.queue.clear() + comm = '{0} {1} &'.format(self.meldbin, opt) + print(comm) + os.system(comm) + + def attach_meldmenu(self): + menu = Nautilus.Menu() + self.item_meld.set_submenu(menu) + return menu + + def remove_old_handler(self, item): + try: + ohl = item.handler + except AttributeError: + return + if ohl: + item.disconnect(ohl) + + +#---- Functions ----# + +MAXCHAR = 16 + +def arelocal(files): + for f in files: + if not f.get_uri().startswith("file://"): + return False + return True + +def escape_quote(string): + return string.replace('"', '\\"') + +def get_location(file): + return urllib.unquote(file.get_uri()[7:]) + +def mid_ellipsis(strg, length=MAXCHAR): + if len(strg) > length: + mid = length/2 + return strg[:mid] + '…' + strg[-(length-mid-1):] + else: + return strg + +def wrap_filename(fn): + return '"{0}"'.format(escape_quote(fn)) \ No newline at end of file diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/multimedia.py nautilus-actions-extra-3.4.0/pyext/multimedia.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/multimedia.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/multimedia.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,197 @@ +#dr3mro@gmail.com +#nautilus python multimedia context menu +#v 0.1 + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + + +class MultiMediaMenu(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + def imgizor_run(self,menu,file): + imgizor_path=self.url2path(file) + subprocess.Popen(['/usr/bin/imgizor',imgizor_path]) + return + + + def imageshack_run(self,menu,files): + files_path=['imageshack-uploader'] + for file in files: + imageshack_path=self.url2path(file) + files_path.append(imageshack_path) + subprocess.Popen(files_path) + return + + + def gifconvert_run(self,menu,files): + files_path=['2GIF'] + for file in files: + gif_path=self.url2path(file) + files_path.append(gif_path) + subprocess.Popen(files_path) + return + + + def jpgconvert_run(self,menu,files): + files_path=['2JPG'] + for file in files: + jpg_path=self.url2path(file) + files_path.append(jpg_path) + subprocess.Popen(files_path) + return + + + def pngconvert_run(self,menu,files): + files_path=['2PNG'] + for file in files: + png_path=self.url2path(file) + files_path.append(png_path) + subprocess.Popen(files_path) + return + + + + def avconvert_run(self,menu,file): + avconvert_path=self.url2path(file) + subprocess.Popen(['/usr/bin/avconvert',avconvert_path]) + return + + def optipng_run(self,menu,file): + optipng_path=self.url2path(file) + subprocess.Popen(['/usr/bin/optipng',optipng_path]) + return + + def audioconvert_run(self,menu,file): + audioconvert_path=self.url2path(file) + subprocess.Popen(['/usr/bin/ConvertAudioFile',audioconvert_path]) + return + + + + + def get_file_items(self, window, files): + filecount=len(files) + mimetype="" + if filecount > 0 : + file=files[0] + mimetype=file.get_mime_type() + + + ############################################################################### + #Multimedia Top Menu + ############################################################################### + MultiMediaTopMenu = Nautilus.MenuItem(name='TopMenuItem::MultiMedia', + label='Multimedia', + tip='Multimedia Menu', + ) + + MultiMediaSubMenu = Nautilus.Menu() + MultiMediaTopMenu.set_submenu(MultiMediaSubMenu) + + ############################################################################### + #imgizor menu + ############################################################################### + if filecount ==1 and mimetype[:5] == 'image' and os.path.exists('/usr/bin/imgizor'): + ImgizorMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::Imgizor', + label='Imgizor', + tip='Image Resize & Rotate', + ) + ImgizorMenuItem.connect('activate',self.imgizor_run,file) + MultiMediaSubMenu.append_item(ImgizorMenuItem) + + ############################################################################### + #Imageshack.us + ############################################################################### + if mimetype[:5] == 'image' and os.path.exists('/usr/bin/imageshack-uploader'): + ImageshackMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::Imageshack', + label='Imageshack.us uploader', + tip='upload to imageshack.us', + ) + ImageshackMenuItem.connect('activate',self.imageshack_run,files) + MultiMediaSubMenu.append_item(ImageshackMenuItem) + + ############################################################################### + #AVConvert + ############################################################################### + AV_mimes=['image','video','audio'] + Xmimes=['application/vnd.rn-realmedia'] + if filecount ==1 or mimetype[:5] in AV_mimes or mimetype in Xmimes and os.path.exists('/usr/bin/avconvert'): + AVConvertMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::AVConvert', + label='AVConvert', + tip='Convert with AVConvert', + ) + AVConvertMenuItem.connect('activate',self.avconvert_run,file) + MultiMediaSubMenu.append_item(AVConvertMenuItem) + + ############################################################################### + #AudioConvert + ############################################################################### + if filecount ==1 and mimetype[:5] == 'audio' and os.path.exists('/usr/bin/ConvertAudioFile'): + AudioConvertMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::AudioConvert', + label='AudioConvert', + tip='Convert Audio', + ) + AudioConvertMenuItem.connect('activate',self.audioconvert_run,file) + MultiMediaSubMenu.append_item(AudioConvertMenuItem) + + ############################################################################### + #GIFConvert + ############################################################################### + if mimetype[:5] == 'image' and mimetype != 'image/gif' and os.path.exists('/usr/bin/2GIF'): + GIFConvertMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::GIFConvert', + label='Convert to GIF', + tip='Convert image into GIF', + ) + GIFConvertMenuItem.connect('activate',self.gifconvert_run,files) + MultiMediaSubMenu.append_item(GIFConvertMenuItem) + + ############################################################################### + #JPGConvert + ############################################################################### + jpg_forbed=['image/jpg' ,'image/jpeg'] + if mimetype[:5] == 'image' and mimetype not in jpg_forbed and os.path.exists('/usr/bin/2JPG'): + + JPGConvertMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::JPGConvert', + label='Convert to JPG', + tip='Convert image into JPG', + ) + JPGConvertMenuItem.connect('activate',self.jpgconvert_run,files) + MultiMediaSubMenu.append_item(JPGConvertMenuItem) + + ############################################################################### + #PNGConvert + ############################################################################### + if mimetype[:5] == 'image' and mimetype != 'image/png' and os.path.exists('/usr/bin/2PNG'): + PNGConvertMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::PNGConvert', + label='Convert to PNG', + tip='Convert image into PNG', + ) + PNGConvertMenuItem.connect('activate',self.pngconvert_run,files) + MultiMediaSubMenu.append_item(PNGConvertMenuItem) + + ############################################################################### + #Optimize PNG + ############################################################################### + if filecount ==1 and mimetype == 'image/png' and os.path.exists('/usr/bin/optipng'): + OptimizePNGMenuItem = Nautilus.MenuItem(name='MultiMediaSubMenu::OptimizePNG', + label='Optimize PNG', + tip='Optimize PNG', + ) + OptimizePNGMenuItem.connect('activate',self.optipng_run,file) + MultiMediaSubMenu.append_item(OptimizePNGMenuItem) + + ############################################################################### + return MultiMediaTopMenu, + diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/open-as-root.py nautilus-actions-extra-3.4.0/pyext/open-as-root.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/open-as-root.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/open-as-root.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,41 @@ +#nautilus open as root +#dr3mro@gmail.com +#version 0.2 + +from gi.repository import Nautilus, GObject +import subprocess,os +import urllib +import re + + +class OpenAsRoot(GObject.GObject, Nautilus.MenuProvider): + + def __init__(self): + pass + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return re.escape(path) + + def run(self, menu,url): + path=self.url2path(url) + args="gvfs-open %s" %path + subprocess.Popen(["gksu",args]) + + def get_file_items(self, window, files): + if len(files) != 1: + return + + file = files[0] + + item = Nautilus.MenuItem( + name="MenuItem:OpenAsRoot", + label="Open as Root...", + tip="Open as Root !", + icon="face-devilish" + ) + + item.connect('activate', self.run,file) + return [item] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/open-terminal-here.py nautilus-actions-extra-3.4.0/pyext/open-terminal-here.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/open-terminal-here.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/open-terminal-here.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,62 @@ +#nautilus open terminal here +#dr3mro@gmail.com +#version 0.2 + +from gi.repository import Nautilus +from gi.repository import GObject +import subprocess +import os +import urllib + +class TerminalMenu(GObject.GObject, Nautilus.MenuProvider): + + def __init__(self): + pass + + def url2path(self,url): + path=urllib.url2pathname(url[7:]) + return path + + + def terminal(self, menu,path): + curpath="%s"%path + bash_string=["gnome-terminal","--geometry",'100x25',"--working-directory",curpath] + subprocess.Popen(bash_string) + + def get_file_items(self, window, files): + if len(files) != 1: + return + + file = files[0] + + if file.is_directory(): + item = Nautilus.MenuItem( + name="MenuItem:Terminal", + label="Open Terminal Here", + tip="Open Terminal Here" + ) + path_uri = file.get_uri() + path=self.url2path(path_uri) + item.connect('activate', self.terminal,path) + return [item] + else: + return + + def get_background_items(self, window,location): + path_uri = location.get_uri() + if path_uri == 'x-nautilus-desktop:///': + path_uri= "file://"+ os.path.expanduser("~")+"/Desktop" + + if path_uri[:7] != 'file://': + return + + path=self.url2path(path_uri) + terminal = Nautilus.MenuItem( + name="MenuItem::Terminal", + label="Open Terminal Here", + tip="Open Terminal Here" + ) + + terminal.connect('activate', self.terminal,path) + + return [terminal] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/refresh.py nautilus-actions-extra-3.4.0/pyext/refresh.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/refresh.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/refresh.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,28 @@ +#nautilus refresh +#dr3mro@gmail.com +#version 0.7 + +from gi.repository import Nautilus, GObject +import os + +class RefreshMenu(GObject.GObject, Nautilus.MenuProvider): + + def __init__(self): + self.xte_str="xte 'keydown Control_L' 'key R' 'keyup Control_L'" + + def refresh(self,menu): + os.system(self.xte_str) + + + def get_background_items(self, window, location): + + item = Nautilus.MenuItem( + name="MenuItem::Refresh", + label="Refresh", + tip="Reload icons" + ) + + item.connect('activate', self.refresh) + + return [item] + diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/searchhere.py nautilus-actions-extra-3.4.0/pyext/searchhere.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/searchhere.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/searchhere.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,56 @@ +#nautilus search +#dr3mro@gmail.com +#version 0.2 + +from gi.repository import Nautilus, GObject +import subprocess,os, urllib, shlex + +class SearchMenu(GObject.GObject, Nautilus.MenuProvider): + + def __init__(self): + pass + + def search(self, menu,path): + p = urllib.unquote(path[7:]) # Convert %20 to space + cm = "gnome-search-tool --path=\"%s\" --contains=" %p + args = shlex.split(cm) # To correctly handle the quote " in command arguments + subprocess.Popen(args) + + def get_file_items(self, window, files): + if len(files) != 1: + return + + file = files[0] + + if file.is_directory(): + item = Nautilus.MenuItem( + name="MenuItem:Search", + label="Search here...", + tip="Search here !", + icon="edit-find" + ) + path = file.get_uri() + item.connect('activate', self.search,path) + return [item] + else: + return + + def get_background_items(self, window,location): + path = location.get_uri() + + if path == 'x-nautilus-desktop:///': + path= "file://"+ os.path.expanduser("~")+"/Desktop" + + if path[:7] != 'file://': + return + + search = Nautilus.MenuItem( + name="MenuItem::Search", + label="Search here...", + tip="Search here !", + icon="edit-find" + ) + + search.connect('activate', self.search,path) + + return [search] diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/set_as_wallpaper.py nautilus-actions-extra-3.4.0/pyext/set_as_wallpaper.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/set_as_wallpaper.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/set_as_wallpaper.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,40 @@ +#dr3mro@gmail.com +#Dr. Amr Osman +#v 1.1 + +from gi.repository import Nautilus, GObject +import subprocess +import urllib +import os + +class MainMenuWallpaper(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + def url2path(self,url): + fileuri= url.get_activation_uri() + path=urllib.url2pathname(fileuri) + return path + + def wallpaper_run(self,menu,file): + wallpaper_path=self.url2path(file) + subprocess.Popen(['/usr/bin/wallpaper-changer',wallpaper_path]) + return + + def get_file_items(self, window, files): + filecount=len(files) + if filecount == 0 : + return + else : + file=files[0] + mimetype=file.get_mime_type() + if filecount ==1 and mimetype[:5] == 'image' and os.path.exists('/usr/bin/wallpaper-changer'): + item = Nautilus.MenuItem( + name="MenuItem::SetasWallpaper", + label="Set as wallpaper", + tip="Set as wallpaper" + ) + item.connect('activate', self.wallpaper_run, file) + return [item] + else: + return diff -Nru nautilus-actions-extra-0.7.3~ppa1/pyext/visibility.py nautilus-actions-extra-3.4.0/pyext/visibility.py --- nautilus-actions-extra-0.7.3~ppa1/pyext/visibility.py 1970-01-01 00:00:00.000000000 +0000 +++ nautilus-actions-extra-3.4.0/pyext/visibility.py 2012-11-17 17:45:48.000000000 +0000 @@ -0,0 +1,73 @@ +#(un)hide 0.2 +#dr3mro@gmail.com + + +from gi.repository import Nautilus, GObject +import os +import subprocess +import urllib + +class Visibility(GObject.GObject, Nautilus.MenuProvider): + def __init__(self): + pass + + + + def url2path(self,url): + fileuri= url.get_activation_uri() + arg_uri=fileuri[7:] + path=urllib.url2pathname(arg_uri) + return path + + + + def hide(self,menu,files): + files_path=['hider'] + for file in files: + hide_path=self.url2path(file) + files_path.append(hide_path) + subprocess.Popen(files_path) + return + + + def unhide(self,menu,files): + files_path=['unhider'] + for file in files: + unhide_path=self.url2path(file) + files_path.append(unhide_path) + subprocess.Popen(files_path) + return + + + + def get_file_items(self, window, files): + filecount=len(files) + if filecount > 0 : + file=files[0] + else: + return + + VisibilityTopMenu = Nautilus.MenuItem(name='TopMenuItem::Visibility', + label='(Un)Hide', + tip='hide / unhide', + ) + VisibilitySubMenu = Nautilus.Menu() + VisibilityTopMenu.set_submenu(VisibilitySubMenu) + + if os.path.exists('/usr/bin/hider'): + HideMenuItem = Nautilus.MenuItem(name='HideSubMenu::Hide', + label='Hide', + tip='hide', + ) + HideMenuItem.connect('activate',self.hide,files) + VisibilitySubMenu.append_item(HideMenuItem) + + if os.path.exists('/usr/bin/unhider'): + UnhideMenuItem = Nautilus.MenuItem(name='UnhideSubMenu::Unhide', + label='UnHide', + tip='unhide', + ) + UnhideMenuItem.connect('activate',self.unhide,files) + VisibilitySubMenu.append_item(UnhideMenuItem) + + return [VisibilityTopMenu]