[SOLVED]: Batch file renaming programs

Forum Forums Official Releases antiX-21 “Grup Yorum” [SOLVED]: Batch file renaming programs

  • This topic has 46 replies, 11 voices, and was last updated May 8-6:34 pm by blur13.
Viewing 15 posts - 31 through 45 (of 47 total)
  • Author
    Posts
  • #82149
    Member
    Robin
    Helpful
    Up
    0
    ::

    Thanks for the link, iznit. I should have stressed the word “cutting”, and yes, I’ve done this using ffmpeg already, and I do know to handle audacity with its multiple tracks and all its complex settings. In the first place, audacity needs to re-encode the mp3-file to open it before you can work on it (it imports the file instead of simply opening it). When writing, you have to export it again, so the complete file has to get re-encoded a second time. So this detour will reduce quality of the result noticeably compared with the special direct cutting method used by mp3directcut (it’s actually just doing what its name reads). Even when ffmpeg is able to cut without re-encoding under distinct conditions, this is way more difficult to handle than this »stupid« windows program. (I mean “stupid” here not in terms what this program is able to do, no, it is really great in my eyes, I know and use it for many years already, but I want to express this way that there is no originary linux version of it.) Just try in wine what you can do with it, it runs fine this way. If there is a linux equivalent with these features, I’d be glad to come to know of it. To be clear: Yes, I really like audacity for all the things you can do with it. But when it’s about lossless cutting simply, there is no way around mp3directcut I’d know of.

    Windows is like a submarine. Open a window and serious problems will start.

    #82161
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    I searched, and couldn’t find an exact match for the name “Bulk Renamer”. But I did find a program for Win10, which reminds me a lot of an excellent bulk renaming utility from the XP era, called “14a-rename”; except, I think this one’s even better.
    Very capable Batch renaming program for Win10

    There’s a link to a demo video on the page, and I thought it was a very good vid.

    #82162
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    Robin, Audacity IS available in Linux, and so is Audacious.
    You should be able to download it via the normal AntiX repos.

    #82163
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    I’ve found an excellent batch renaming utility for Linux, available via the AntiX repos.

    The name is “gprename”. It seems to be a fork of the excellent (now defunct, abandoned) “pyRenamer” program. It needs further work, to reinstate the capability for manual renaming of single files, but other than that it seems up to speed.

    The other shortcoming of gprename, is it’s got 2 glitches in the setup/installation routines. It installs properly, but it doesn’t get listed in the Menu, and it doesn’t get a .desktop launcher under /usr/share/applications. But, if you type its name into the /Menu/Run/ box, and press Enter, the program runs properly (as far as I can tell).

    #82165
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    So, how can I set up a launcher for gprename?

    It’s not listed in the Menu, and there’s no .desktop file under /usr/share/applications.
    But, it IS available via the Menu/Run command.

    I tried creating a link on the desktop with the target being simply “gprename”, and that didn’t work.

    #82166
    Member
    Robin
    Helpful
    Up
    0
    ::

    #1 Just for completeness want to remind of the onboard tool we have for bulk renaming, but sorry, it’s command line only: Type simply rename [options] expression replacement file… on command line.
    For reference: man rename It can do mostly everything the Windows bulk renamer can also do, but the problem is: While the windows GUI shows you all your options like a multiple choice test, this linux command line thing expects actually you to know all these complex syntax by heart, even when using it only eventually. This makes it a bit less handy, to express it carefully 🙂 Thanks for coming back on topic.

    #2 Yes, Audacity is present in antiX, I have it installed myself. I didn’t claim differently.

    $ apt-cache policy audacity
    audacity:
      Installiert:           2.4.2~dfsg0-3~mx19+1
      Installationskandidat: 2.4.2~dfsg0-3~mx19+1
      Versionstabelle:
     *** 2.4.2~dfsg0-3~mx19+1 500
            500 https://mirror.eu.oneandone.net/linux/distributions/mx/packages/antix/buster buster/main i386 Packages
            100 /var/lib/dpkg/status
         2.2.2-1+b1 500
            500 http://ftp.de.debian.org/debian buster/main i386 Packages

    What I tried to explain is: Audacity is not able to DIRECT cut an mp3 file, it gets converted two times, first from mp3 to the default working format of audacity (Sample rate 44100Hz and format 32bit float, and yes, you can change this) and a second time again to another mp3 encoding with again different sample rate and format, which causes quality loss always. But, this is OT in this thread anyway.

    Windows is like a submarine. Open a window and serious problems will start.

    #82167
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    My mistake. I must have misinterpreted this:

    but I want to express this way that there is no originary linux version of it.

    #82168
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    Thanks!
    Searching in Synaptic, I found both “rename”, and CLI “renameutils”.

    #82169
    Member
    Robin
    Helpful
    Up
    0
    ::

    It installs properly, but it doesn’t get listed in the Menu, and it doesn’t get a .desktop launcher under /usr/share/applications.

    Just have checked this, the package comes obviously with a wrong file type, since in /usr/share/applications you’ll find an xml type file instead of the expected .desktop type file. This causes the antX desktop-menu script to come up with an error message during post-install, it reads:
    update-menus[17721]: Skript /etc/menu-methods/icewm-common gab den Fehlerstatus 1 zurück.
    You can fix it by manually creating a true .desktop file for this program. A spartan but working example might be:

    [Desktop Entry]
    Version=1.0
    Name=GPrename
    GenericName=GUI Bulk renamer
    Comment=Rename multiple files in a GUI Dialog.
    exec=/usr/bin/gprename
    Icon='/usr/share/icons/papirus-antix/symbolic/actions/edit-find-replace-symbolic.png'
    Type=Application
    Terminal=false
    Categories=Utility;

    Put it in /usr/share/applications and remove the xml file from the folder. You need root privileges here.

    After this you should click on the menu entry “update menu”, but this will fail until the issue is fixed, so enter simply
    sudo desktop-menu --write-out-global
    on command line (yes, due to the issue we need sudo here temporarily)

    After this the entry should appear in your programs→utilities submenu.

    (P.S. My »no originary linux version of it« was referring to the mp3dc tool only)

    Windows is like a submarine. Open a window and serious problems will start.

    #82170
    Member
    olsztyn
    Helpful
    Up
    0
    ::

    sudo apt install fotoxx
    is an image editing program with lots of features including yes batch rename

    Although this my comment is on the side of the main topic:
    Thanks for highlighting the fotoxx app. I have not tested functionality yet but it appears a capable photo editing tool from reading reviews. Having installed, it seems a pretty good fit for antiX:
    – Very reasonable number of dependencies
    – Does not introduce elements adverse to antiX’ strategy, such as *elogind* stuff
    – Memory footprint seems a bit high for my taste but not excessive

    • This reply was modified 2 months, 1 week ago by olsztyn.

    Live antiX Boot Options (Previously posted by Xecure):
    https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

    #82181
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    It installs properly, but it doesn’t get listed in the Menu, and it doesn’t get a .desktop launcher under /usr/share/applications.

    Just have checked this, the package comes obviously with a wrong file type, since in /usr/share/applications you’ll find an xml type file instead of the expected .desktop type file. This causes the antX desktop-menu script to come up with an error message during post-install, it reads:
    update-menus[17721]: Skript /etc/menu-methods/icewm-common gab den Fehlerstatus 1 zurück.
    You can fix it by manually creating a true .desktop file for this program. A spartan but working example might be:

    [Desktop Entry]
    Version=1.0
    Name=GPrename
    GenericName=GUI Bulk renamer
    Comment=Rename multiple files in a GUI Dialog.
    exec=/usr/bin/gprename
    Icon='/usr/share/icons/papirus-antix/symbolic/actions/edit-find-replace-symbolic.png'
    Type=Application
    Terminal=false
    Categories=Utility;

    Put it in /usr/share/applications and remove the xml file from the folder. You need root privileges here.

    After this you should click on the menu entry “update menu”, but this will fail until the issue is fixed, so enter simply
    sudo desktop-menu --write-out-global
    on command line (yes, due to the issue we need sudo here temporarily)

    After this the entry should appear in your programs→utilities submenu.

    (P.S. My »no originary linux version of it« was referring to the mp3dc tool only)

    Ahh… I understand now, re. mp3dc.

    This creation of a .desktop file didn’t work for me.
    I created the file as you instructed, and saved it onto my desktop. I then copied it into the /usr/share/applications directory.
    Clicking on it, I get an error dialog box popping up saying “Command not found.”
    Note, I checked into /usr/bin, and did find gprename there.
    I also find it in the /bin directory.

    Also, for some reason, the zzz-IceWM desktop can’t find the icons for this new file, even after refreshing the desktop.

    I tried both the icon you specified, and also the gprename icon in /usr/share/icons.
    Both simply left an empty space on the desktop, above the .desktop file’s name.

    What DID actually put an icon into that empty space, was dropping the path from the icon name, and simply stating “Icon=gprename”. Then, it placed a generic category icon, instead of the gprename icon. The update to the display was immediate, not requiring refresh of desktop.

    My menu says “Refresh menu” instead of “Update menu” – but, it does the same thing, right?
    (I’m using the zzz-IceWM desktop.)

    I don’t have any “Utilities” submenu, even after the “su desktop-menu –write-out-global” command.
    I also checked Menu/Applications/AniX, and didn’t find gprename listed there.

    • This reply was modified 2 months, 1 week ago by scruffyeagle.
    • This reply was modified 2 months, 1 week ago by scruffyeagle.
    #82185
    Member
    Robin
    Helpful
    Up
    0
    ::

    You’ll have to fix the paths and entries in my above example desktop file according to your actual findings on your system. Sorry for the inconvenience.

    My menu says “Refresh menu” instead of “Update menu” – but, it does the same thing, right?

    I simply don’t know the original English expressions used by antiX, since I can see it only in a foreign language, and in order to refer to it correctly in English language I’d need to look up every single name somewhere in the deepth of antiX system files and folders…
    So what I write down is simply a re-translation back to English, in the hope you’ll be able to recognize what actually it refers to.

    Moreover there is a typo in my manually created desktop file, The entry keys are case-sensitive. So you have to write Exec= starting with bold letter E instead the small e. Then it will be displayed immediately after the desktop-menu command from above. And yes, not all Icons are present on all versions of antiX, so chose what fits best. I’ve entered your proposal here to simply use “gprename” as icon, and it actually works here also. The confusion came from the (in antiX) non existing Nautilus Icon the original xml file pointed to. I wasn’t aware there is a gtk named icon for this program present also, so I used something I found in /usr/share/icons subfolders (which obviously didn’t exist on your system).

    Here the updated desktop file:

    [Desktop Entry]
    Version=1.0
    Name=GPrename
    GenericName=GUI Bulk renamer
    Comment=Rename multiple files in a GUI Dialog.
    Exec=/usr/bin/gprename
    Icon=gprename
    Type=Application
    Terminal=false
    Categories=Utility

    It should work this time.

    P.S.: Please let me know in which submenu of applications it turns up now, so I know the correct English term used by antiX for this menu next time 🙂

    Windows is like a submarine. Open a window and serious problems will start.

    #82189
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    You’ll have to fix the paths and entries in my above example desktop file according to your actual findings on your system. Sorry for the inconvenience. I simply don’t know the original English expressions used by antiX, since I can see it only in a foreign language, and in order to refer to it correctly in English language I’d need to look up every single name somewhere in the deepth of antiX system files and folders…
    So what I write down is simply a re-translation back to English, in the hope you’ll be able to recognize what actually it refers to.

    Moreover there is a typo in my manually created desktop file, The entry keys are case-sensitive. So you have to write Exec= starting with bold letter E instead the small e. Then it will be displayed immediately after the desktop-menu command from above. And yes, not all Icons are present on all versions of antiX, so chose what fits best. I’ve entered your proposal here to simply use “gprename” as icon, and it actually works here also. The confusion came from the (in antiX) non existing Nautilus Icon the original xml file pointed to. I wasn’t aware there is a gtk named icon for this program present also, so I used something I found in /usr/share/icons subfolders (which obviously didn’t exist on your system).

    Here the updated desktop file:

    [Desktop Entry]
    Version=1.0
    Name=GPrename
    GenericName=GUI Bulk renamer
    Comment=Rename multiple files in a GUI Dialog.
    Exec=/usr/bin/gprename
    Icon=gprename
    Type=Application
    Terminal=false
    Categories=Utility

    It should work this time.

    P.S.: Please let me know in which submenu of applications it turns up now, so I know the correct English term used by antiX for this menu next time 🙂

    Success! I now have funtional launchers, both on the desktop, and in the /Menu/Applications/Accessories submenu.

    We’re almost done… BUT, the desktop launcher still isn’t using the custom gprename icon from /usr/share/icons. Trying to use the line “Icon=/usr/share/icons/gprename”, the space above the name on the desktop is blank. Instead, it’s displaying a generic icon which I believe indicates the “Utility” category, when I tell it “Icon=gprename”.

    Correction: I suspected a typo, and changed it – and that fixed it. It was able to find the gprename icon.
    I’d had the line Icon=’/usr/share/gprename.png’,
    but what I needed was Icon=/usr/share/gprename.png.
    The ‘ symbols were interfering with locating the icon.

    In this thread,
    * I’ve found high quality batch file renaming programs for both Windows & AntiX,
    * I’ve learned to create a desktop launcher from scratch, and
    * I’ve learned to create a new menu entry for that launcher.

    I believe this thread can now be marked “Solved”, but the site’s scripts are letting me do that myself.
    (Thanks in advance for taking care of this.)

    • This reply was modified 2 months, 1 week ago by scruffyeagle.
    • This reply was modified 2 months, 1 week ago by scruffyeagle.
    • This reply was modified 2 months, 1 week ago by scruffyeagle.
    #82196
    Member
    scruffyeagle
    Helpful
    Up
    0
    ::

    One last thing I failed to do, in closing up this thread:

    I’d like to extend my thanks, and give proper credit to Robin, who was instrumental in resolving my difficulties making the gprename program fully functional.

    Thanks, Robin!

    #82247
    Member
    Robin
    Helpful
    Up
    0
    ::

    Fine you found a workaround for the quoting issue.

    I wonder how we are expected to put complete valid paths in the .desktop files entries in case these paths contain e.g. blanks…

    Just counterchecked: No way to quote the paths in values of keys is accepted anymore (you still can quote command arguments using some detours). I’m quite sure this quoting of complete paths when needed has worked some time ago properly.
    OK, the regulatory requirements for these simple .desktop files have become quite difficult meanwhile, when looking into the most recent specs:
    https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables

    Even the choice of “correct” name for a .desktop file itself has turned into a dismal science…
    https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#file-naming

    Obviously all the changes are intended to make it work with d-bus on systems which make use of that.

    So in future we’ll see constructions like

    org._7_zip.Archiver.desktop

    (yes, this follows completely their rules) instead of simply

    7zip.desktop

    as sensible people probably would prefer. How are you expected to find a program name starting with “7” among letter “o” when searching a direcory? Did they even think what they are doing, hey? Is the PC meant to serve people or other way around?

    If anybody does know a way how to simply quote valid paths when needed for some reason (e.g. to icons or executables) in a .desktop file, please let me know.

    Windows is like a submarine. Open a window and serious problems will start.

Viewing 15 posts - 31 through 45 (of 47 total)
  • You must be logged in to reply to this topic.