Skip to content

Instantly share code, notes, and snippets.

@jkramer
Created October 20, 2009 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkramer/214195 to your computer and use it in GitHub Desktop.
Save jkramer/214195 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# Firefox keeps creating the ~/Desktop directory for some reason whenever the preferences are opened. This little script keeps your $HOME clean until those Mozilla monkeys finally fix that sh*t.
use strict;
use warnings;
use Linux::Inotify2;
my $inotify = new Linux::Inotify2 or die "Narf!\n";
$inotify->watch($ENV{HOME}, IN_CREATE);
while() {
for my $event ($inotify->read) {
my $fullname = $event->fullname;
if($fullname eq $ENV{HOME} . '/Desktop' && -d $fullname) {
rmdir($fullname);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment