From a7cdd37693a3efd751aa0948368869cc76b5ed5d Mon Sep 17 00:00:00 2001 From: mapperr Date: Mon, 11 Nov 2019 11:07:45 +0100 Subject: [PATCH] Document auto override --- README.md | 18 ++++++++++++++---- dfl | 39 ++++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 20023c3..3e01a98 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ It's a handy directory to gitignore, if your `dotfiles` is a git repo. ### Overrides +Or 'profiles' if it suits you better. + If you need some 'overrides', put them in a new directory, e.g. `dotfiles/fluxbox`, and pass it to the script as an argument, like this: @@ -51,6 +53,14 @@ A use case is when you have another pc/server and you need a slightly different that translates in you need some dotfiles to have different content than the usual. +### Auto override + +You can make dfl choose a profile automatically so that you don't have +to remember to type it if you set the env var `DFL_OVERRIDE`. +If `dfl` does not find that var, it checks if there is a profile dir named +as the output of the hostname command and take that as the profile. + + ### Tracking `dfl` tracks the links it creates, @@ -84,14 +94,14 @@ After that you only need to link them up with `dfl l`. If you have your dotfiles on some git repo you can do a `dfl clone `. It will clone you repo in the `dotfiles` dir, backupping the existing one. -If you cloned your repo, moved from another directory or just `git init` it -you can commit and push your dotfiles directly with `dfl`: +So, if your dotfiles dir is a git repo you can commit and push your dotfiles +directly with `dfl`: `dfl git ` -it `cd` in your `dotfiles` directory and execute the `git` part. +it `cd`s in your `dotfiles` directory and executes the `git` part. -So you can hack your `~/.vimrc` and do: +For example, you can hack your `~/.vimrc` and do: `dfl g commit -am 'Add awesomeness' && dfl g push` diff --git a/dfl b/dfl index f23f24c..f216a1c 100755 --- a/dfl +++ b/dfl @@ -248,27 +248,36 @@ process_profile() { helpmsg() { echo "Usage: `basename $0` [-v] - Commands: - l, link [profile_name] - links dotfiles in default, secrets and, eventually, profile_name directories, in this order +Commands: + l, link [profile_name] + links dotfiles in default, secrets and, eventually, + profile_name directories, in this order - t, take filename|dirname [profile_name] - move the file (or directory) into your dotfiles, in the specified profile directory, or in default if its omitted + t, take filename|dirname [profile_name] + move the file (or directory) into your dotfiles, + in the specified profile directory, or in default if its omitted - g, git [git_arguments] - runs git commands in the dotfiles directory + g, git [git_arguments] + runs git commands in the dotfiles directory - clone - clone a git repo in the dotfile directory, backupping the eventual existing one + clone + clone a git repo in the dotfile directory, + backupping the eventual existing one - d - prints the dotfiles directory absolute path + d + prints the dotfiles directory absolute path - u, up, update - self update from [$script_url] + u, up, update + self update from [$script_url] - Options: - -v - activate verbose mode +Options: + -v - activate verbose mode + +Auto profile: + you can make dfl choose a profile automatically so that you don't have + to remember to type it if you set the env var DFL_OVERRIDE. + If dfl does not find that var, it checks if there is a profile dir named + as the output of the hostname command and take that as the profile. " } -- 2.45.2