modetc
Move your dotfiles from kernel space
modetc is a Linux kernel module that rewrites paths in file operations: it allows you to move files wherever you like, while still having programs finding them where they expected them to be.
The main application is to move the dotfiles of those stubborn programs that refuse to adopt the XDG basedir standard, away from the home directory. For example, you can rewrite the path ~/.ssh to ~/var/lib/ssh . Yes, this is the nuclear option.
Configuration
modetc is configured via module parameters that are set either when manually loading the module (eg. modprobe modetc homedir=... ) or by adding a line to /etc/modprobe.conf . The parameters are:
Name Default value Description homedir N/A Home directory where to rewrite paths default_rule N/A The default replacement for all dotfiles rules_file /etc/modetc.conf File containing the rewriting rules debug 0 Turn on debugging for rewriting rules
Rewriting rules
modetc rules are pure text search and replace: single substitution per file path, no wildcards nor regular expresssions.
The rules are only applied to absolute path with the homedir prefix followed by . , or to any relative path with a leading . when the working directory is homedir . Rules are tested in the order in which they appear in the rules file and the first to match will be applied. If no specific rule matches, the leading . of the file path will be replaced with the value of default_rule .
... continue reading