X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=renamepic;h=9d6545e2bcfce31cc53587d05d75b9a22d28bf20;hb=4f968d8160adb588f775084d80293193b7f4e567;hp=be6f9e1147f648d7e9b91940618367a6958260d1;hpb=f61d8ff4404eae85540dc88bdcab38cfc6029615;p=bin.git diff --git a/renamepic b/renamepic index be6f9e1..9d6545e 100755 --- a/renamepic +++ b/renamepic @@ -99,17 +99,18 @@ while (defined($_ = $current_directory->read)) { # Rename foreach my $picture (@pictures) { - my $line = sprintf('%03s',$file_counter).$$picture{default_name}; # view the image - `feh -Z $$picture{old_name} > /dev/null` unless $$config{renumber_only}; + `feh -FZ $$picture{old_name} > /dev/null` unless $$config{renumber_only}; #prompt to rename the picture print "Rename $$picture{old_name}\n"; # sprintf('%03s',$file_counter); - $line = $readline->readline('new name:',$line) + $$picture{clean_old_name} = $readline->readline('new name:',$$picture{clean_old_name}) unless $$config{renumber_only}; + my $line = sprintf('%03s',$file_counter).qq(_$$picture{clean_old_name}_$$picture{picture_time}.$$picture{extension}); + # Remove leading and trailing spaces, replace all remaining # spaces with _, and remove ugly characters. lowercase everything # while we're at it.