dotfm


A simple and easy to use dotfile symlink manager.

dotfm is a simple and easy to use dotfile manager.

It's basically just a Python script to short-hand managment of symlinking dotfiles. It's goal is to allow you to keep all your dotfiles in a single directory (ideally without any nesting inside that dir) and allowing you to name the dotfiles whatever you want (not forcing you to use hidden file naming).

If you don't want to remember or type out the location of a dotfile everytime you want to modify it, if you just want to keep your dotfiles tidy in a repo/directory (see fig.1), maybe you swap dotfiles around a lot:

dotfiles/
├───src/
│   ├───bashrc
│   ├───nvimrc
│   ├───tmux.conf
│   ├───ssh_config
│   └───user-dirs.dirs
└───README

Opposed to the traditional approach, where you re-create the home directory structure and just clone it to your home folder (which I find to be messy):

dotfiles/
├───.bashrc
├───.tmux.conf
├───.ssh/
│   └───config
└───.config/
    ├───nvim/
    │   └─── nvimrc
    └───user-dirs.dirs

See the README for more details on using the tool.

Usage examples:
  • dotfm install ~/dev/gearsix/dotfiles/bashrc = creates a symlink at ~/.bashrc -> ~/dev/gearsix/dotfiles/bashrc
  • dotfm edit bashrc = edit the dotfile at ~/dev/gearsix/dotfiles/bashrc
  • dotfm update bashrc ~/dev/gearsix/new-dotfiles/bashrc = update the ~/.bashrc dotfile to point to ~/dev/gearsix/new-dotfiles/bashrc
  • dotfm remove bashrc = remove the symlink pointing to the source dotfile (~/.bashrc), note that this makes a interactive rm call.

2020 December

Just finished gearsix.net and created this project's own homepage!

CHANGELOG (upto 2020 December):

v2.0.5

  • added banner.svg

v2.0.4

  • updated the README & man file
  • formatting fixed in the README

v2.0.3

  • compressed logo.png

v2.0.2

  • updated LICENSE to ISC
  • added awesome logo from Marta Dias
  • minor fix in Makefile

v2.0.1

  • updated the "list" command to use unix system commands: printf, cat, column. Provides a neater, more reliable printout and makes the implementation tidier.
  • DOTFM_CSV_FILE lines are now terminated with '\n' (previously '\r\n')
  • Install & Uninstall (with Makefile) will now prompt for overwriting & removing files

v2.0.0

  • The quiet arg works properly now
  • Added code comment header documenting the dotfm_* functions
  • Now the DOTFILE arg can specify multiple dotfiles
  • updated the README
  • added a manpage (src/dotfm.1), which is installed with dotfm in the Makefile

DOTFM CSV FILE

dotfm now tracks dotfiles that it installs symlinks for in a file. This file is currently stored at ~/.local/dotfm/installed.csv. The file has the following structure:

<location>,<alias>,<alias>,....

location is the location dotfm installed the dotfile to (the symlink pointing to the source dotfile).

alias these are strings that dotfm uses to recognise the related dotfile (e.g. you could use "brc" as an alias for your bashrc and call "dotfm edit brc")

KNOWN DOTFILES

DOTFILE LOCATIONS has been refactored into KNOWN DOTFILES, it follows the same structure as the DOTFM CSV FILE (see above).

The purpose of this array is now to act as a knowledge base for all the location to install dotfiles to and any names that they sohuld be recognised under that dotfm recognises.

If a dotfile is within this array, dotfm will know where to install the relevant dotfile automatically and allow you to call it with the preset aliases. Don't be scared to modify this array to modify this to your hearts content.

If a dotfile is not present within this array then you'll be prompted for the install location of the dotfile and any aliases you want to allow dotfm to recognise it under. This won't be added to KNOWN DOTFILES, but will be appended to DOTFM CSV FILE.

dotfm init

This is a function that runs at the start of every runtime, it checks if the DOTFM CSV FILE is present: If it is, it's contents are loaded into memory; If it isn't, then the user is prompted where they would like to create it and the file is created with itself as the first entry.

dotfm install

Now if a dotfile is not recognsied in the KNOWN_DOTFILES array, the user will be prompted asking where to install it to and what aliases to recognise it under.

Multiple dotfiles can be passed to dotfm install, e.g.

dotfm install ./bashrc ./profile ./tmux.conf

dotfm remvoe

dotfm_remove will now also remove the file from the DOTFM CSV FILE

dotfm list

Minor changes to dotfm_list printout format. Will also print even if running in quiet mode.

dotfm_list now lists all installed dotfiles by default, and only lists specifc dotfiles if specified.


v1.0.3

  • added "-q", "--quiet" argument, using it reduces printed logs "dotfm list" will still print the file location (one line each), e.g.:

    /home/gearsix/.bashrc /home/gearsix/.profile /home/gearsix/.bash_profile ...

  • added CHANGELOG

  • updated LICENSE to BSD 4-Clause

  • added sfeed to DOTFILE_LOCATIONS

  • added TODO items