4 ms·
Here's a gift for you: 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
by devit 5y ago
Here's a gift for you:
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.
- jcelerier 5y ago> Though I don't really recommend doing this since you should not be executing downloaded binaries often enough for this to be worth doing. 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...
- marcosdumay 5y agoI can't remember the last time I had to do it. Not on the last 4 years for sure. Executables tend to come compressed with a lot of other files nowadays, and compression software knows to set the executable bit when extracting them.
- assbuttbuttass 5y agoI usually install programs through the distro package manager. Out of curiosity, what are you doing that requires downloading so many executables from the web?
- pixl97 5y ago>requires downloading so many executables from the web? 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.
- alpaca128 5y agoWhen you seriously download and run multiple executables a day I wouldn't call that a common use-case. At least 99.9% of my downloaded files are not executables. Those are usually pulled via the package manager or git, so basically I only download an AppImage if both the repos and flatpak can't install it. I have no idea in what situation I'd need to load so many executables via the browser.
- jcelerier 5y agoI mostly use appimages