Perun2 is a free and open-source tool for adding new buttons to file explorers.
logo
These buttons can have any name and they run a script when pressed.
So every time a button is pressed, a Python program can be run.
What is more interesting, this software also has its own small programming language.
It follows the plug and play philosophy and is also:
logo
  • Lightweight
  • Statically typed
  • Declarative
Take a look at these small examples:
I want to open the last pdf file from here.
open files
  where extension = 'pdf'
  order by modification desc
  limit 1
Pick images that have the dimensions 1920x1080.
select images
  where (width = 1920 and height = 1080)
     or (width = 1080 and height = 1920)
Remove all empty files and directories.
delete *
  where empty
Remove empty folders from the entire folder tree. By empty I mean that the folder does not contain any file in its whole tree.
delete recursiveDirectories
  where not anyInside(recursiveFiles)
Open all images in GIMP, but only if their names start with the letter a.
open images
  where lower(name) like 'a%'
  with gimp
Take files from today.
select files
  where modification = today
Enter certain folder.
open 'c:/the/path/to/the/place'
Open the last downloaded mp3 in Audacity.
inside downloads {
  open files
    where extension = 'mp3'
    order by modification desc
    limit 1
    with audacity
}
From every folder with the file a.txt, remove the empty files b.txt and c.txt.
inside directories where existsInside('a.txt') {
  delete 'b.txt', 'c.txt'
    where empty
}
Take files that have some extensions.
select files
  where extension in ('pdf', 'doc', 'txt')
Go here to see more of them.