Cleaning up is hard to do

I’m one of those people you hear about, the ones who don’t like application histories or configuration files that stack up old addresses and locations when closing. I don’t like cached thumbnails. I have about four bookmarks in elinks, about two in Firefox and maybe two e-mails in my address book for alpine. It’s not that I’m paranoid or on the run from the law, I just think histories and most-recently-used file lists are sloppy and leave a lot of garbage around.

I consider it a big plus when an application will clean up after itself, or give me the option to remove any leftover gunk that spilled over into my home directory. Even better is an application which makes no mess to start with, or gives the option to leave no trace, a la Firefox’s “privacy mode.” (Or whatever it’s called. I’ve forgotten now.)

For programs that aren’t as sensitive to my eccentricities, I have to play rough. In those cases I usually employ a two-pronged approach, relying on scripts that start the application then delete it’s residue, alongside an alias that points at the script. Here’s an example.

#!/bin/bash
centerim -T
find $HOME/.centerim/ -iname "*history*" -delete

centerim keeps histories of chat sessions in its configuration directory, which I find a little annoying. I like each session to start clean, without the remainder of the last session appearing in the display. To the best of my knowledge, centerim doesn’t have an option to clear the history on its own, so I remove them myself.

Each account keeps its own history file in a separate folder. But each file is called “history,” so a find command is (probably) the easiest way to sift through the subdirectories, and deftly remove them.

Here’s another one. elinks keeps a goto history and a search history, and stacks up cookies in a single file.

#!/bin/bash
elinks
rm $HOME/.elinks/gotohist
rm $HOME/.elinks/searchhist
cp $HOME/.elinks/cookies.edit $HOME/.elinks/cookies

Here I can use the $HOME variable followed by the file location to peck out those history files. The next line, however, replaces the cookies that were stored in the session with a file I hand-edited to keep only the ones I wanted. That’s a little habit I picked up when I had the same problem with Kazehakase, years ago: keeping a personalized version of certain files.

Here’s another one where that comes in handy.

#!/bin/bash
emelfm2
cp $HOME/.config/emelfm2/cache.edit $HOME/.config/emelfm2/cache
rm -rf $HOME/.thumbnails $HOME/.recently-used.xbel

Because emelfm2 stores some drop-down histories and column settings in its cache file, I replace it every time I close it, using one that restores a set of preferred “defaults” instead.

The last line, however, trims out two files that are sometimes generated outside the configuration directory — the GTK most-recently-used file, which I abhor; and the generic thumbnail folder. That one is actually not the fault of emelfm2, it’s generated by Mirage, which I usually start from within emelfm2. This way, if I want to sift through some wallpaper files in a series of directories, I can keep one session of emelfm2 running, start Mirage repeatedly, and eliminate all the thumbnails in one fell swoop, when I close emelfm2.

Firefox is one of the worst offenders in my book, with any of a number of folders being created when it starts. Like I mentioned, you can more or less get around that with the “privacy browsing” setting, but for those who don’t have that, or aren’t interested, this is what I use to clean up Firefox’s droppings.

#!/bin/bash
$HOME/.firefox/firefox javascript:%20resizeTo\(1280,1024\)
rm -rf $HOME/.adobe $HOME/.macromedia $HOME/.thumbnails $HOME/.recently-used.xbel

I use the precompiled Firefox binary and keep it in a hidden folder in my home directory, which is why the first part of the first line looks funny. The second part resizes the window to 1280×1024, because the -height and -width flags for Firefox, have never, in my experience, worked. But that’s not news.

On the other hand, anything Flash-based that I encounter is going to open files for .adobe and probably .macromedia too. And there’s the most-recently-used file again, cluttering up my personal space. And sometimes the thumbnails too.

But they’re all fairly easy to get rid of. That, coupled with stringent settings from within Firefox itself, and I can be reasonably sure that I won’t be stumbling across garbage leftover from previous sessions.

Which satisfies my desire for a clean, fast system. Call me crazy. šŸ˜ˆ

2 thoughts on “Cleaning up is hard to do

  1. eksith

    Wow. I’m a bit on the opposite end.
    I keep all chat histories. In fact, I have IM logs going back 5+ years.

    Firefox still has a series of settings in about:config
    privacy.clearOnShutdown… something.

    FF3.5 in particular has a “Privacy” tab in the options that allows history deletion.

    Reply

Leave a comment