]> git.donarmstrong.com Git - bin.git/blobdiff - renamepic
add mutt alias which executes neomutt if that exists
[bin.git] / renamepic
index 9fcc567d8c1063af8101b0b40b80d5c48b2c7b05..a248e6806ef8e6cd79d901e6fe69bbf6d4802d4d 100755 (executable)
--- a/renamepic
+++ b/renamepic
@@ -40,7 +40,7 @@ my $config = {counter_start => 1,
 
 ($config->{program_name}) = $0 =~/([^\/]+)\s*$/;
 
-GetOptions($config,'counter_start|c=i','renumber_only|r!');
+GetOptions($config,'counter_start|c=i','renumber_only|renumber-only|r!');
 
 if ($#ARGV < 0) {
      print STDERR "No Directory Specified\nUsage:  $config->{program_name} <directory>\n";
@@ -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
-     `xview -shrink $$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.