Difference between revisions of "Libetc"

From ArchWiki
Jump to: navigation, search
(Created page with 'Category:HOWTOs (English) =Introduction= This is for those who are tired of having a messy $HOME folder cluttered with loads of dotfiles/dotfolders. libetc is a LD_PRELOAD-…')
 
(Linked the libetc package to the AUR page for it.)
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:HOWTOs (English)]]
+
[[Category:Dotfiles]]
=Introduction=
+
 
+
 
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 7: Line 5:
 
that intercepts file operations: if a program tries to open a dotfile in
 
that intercepts file operations: if a program tries to open a dotfile in
 
$HOME, it is redirected to $XDG_CONFIG_HOME, [http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html as defined by freedesktop].
 
$HOME, it is redirected to $XDG_CONFIG_HOME, [http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html as defined by freedesktop].
 
=How it works=
 
  
 
When an application tries to acces $HOME/.foobar, the call is redirected to XDG_CONFIG_HOME/foobar
 
When an application tries to acces $HOME/.foobar, the call is redirected to XDG_CONFIG_HOME/foobar
  
=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==
  
 
''I use bash, but this should work for other shells too.''
 
''I use bash, but this should work for other shells too.''
Line 27: Line 23:
 
XDG_CONFIG_HOME defaults to ~/.config if unset. Applications in LIBETC_BLACKLIST will access dotfiles the regular way.
 
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 [[Libetc#Exceptions]] below.
+
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 :
 
Then source your .bashrc :
Line 33: Line 29:
 
  source ~/.bashrc
 
  source ~/.bashrc
  
=Exceptions=
+
==Exceptions==
 
Those files need to be in your $HOME, but you can link them into $XDG_CONFIG_HOME if you need to.
 
Those files need to be in your $HOME, but you can link them into $XDG_CONFIG_HOME if you need to.
  
Line 42: Line 38:
 
(feel free to add more if you find some)
 
(feel free to add more if you find some)
  
=Homepage=
+
==Homepage==
 
Be sure to read the README there : http://ordiluc.net/fs/libetc
 
Be sure to read the README there : http://ordiluc.net/fs/libetc

Revision as of 17:40, 23 December 2013

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