S.S.re (simply smart renamer)
Έχει συμβεί σε πολλούς να θέλουν να μετονομασθούν, μερικά αρχεία σε έναν φάκελο που περιέχει πάρα πολλά αρχεία π.χ σε έναν φάκελο με 50 αρχεία θέλω να μετονομασθούν το πρώτο το δέκατο και το εικοστoπεμτο, τότε θα ανοίξω το φάκελο με τα αρχεία θα ψάξω και θα μετονομασω με δεξί κλικ αυτά που θέλω.
Έμενα μου φάνηκε λίγο βαρετή η όλη διαδικασία και γι' αυτό έφτιαξα το S.S.Re (simply smart renamer). Τη κάνει το S.S.Re? Λοιπόν παίρνει όλα τα ονόματα από τα αρχεία που βρίσκονται στο φάκελο που το τρέχετε και σας τα βγάζει σε ένα editable info box, εκεί κάνετε της αλλαγές που θέλετε το κλείνεται απαντάτε ναι στην ερώτηση που θα βγει και όλα τα αρχεία έχουν μετονομαστεί.
ΠΡΟΣΟΧΗ ΣΤΗΝ ΜΕΤΟΝΟΜΑΣΙΑ ΑΛΛΑΖΕΤΑΙ ΤΟ ΟΝΟΜΑ ΜΟΝΟ ΔΕΝ ΑΛΛΑΖΟΥΜΕ ΤΗΝ ΚΑΤΑΛΗΞΗ. ΔΗΛΑΔΗ ΑΛΛΑΓΕΣ ΠΡΙΝ ΤΗΝ ΤΕΛΕΙΑ. Μόνο σε μια περίπτωση κάνουμε αλλαγές μετά την τελεία (κατάληξη) π.χ έχουμε ένα αρχείο με το όνομα file.JPG και θέλουμε να το κάνουμε file.jpg δηλαδή να κάνουμε τα κεφαλαία μικρά. ΜΟΝΟ ΤΟΤΕ ΑΛΛΑΖΟΥΜΕ ΤΗΝ ΚΑΤΑΛΗΞΗ.
Θα πρέπει να έχετε το zenity στο σύστημα σας και φυσικά να το βάλετε στο δεξί κλικ του Ναυτίλου.
#!/bin/bash # S.S.Re (simply smart renamer) a simple tool to rename multiple files. # This tool is a graphical fronted which uses Zenity and basic command # line tools to rename multiple files. # You must have zenity in your system. # Author: TROiKAS troikas@pathfinder.gr # To begin with, set the app title and version TITLE="S.S.Re" VERSION="1.0" # Set window title and window width WINDOW_TITLE=$TITLE" (v"$VERSION")" WINDOW_WIDTH=325 WINDOW_HEIGHT=500 # Paths to needed executables. Please adjust as necessary Zenity=/usr/bin/zenity Printf=/usr/bin/printf Ls=/bin/ls Sed=/bin/sed Mv=/bin/mv Rm=/bin/rm Notify=/usr/bin/notify-send # Check if Zenity can be found. If not, produce error message # (with "xmessage", since zenity is not available) and bail out if [ ! -e "$Zenity" ]; then xmessage "ERROR: $Zenity not found. You must install the Zenity\ package, or provide an alternative location" exit fi # Remove 'space', so filenames with spaces work well. IFS="`$Printf '\n\t'`" # Take all filenames and write in name.txt $Ls -1 > .name.txt FILE=.name.txt # Create text info dialog with filenames. # Here you can edit the filenames. # And save as name.txt.edit $Zenity --text-info --editable \ --width $WINDOW_WIDTH --height $WINDOW_HEIGHT \ --title="$WINDOW_TITLE" \ --filename=$FILE > $FILE.edit # Create a question dialog if you want rename the files. $Zenity --question --width $WINDOW_WIDTH --title="$WINDOW_TITLE" \ --text="Do you want to rename the files?" # Start rename the files. if [[ $? == 0 ]] ; then a=1 for i in `$Ls` do Line=$($Sed -ne "$a p" $FILE.edit) echo $Line $Mv -n $i $Line a=$[$a + 1] done else # If user abort stop everything remove all files # created by the script and then exit. $Rm -rf .name.txt $FILE.edit exit fi # Remove all files created by the script $Rm -rf .name.txt $FILE.edit # Notify when all finish and then exit. $Notify "$WINDOW_TITLE" \ "All files renamed." exit
Θα ηθελα την γνωμη σας, και μερικες συμβουλες απο οσους γνωριζουν καλυτερα απο σκριπτακια.
Body Mind Spirit

















// *** μη εποικοδομητικό σχόλιο ***
Μπράβο ρε troikas.
απλό, οργανωμένο, όμορφο και σχολιασμέμνο.
Καλή αρχή και σύντομα μ'ενα gui
:)
PS δεν το δοκίμασα ακόμα
Ευχαριστω αν το δοκιμασεις πες μου αν κανει σωστα την δουλεια του. Τωρα για gui στην αρχη ειμαι ακομη μαθαινω.
Body Mind Spirit
Body Mind Spirit
Body Mind Spirit