Difference between revisions of "Libetc"

From ArchWiki
Jump to: navigation, search
(seems maintained in the AUR)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Dotfiles]]
 
[[Category:Dotfiles]]
 +
{{Note|libetc is unmaintained upstream. You can use rewritefs instead.}}
 +
 
This is for those who are tired of having a messy $HOME folder cluttered with loads of dotfiles/dotfolders.
 
This is for those who are tired of having a messy $HOME folder cluttered with loads of dotfiles/dotfolders.
  
Line 9: Line 11:
  
 
==Installation==
 
==Installation==
libetc is available in the [[AUR]], so use your favorite method to install it.
+
{{AUR|libetc}} is available in the [[AUR]], so use your favorite method to install it.
  
 
==Configuration==
 
==Configuration==

Latest revision as of 10:49, 29 May 2015

Note: libetc is unmaintained upstream. You can use rewritefs instead.

This is for those who are tired of having a messy $HOME folder cluttered with loads of dotfiles/dotfolders.

libetc is a LD_PRELOAD-able shared library that intercepts file operations: if a program tries to open a dotfile in $HOME, it is redirected to $XDG_CONFIG_HOME, as defined by freedesktop.

When an application tries to acces $HOME/.foobar, the call is redirected to XDG_CONFIG_HOME/foobar

Installation

libetcAUR is available in the AUR, so use your favorite method to install it.

Configuration

I use bash, but this should work for other shells too.

Open ~/.bashrc and add :

export XDG_CONFIG_HOME=/anywhere/you/want 
export LD_PRELOAD=libetc.so.0
export LIBETC_BLACKLIST=/bin/cp:/bin/ln:/bin/ls:/bin/mv:/bin/rm:/usr/bin/find

XDG_CONFIG_HOME defaults to ~/.config if unset. Applications in LIBETC_BLACKLIST will access dotfiles the regular way.

At that point, you might want to have every dotfile/dotfolder that was previously in your $HOME in $XDG_CONFIG_HOME and strip out the dot in their name. If you don't, new files will be created in $XDG_CONFIG_HOME and/or "File not found" errors will appear. Read "Exceptions" below.

Then source your .bashrc :

source ~/.bashrc

Exceptions

Those files need to be in your $HOME, but you can link them into $XDG_CONFIG_HOME if you need to.

  • .bashrc
  • .bash_history
  • .bash_profile

(feel free to add more if you find some)

Homepage

Be sure to read the README there : http://ordiluc.net/fs/libetc