I literally do this multiple times per day. What in hell do you folk do with your computers?
Thanks for the script ! There's a few tens of thousands of files in my downloads folder, I hope this isn't going to pollute the inotify fds too much...
Hopefully not leaking company information to clever attackers.
I work with a number of clients in high security environments where you have to get permissions to perform operations like execution (or even setting chmod x on a file). It really does limit people running random things and causing destruction.
I have no idea in what situation I'd need to load so many executables via the browser.
Executables tend to come compressed with a lot of other files nowadays, and compression software knows to set the executable bit when extracting them.
inotifywait -m -e create "$(xdg-user-dir DOWNLOAD)"|while read d e f; do chmod +x "$d/$f"; done
You can add "-r" if you want to also do it on subdirectories, and you can specify another directory instead of the default downloads directory.
Though I don't really recommend doing this since you should not be executing downloaded binaries often enough for this to be worth doing.