organize
organize copied to clipboard
Watch folder?
Hello, is there a way to watch folders for changes and then trigger organize
?
This is not integrated into organize itself, but a solution might be available for your OS:
- linux:
inotifywait
(https://askubuntu.com/a/819290) - macOS:
fswatch
(https://stackoverflow.com/a/25524053/300783) - windows:
Watch 4 Folder
(https://www.raymond.cc/blog/3-portable-tools-monitor-files-folders-changes/)
But this is something that could be interesting for a lot of users. So thank you for the suggestion, I added to the todo list 👍
I'm currently looking for a moving solution on my unraid server and this would be a great thing to have. thinking about making a docker for this so it runs whenever a file changes and/or periodically.
@martinjuhasz I took a first stab at Dockerizing Organize for exactly the same reason. You can find the image here: https://hub.docker.com/r/dskaggs/docker-organize
@dskaggs cool, thanks for the effort. will absolutely give it a try. would love to see the ability to use inotifywait
instead of a regular cron so i get my files instantly moved when ready. i can give it a try, but have not too much time currently. i also don't know how much overhead it is running it f.e. every minute.
@martinjuhasz I'll see what I can do. Feel free to comment here: https://github.com/dskaggs/docker-organize/issues/1
Some code examples for how to get this working under each OS would be really helpful here. I've been tinkering with this on Linux and actually had more luck with inotify-hookable
than inotify-tools
.
inotify-hookable
can be installed via most package managers. I'm on Kubuntu and so just used sudo apt install inotify-hookable
.
Basic docs: https://metacpan.org/pod/App::Inotify::Hookable
# ~/.bash_profile
inotify-hookable -w ~/Downloads -c "organize run" --no-r &
-
-w ~/Downloads
Watches my~/Downloads
directory. -
-c "organize run"
sets up the command to run when a file in my watched directory is modified. -
--no-r
disables recursive watching which is enabled my default. -
&
runs the process in the background (omitting this gave me troubles logging back in, naturally).
Loving organize btw. Just started messing around with it yesterday. As a previous macOS Hazel user this is an itch I've been looking to scratch on Linux for some time :)