8

I am in-fucking-love with myself and packages contributed to OSS communities!

TL;DR: inotify is great and I am lazy bitch so I wrote a script to kinda do my work

I took some time to write a script that takes a folder with images (Screenshots) and move them somewhere else with the last modify time as their new name (something like "Screenshot_DATE_TIME.png) because my current screenshot software for Windows (Lightshot) only saves their screenshots like this: Screenshot_<Incrementing Number>.
Once in a while I'd like to move those images away to "clean up" that folder, but I always have to create a new folder like "OLD" but that already exists so it becomes "OLD_1" which.. also existed up to "OLD_3" and I finally grew sick of it!

2ish hours later my Perl script now automatically gets triggered by inotify once a new file (Screenshot for that matter) is written or moved to the Screenshot folder and auto-fucking-matically moves it to the "new" folder with the new filename so I don't have the issue of having "OLD_1" .. "OLD_INFINITY" anymore.

Little things / scripts like these really make me feel good about what myself and my coding skills (I know, this is a somewhat trivial task but still a great experience)

Comments
  • 0
    ++ for using perl 😄
  • 0
    Or you could use Greenshot or ShareX, which will automatically save in whatever folder/name structure you want without having to do all of this...
Add Comment