Categories: desktopXFCE

GSoC’22: Making Thunar Bulk Renamer More Advanced.


The Task

Most of you would be aware of bulk renamer, a handy plugin in Thunar to rename many files together. The plugin is already very advanced and can perform many complex tasks. But sometimes, performing those tasks required more user interference than expected. Consider a case where you are renaming two files, and the new name for one file matches the old name of the second file. Now, no issue arises if the second file is renamed first, and the bulk renamer works perfectly. But if the first file is renamed, it throws an error message as the filename already exists. In the case of two files, the user can resolve such errors manually, but it can become a very tedious task for a large number of files. So the job was to make the bulk renamer intelligent enough to identify the best order in which the files should be renamed so that all such errors are resolved entirely. A trivial usage case for it

Sponsored

is to be able to rename files named file4, file5 … file13 to file1, file2 … file10.

The Solution

Sorting is a critical player in the entire solution. The bulk renamer now tries three runs to rename a file. In the first run, the files are renamed in the user-specified order. If some files are not renamed successfully in this run, then the bulk renamer moves for the second run. Before starting the second run, all the failed files are first sorted in ascending order according to their current name. And then it tries to rename them again. But if still some files fail, it moves to the third run. Here the files are first sorted in reverse order and then renamed. The user is shown an error message if a file is still falling.

Sponsored

Under The Hood

With the support of Thunar’s lead developers Alexander Schwinn (alexxcons), Sergios – Anestis Kefalidis and Yongha Hwang (MShrimp4), the solution is implemented successfully. Implementing the three runs and sorting was not much of a big deal. But the real deal was to manage all the other systems that broke down due to the changes. One of the noteworthy was the undo option. But after rigorous manual testing, the entire system is working correctly and ready to be used by general users. I hope this advancement will highly benefit the users.

With this done, it’s time for me to move on to my task for Xfce-Screenshooter.

Ubuntu Server Admin

Recent Posts

How to Fix VMware’s “Could not open /dev/vmmon” Error on Ubuntu

You’ve recently installed VMware Workstation on your Ubuntu system and encountered the frustrating “Could not…

5 hours ago

How to Fix Ubuntu 404 Errors While Fetching Dependencies

Have you ever found yourself staring at a terminal full of 404 errors while trying…

5 hours ago

How to Fix ‘Please Install All Available Updates’ Error When Upgrading Ubuntu 18.04 to 20.04 LTS

One particularly frustrating error that many users face when trying to upgrade from Ubuntu 18.04 …

5 hours ago

How to fix “Release is not valid yet” Error in Docker Containers

In the world of containerization, time synchronization issues can create unexpected roadblocks when working with…

5 hours ago

How to fix “Externally Managed Environment” Pip Errors on Ubuntu

If you’ve recently upgraded to Ubuntu 23.04 or newer, you might have encountered a frustrating…

5 hours ago

Ubuntu now officially supports NVIDIA Jetson: powering the future of AI at the edge

Canonical announces the General Availability of Ubuntu for the NVIDIA® Jetson Orin™ for edge AI…

12 hours ago