Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ~/.personal/ to contain personal override scripts #42

Closed
benknoble opened this issue Jul 16, 2017 · 3 comments
Closed

Allow ~/.personal/ to contain personal override scripts #42

benknoble opened this issue Jul 16, 2017 · 3 comments

Comments

@benknoble
Copy link
Owner

benknoble commented Jul 16, 2017

Any executable file in that directory will be sourced as a way to override defaults or create other personalizations. This prevents dreaded merge conflicts when updating this repo, and allows you to VCS your own personalization scripts, since they live in their own directory.

  1. Files must be executable to allow the inclusion of README's or other files in the directory.
  2. This currently doesn't allow a personal e.g. .inputrc for customizing that (but you can use bind in a script to interact with the readline library!)
  3. Best current usage of this is alias/function defs, setting COW and COLOR variables for MOTD (cf. Motd #22) and other ENV variables
@benknoble benknoble self-assigned this Jul 16, 2017
@benknoble benknoble added the bash label Jul 16, 2017
@benknoble benknoble added this to the Version 1.1 milestone Jul 16, 2017
@benknoble
Copy link
Owner Author

Should be writeable with a simple find one-liner after a check by [[ for the existence of the directory

@benknoble
Copy link
Owner Author

Requires that I move all my variable declarations and shopt/set/bind commands to the top of bashrc.

@benknoble
Copy link
Owner Author

Could do something along these lines (avoids find, requires .sh)

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

benknoble added a commit that referenced this issue Oct 8, 2017
This is necessary so that sourcing files can overwrite them.
Particularly relevant for #42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant