You are not logged in.
Page: http://github.com/trapd00r/rmshit
AUR: http://aur.archlinux.org/packages.php?ID=39056
I have been more and more and more and more frustrated of those stupid applications that insist to:
1) Create their config files straight in $HOME/
2) Create their config files even though I've not asked it to, straight in $HOME/
3) Create config files and annoying empty dirs straight in home every single time the application is executed!!
The Firefox and Desktop/ issue is a known one, but there are lots. WHY, oh WHY.
I got so frustrated so I wrote this, using inotify. No more berzerk moments looking at my $HOME
Example log:
[* FILE] 2010-07-19 07:03:37/home/scp1/.esd_auth
[* DIR] 2010-07-19 07:03:37/home/scp1/.dbus
[* DIR] 2010-07-19 07:03:37/home/scp1/.gconf
[* DIR] 2010-07-19 07:03:37/home/scp1/.gconfd
[* DIR] 2010-07-19 07:03:37/home/scp1/.ibam
[* FILE] 2010-07-19 07:03:37/home/scp1/.dmenu_cache
[* DIR] 2010-07-19 07:03:37/home/scp1/.fontconfig
[ DIR] 2010-07-19 07:04:56/home/scp1/.ibam
[ DIR] 2010-07-19 07:05:39/home/scp1/.ibam
Note that you might wanna edit the %shittyfiles hash, adding/removing your own shitty files!
Copy /etc/rmshit.conf to $XDG_CONFIG_HOME/rmshit/ and edit it to your liking.
Last edited by dmz (2010-07-21 07:22:31)
Offline
I've been running Firefox 3.7a4 for a bit and it hasn't created Desktop/ here. 3.6 used to.
Offline
Doesnt really matter if Firefox suddenly behaves since there's tons of applications that dont (just look at the array...)
Offline
Interesting idea, might try this one later.
I think I solved the Desktop/ problem by modifying this file though:
$ cat .config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME"
Offline
I dont have such a file, Cadynum.
Anyway. Made it a daemon so I can start it at boot and it'll just do the work.
Offline
Heh, nice one, DMZ. How about adding .adobe and .macromedia folders, the flash crap.
And for me i'll take a few out of the array, since some folders (like .local, it holds, among others, my parcellite history, clipboard manager) i need.
But nice idea, i like it.
Ogion
(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant
Offline
I must say that I am impressed by the comments.
Seriously...I'm not being sarcastic or ironic.
Offline
Heh, nice one, DMZ. How about adding .adobe and .macromedia folders, the flash crap.
Done. I dont use flash so I didnt know about that.
And for me i'll take a few out of the array, since some folders (like .local, it holds, among others, my parcellite history, clipboard manager) i need.
Sure, people shouldn't use it without editing the @shittyfiles array first (or, if they do, they should not sue me).
@saline: Cool. I didn't know that people actually read comments and/or documentation!
Last edited by dmz (2010-05-29 07:23:49)
Offline
Quite interesting (and sad, really) looking at the log:
Sat May 29 07:53:38 2010: .xsel.log
Sat May 29 09:07:54 2010: .gconfd
Sat May 29 09:12:29 2010: Desktop
Sat May 29 09:13:05 2010: .fehrc
Sat May 29 09:13:20 2010: .gconf
Sat May 29 09:15:24 2010: .xsel.log
Sat May 29 09:58:44 2010: .xsel.log
Sat May 29 09:59:46 2010: Desktop
Offline
Offline
~/.recently-used.xbel should be in the default array. It's certainly shit.
Offline
I symlink some files to /dev/null, and some directories to /tmp/junk (which is created on boot).
Though as i've recently found out, whatever app creates .recently-used.xbel is evil enough to override the symlink. >_<
``Common sense is nothing more than a deposit of prejudices laid down by the mind before you reach eighteen.''
~ Albert Einstein
Offline
cool.
i wrote a script a while back that does something similar (http://github.com/Dieterbe/ddm/blob/master/ddm-clean), but it has to be ran manually.
doing it automatically with inotify is really cool.
now you just need to put a pkgbuild in AUR so that deps get installed, your kernel is checked for inotify support and whatnot
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
I've never written a PKGBUILD (I tried once but failed miserably)
Offline
Oops. We wasnt removing stuff properly; unlink() takes a list of regular
files, it wont work on directories.
rmtree() doesn't work on non empty directories (like Desktop/) so using
remove_tree from File::Path (core module).
Also fixed proper logging.
[FILE] Sun May 30 14:03:53 2010: /home/scp1//.fehrc
[DIR] Sun May 30 14:04:02 2010: /home/scp1//Desktop
[DIR] Sun May 30 14:04:19 2010: /home/scp1//.gconf
[FILE] Sun May 30 14:04:32 2010: /home/scp1//.xsel.log
Last edited by dmz (2010-05-30 12:05:17)
Offline
Don't know if it would be any use to anyone else but you could add functionality to allow moving files as well. For example if people downloaded a jpg, a pdf and a tar.gz to their home directory, or a special directory such as ~/incoming, they could be automatically moved to an appropriate directory such as ~/images/, ~/reference/ or ~/downloads/.
Offline
you can also take a look at bleachbit which nicely cleans up my home
Offline
Don't know if it would be any use to anyone else but you could add functionality to allow moving files as well. For example if people downloaded a jpg, a pdf and a tar.gz to their home directory, or a special directory such as ~/incoming, they could be automatically moved to an appropriate directory such as ~/images/, ~/reference/ or ~/downloads/.
hmm, you could even make it very generic and allow people to execute their scripts which do whatever they want. (ie it might be more complex logic. for example on my system i want to move all files in a certain directory to another system on the network, but only when i'm on the same subnet)
Now that i think about it, I think a generic "inotify to userscripts" wrapper already exists
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
Why does this delete ~/.ncmpcpp by default? Other than that, I like this. Saves time.
Offline
Why does this delete ~/.ncmpcpp by default? Other than that, I like this. Saves time.
You did read the 'edit the @shittyfiles array' first, right?
I thought the .ncmpcpp dir was autocreated too, but cant reproduce it right now.
The .lyrics/ dir, however, is ncmpcpp's fault.
Someone was wondering where the .esd_auth file came from, and what it is.
ESD is the Enlightened Sound Daemon, and it is Firefox (once again) that
creates this file - but only if you happen to rightclick anywhere on a
page. Makes sense, right?
Edit: The ncmpcpp/ dir is autocreated when ncmpcpp starts.
If you havent configured it, it's safe to remove, obviously.
Last edited by dmz (2010-06-01 02:47:40)
Offline
@mikesd: Very interesting idea, that'll probably be a separate project though.
I'm very into Dieter@be's ideas as well.
Offline
soupcan wrote:Why does this delete ~/.ncmpcpp by default? Other than that, I like this. Saves time.
You did read the 'edit the @shittyfiles array' first, right?
I thought the .ncmpcpp dir was autocreated too, but cant reproduce it right now.
The .lyrics/ dir, however, is ncmpcpp's fault.Someone was wondering where the .esd_auth file came from, and what it is.
ESD is the Enlightened Sound Daemon, and it is Firefox (once again) that
creates this file - but only if you happen to rightclick anywhere on a
page. Makes sense, right?
Yes, I looked at all of the stuff in the array first, that's why I asked. To my knowledge, .ncmpcpp/config is the only place that ncmpcpp checks for custom user settings, and I'm fairly sure that it's not autocreated. I would have lost my config if I hadn't checked, so I figured I would bring it to your attention.
EDIT: Just saw the above edit. If it's autocreated, go right ahead and kill it.
Last edited by soupcan (2010-06-01 03:00:10)
Offline
Alright, I've now created a configuration file with, I hope, sane defaults for most users, and a shitload of comments as well!
# vim: set ft=perl:
# Might be sane defaults
our @shittyfiles =
(
'.Xauthority', # Xorg auth stuff
'.esd_auth', # Firefox will create this when you right click somewhere
'.adobe', # Flash crap
'.macromedia', # Flash crap
'Desktop', # The stupid dir that Firefox creates
);
# Below is the authors choice
#our @shittyfiles =
# (
# '.dbus', # I dont use dbus, I suspect Firefox creates this, too
# '.gconf', # Firefox creates this
# '.gconfd', # And this
# '.links', # If you're using links, your settings will be here.
# # I do not, but sometimes I do vim http://url/code.pl -
# # vim uses links
# '.lynx', # I only use lynx for the -dump feature :)
# '.local', # vimprobable (rather, webkit) creates this, can hold other
# # stuff as well
# '.lyrics', # ncmpcpp creates this if you happen to press the 'l' key
# '.gem', # gem (ruby) settings
# '.cpan', # cpan (perl) settings (not really needed)
# '.xsel.log', # Due to my bash-fu, .xsel.log is created every time I cd.
# '.dmenu_cache', # I dont need cache
# '.fmenu_cache', # Same
# '.Xauthority', # Xorg auth stuff, might be needed if you're using remote X
# # logins
# '.esd_auth', # Firefox will create this when your right click somewhere
# '.adobe', # Flash crap
# '.macromedia', # Flash crap
# 'Desktop', # Stupid Firefox
# );
1;
The configuration file should be placed in $HOME/.rmshit...
Nah, of course not - I respect the $XDG_CONFIG_HOME variable, so $XDG_CONFIG_HOME/rmshit/rmshit.conf:
mkdir -p $XDG_CONFIG_HOME/rmshit && cp rmshit.conf $XDG_CONFIG_HOME/rmshit
If not set, $XDG_CONFIG_HOME defaults to $HOME/.config
Anyone that might have a suggestion where to place the rmshit.log?
$HOME/rmshit.log isn't ultimate, considering the purpose of the application.
Offline
Anyone that might have a suggestion where to place the rmshit.log?
$HOME/rmshit.log isn't ultimate, considering the purpose of the application.
Isn't that what $XDG_DATA_HOME is for?
Offline
I would have lost my config if I hadn't checked, so I figured I would bring it to your attention.
Yeah, thanks. However - rmshit doesn't delete anything that's already there when it's started, for security reasons.
I don't know if it's such a good thing to implement... Maybe as a user configurable option.
Offline