6 ms·
Hazel for hackers
- aes256 14y agoThis looks interesting. I've been using Hazel on OS X for a long time. Will have to give it a try...
- terhechte 14y agoWould be great to have a repository with rules for this.
- benjaminoakes 14y agoI've posted some rules that I use as an example: https://github.com/benjaminoakes/maid-example I hope it helps! Ben
- Xyzodiac 14y agoI've been meaning to try maid, I installed the gem but I've yet to do anything more. Thanks for posting this, as now I have some incentive to configure it.
- stratosvoukel 14y agoIt looks great! yay! Now lets make something to take care of our rooms! :P
- benjaminoakes 14y agoArduino to the rescue? :)
- zdw 14y agoA nice feature that could be implemented on OS X would be to auto-organize files by the domain they're downloaded from. Safari on OS X puts the source link of a downloaded file in the spotlight metadata, which can be accessed via "mdls" - an excerpt: $ mdls Inconsolata-Bold.ttf -- other metadata -- kMDItemWhereFroms = ( "http://googlefontdirectory.googlecode.com/hg/ofl/inconsolata/Inconsolata-Bold.ttf, "http://code.google.com/p/googlefontdirectory/source/browse/ofl/inconsolata/Inconsolata-Bold.ttf ) Personally, I'd find that much more useful than the "all pdf's are books" example.
- mbudde 14y agoThere's this example from the README which seems to do what you are asking for: Maid.rules do rule 'Old files downloaded while developing/testing' do dir('~/Downloads/*').each do |path| if downloaded_from(path).any? {|u| u.match 'http://localhost'} && 1.week.since?(last_accessed(path)) trash(path) end end end end
- flogic 14y agoOne of the areas where I disembark from the traditional Unix way is to replace "--dry-run" like flags with "--enable-destruction". That way I have to intentionally do the bad thing.
- snprbob86 14y ago$ git clean fatal: clean.requireForce defaults to true and neither -n nor -f given; refusing to clean
- benjaminoakes 14y agoThat's something I'll definitely consider. maid clean # Give error message maid clean --noop # Show what would happen maid clean --force # or maybe --execute # Do actions I'll be making an issue for this if no one has already.
- benjaminoakes 14y agoThis is now https://github.com/benjaminoakes/maid/issues/78 https://github.com/benjaminoakes/maid/issues/78
- icebraining 14y agoIs there a great advantage over standard shell commands, besides being in Ruby? For example, the following rule: rule 'Trash old temporary files' do dir('~/Outbox/*.tmp.*').each do |p| trash(p) if 1.week.since?(modified_at(p)) end end can be replaced with: #Trash old temporary files find ~/Outbox/ -iname '*.tmp.*' -mtime +7 -exec mv {} ~/.Trash \; The maid script may be more readable if you don't know 'find', but on the other hand, this has only one line.
- benjaminoakes 14y agoI used to use bash scripts and `find` for the purposes that you give. Maid came about when I was starting to add logging and a "dry run" option to those bash scripts. Ruby quickly became an attractive option then. But for many one-off tasks, I still find knowing how to use `bash`, `find`, etc effectively to be important. There are other benefits beyond logging and an easy to invoke "dry run" option. For example, many of the methods in the DSL give back arrays and strings, any of Ruby's many Enumerable methods are available to you. If you have any difficult-to-express logic, that can be quite handy. Also, not every OS keeps its trash at `~/.Trash`, but Maid will do the right thing on OS X or Linux. There are other reasons you might prefer Maid over shell scripts, but in general my hope is that Maid can provide a common framework for these types of scripts and also a community for people interested in automating tasks like this.
- drivebyacct2 14y agoThis is pretty much horrifying (to someone like me who likes to meticulously manage and know where things are instead of treating "Downloads" or "Desktop" like a flat-filesystem. Is it really that hard to just, you know, delete a few files whenever you download something? Download X. Okay. Download Y, go to open Y, delete X while you're there. Somehow I have 6 TB of data and it's all organized. I don't have any files on my Desktop or Downloads folder. Amazingly, I don't have to spend 4 minutes looking for something when I need to pull something up to look at it or send to a friend.
- graue 14y agoGood for you. Sounds like you don't need this program. Since you're aware that there are people who treat "Downloads" and "Desktop" like a flat filesystem, presumably you can understand why this would be useful to them and others.
- drivebyacct2 14y agoI'm guessing the people that would really benefit from it have never heard of GitHub and think that Ruby is a precious gem. I don't mean to knock the work.
- benjaminoakes 14y agoI can certainly see where you're coming from. Many of those people would probably benefit from Hazel more than Maid, however. :) As it stands, Maid is somewhere in between hand-crafted shell scripts and a user-friendly GUI (but definitely closer to the former). That said, Maid has certainly helped me out, and I'm happy that so many others have found it intriguing. (Thanks for the comments!)
- potch 14y agoIf you are guessing that all engineers who understand how to use the command line are well-organized, I can provide you at least one certified example of one who doesn't match your worldview. This is awesome.
- 14y ago
- andrethegiant 14y agoI like it, but prefer something like guard-shell which is event-driven: https://github.com/guard/guard-shell https://github.com/guard/guard-shell
- benjaminoakes 14y agoI'd love that as well. It's certainly something I'd like to implement... but as of yet, I haven't come across many use cases (personally) in which it's necessary. That said, I would definitely accept help in adding event-driven rules!
- mr337 14y agoSomething that I recently started to do that seemed to help me it to point downloads of FF and Chrome to /tmp. So if I downloaded something important I immediately moved it to where it belonged. On reboot all the stuff you didn't care about is gone.