You are not logged in.

#1 2010-05-28 12:47:29

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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 smile

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

#2 2010-05-28 13:13:49

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

I've been running Firefox 3.7a4 for a bit and it hasn't created Desktop/ here. 3.6 used to.

Offline

#3 2010-05-28 13:16:02

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

Doesnt really matter if Firefox suddenly behaves since there's tons of applications that dont (just look at the array...)

Offline

#4 2010-05-28 14:53:58

Cadynum
Member
Registered: 2010-04-15
Posts: 20

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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

#5 2010-05-29 05:52:20

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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

#6 2010-05-29 07:07:18

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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

#7 2010-05-29 07:11:21

saline
Member
Registered: 2010-02-20
Posts: 86

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

I must say that I am impressed by the comments.

Seriously...I'm not being sarcastic or ironic.

Offline

#8 2010-05-29 07:23:36

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

Ogion wrote:

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.

Ogion wrote:

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

#9 2010-05-29 08:00:43

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

Quite interesting (and sad, really) looking at the log:

rmshit wrote:

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

#10 2010-05-29 09:30:22

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 785
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

This is cool and a nifty use of inotify. I was quite surprised just how ugly ls -a is these days on my system. Might have to look at this.

Offline

#11 2010-05-29 10:45:50

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

~/.recently-used.xbel should be in the default array. It's certainly shit.

Offline

#12 2010-05-29 17:52:12

TaylanUB
Member
Registered: 2009-09-16
Posts: 150

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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

#13 2010-05-29 19:36:46

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 1,959
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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 wink


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#14 2010-05-29 21:47:25

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

I've never written a PKGBUILD (I tried once but failed miserably) sad

Offline

#15 2010-05-30 12:04:54

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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

#16 2010-05-30 13:30:09

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 785
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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

#17 2010-05-30 13:50:44

arch0r
Member
From: From the Chron-o-John
Registered: 2008-05-13
Posts: 597

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

you can also take a look at bleachbit which nicely cleans up my home

Offline

#18 2010-05-30 14:43:55

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 1,959
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

mikesd wrote:

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

#19 2010-06-01 00:37:31

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 264

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

Why does this delete ~/.ncmpcpp by default? Other than that, I like this. Saves time.


Arch64/XFCE

Offline

#20 2010-06-01 02:43:48

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

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? smile

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

#21 2010-06-01 02:45:42

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

@mikesd: Very interesting idea, that'll probably be a separate project though.
I'm very into Dieter@be's ideas as well.

Offline

#22 2010-06-01 02:48:54

soupcan
Member
From: ?
Registered: 2008-10-25
Posts: 264

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

dmz wrote:
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? smile

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. tongue 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)


Arch64/XFCE

Offline

#23 2010-06-01 03:54:59

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

Alright, I've now created a configuration file with, I hope, sane defaults for most users, and a shitload of comments as well! smile

# 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... lol
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. lol

Offline

#24 2010-06-01 04:02:29

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

dmz wrote:

Anyone that might have a suggestion where to place the rmshit.log?
$HOME/rmshit.log isn't ultimate, considering the purpose of the application. lol

Isn't that what $XDG_DATA_HOME is for?

Offline

#25 2010-06-01 04:03:17

dmz
Member
Registered: 2008-08-27
Posts: 866
Website

Re: rmshit Deletes annoying files(Desktop/, .gconf*) from ~/ upon creation

soupcan wrote:

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

Board footer

Powered by FluxBB