docs(shell, scripts): move dotfiles out of $HOME
All checks were successful
deploy / build (push) Successful in 2m37s
All checks were successful
deploy / build (push) Successful in 2m37s
This commit is contained in:
parent
48fb243c69
commit
05808c98af
@ -2114,3 +2114,26 @@ else
|
||||
curl http://v2.wttr.in/Aubervilliers
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
** Wrappers
|
||||
:PROPERTIES:
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :mkdirp yes
|
||||
:END:
|
||||
In order to avoid clutter in my =$HOME= directory, I have some wrappers
|
||||
around some commands that simply add some options by default.
|
||||
|
||||
#+begin_src sh :tangle ~/.local/bin/adb
|
||||
HOME="$XDG_DATA_HOME"/android adb
|
||||
#+end_src
|
||||
|
||||
#+begin_src sh :tangle ~/.local/bin/mbsync
|
||||
mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc
|
||||
#+end_src
|
||||
|
||||
#+begin_src sh :tangle ~/.local/bin/wget
|
||||
wget --hsts-file="$XDG_DATA_HOME"/wget-hsts
|
||||
#+end_src
|
||||
|
||||
#+begin_src sh :tangle ~/.local/bin/yarn
|
||||
yarn --use-yarnrc "$XDG_CONFIG_HOME"/yarn/config
|
||||
#+end_src
|
||||
|
110
docs/shell.org
110
docs/shell.org
@ -163,58 +163,64 @@ and so on. Fortunately, some software allow us to move their data
|
||||
elsewhere, so let’s teach them some manners.
|
||||
|
||||
#+name: cleanup-variables
|
||||
| Variable | Value |
|
||||
|-----------------------------+------------------------------------------------------|
|
||||
| =__GL_SHADER_DISK_CACHE_PATH= | ="$XDG_CACHE_HOME"/nv= |
|
||||
| =_JAVA_OPTIONS= | ="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java"= |
|
||||
| =_Z_DATA= | ="$XDG_DATA_HOME"/z= |
|
||||
| =BUNDLE_USER_CACHE= | ="$XDG_CACHE_HOME"/bundle= |
|
||||
| =BUNDLE_USER_CONFIG= | ="$XDG_CONFIG_HOME"/bundle= |
|
||||
| =BUNDLE_USER_PLUGIN= | ="$XDG_DATA_HOME"/bundle= |
|
||||
| =CARGO_HOME= | ="$XDG_DATA_HOME"/cargo= |
|
||||
| =CUDA_CACHE_PATH= | ="$XDG_CACHE_HOME"/nv= |
|
||||
| =DENO_DIR= | ="$HOME"/.config/deno= |
|
||||
| =DENO_INSTALL_ROOT= | ="$HOME"/.local/bin/deno= |
|
||||
| =DOCKER_CONFIG= | ="$XDG_CONFIG_HOME"/docker= |
|
||||
| =GEM_HOME= | ="$XDG_DATA_HOME"/gem= |
|
||||
| =GEM_SPEC_CACHE= | ="$XDG_CACHE_HOME"/gem= |
|
||||
| =GNUPGHOME= | ="$XDG_DATA_HOME"/gnupg= |
|
||||
| =GOPATH= | ="$XDG_DATA_HOME"/go= |
|
||||
| =GTK2_RC_FILES= | ="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc= |
|
||||
| =HISTFILE= | ="$XDG_STATE_HOME/bash/history"= |
|
||||
| =ICEAUTHORITY= | ="$XDG_CACHE_HOME"/ICEauthority= |
|
||||
| =LESSHISTFILE= | ="$XDG_CACHE_HOME"/less/history= |
|
||||
| =MPLAYER_HOME= | ="$XDG_CONFIG_HOME"/mplayer= |
|
||||
| =NPM_CONFIG_USERCONFIG= | ="$XDG_CONFIG_HOME"/npm/npmrc= |
|
||||
| =NUGET_PACKAGES= | ="$XDG_CACHE_HOME"/NuGetPackages= |
|
||||
| =NVM_DIR= | ="$XDG_DATA_HOME"/nvm= |
|
||||
| =PARALLEL_HOME= | ="$XDG_CONFIG_HOME"/parallel= |
|
||||
| =PASSWORD_STORE_DIR= | ="$XDG_DATA_HOME"/pass= |
|
||||
| =PYENV_ROOT= | ="$XDG_DATA_HOME"/pyenv= |
|
||||
| =PYLINTHOME= | ="$XDG_CACHE_HOME"/pylint= |
|
||||
| =RUSTUP_HOME= | ="$XDG_DATA_HOME"/rustup= |
|
||||
| =TERMINFO= | ="$XDG_DATA_HOME"/terminfo= |
|
||||
| =TERMINFO_DIRS= | ="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo= |
|
||||
| =TEXMFVAR= | ="$XDG_CACHE_HOME"/texlive/texmf-var= |
|
||||
| =WINEPREFIX= | ="$XDG_DATA_HOME"/wine= |
|
||||
| =XAUTHORITY= | ="$XDG_RUNTIME_DIR"/Xauthority= |
|
||||
| =XCOMPOSEFILE= | ="$XDG_CONFIG_HOME"/X11/xcompose= |
|
||||
| Variable | Value |
|
||||
|-----------------------------+--------------------------------------------------------------------------------------------------|
|
||||
| =__GL_SHADER_DISK_CACHE_PATH= | ="$XDG_CACHE_HOME"/nv= |
|
||||
| =_JAVA_OPTIONS= | ="-Djava.util.prefs.userRoot=${XDG_CONFIG_HOME}/java -Djavafx.cachedir=${XDG_CACHE_HOME}/openjfx"= |
|
||||
| =_Z_DATA= | ="$XDG_DATA_HOME"/z= |
|
||||
| =BUNDLE_USER_CACHE= | ="$XDG_CACHE_HOME"/bundle= |
|
||||
| =BUNDLE_USER_CONFIG= | ="$XDG_CONFIG_HOME"/bundle= |
|
||||
| =BUNDLE_USER_PLUGIN= | ="$XDG_DATA_HOME"/bundle= |
|
||||
| =CARGO_HOME= | ="$XDG_DATA_HOME"/cargo= |
|
||||
| =CUDA_CACHE_PATH= | ="$XDG_CACHE_HOME"/nv= |
|
||||
| =DENO_DIR= | ="$HOME"/.config/deno= |
|
||||
| =DENO_INSTALL_ROOT= | ="$HOME"/.local/bin/deno= |
|
||||
| =DOCKER_CONFIG= | ="$XDG_CONFIG_HOME"/docker= |
|
||||
| =GEM_HOME= | ="$XDG_DATA_HOME"/gem= |
|
||||
| =GEM_SPEC_CACHE= | ="$XDG_CACHE_HOME"/gem= |
|
||||
| =GNUPGHOME= | ="$XDG_DATA_HOME"/gnupg= |
|
||||
| =GOPATH= | ="$XDG_DATA_HOME"/go= |
|
||||
| =GTK2_RC_FILES= | ="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc= |
|
||||
| =HISTFILE= | ="$XDG_STATE_HOME/bash/history"= |
|
||||
| =ICEAUTHORITY= | ="$XDG_CACHE_HOME"/ICEauthority= |
|
||||
| =LESSHISTFILE= | ="$XDG_CACHE_HOME"/less/history= |
|
||||
| =MBSYNCRC= | ="$XDG_CONFIG_HOME"/isync/mbsyncrc= |
|
||||
| =MPLAYER_HOME= | ="$XDG_CONFIG_HOME"/mplayer= |
|
||||
| =MYPY_CACHE_DIR= | ="$XDG_CACHE_HOME"/mypy= |
|
||||
| =NPM_CONFIG_USERCONFIG= | ="$XDG_CONFIG_HOME"/npm/npmrc= |
|
||||
| =NUGET_PACKAGES= | ="$XDG_CACHE_HOME"/NuGetPackages= |
|
||||
| =NVM_DIR= | ="$XDG_DATA_HOME"/nvm= |
|
||||
| =PARALLEL_HOME= | ="$XDG_CONFIG_HOME"/parallel= |
|
||||
| =PASSWORD_STORE_DIR= | ="$XDG_DATA_HOME"/pass= |
|
||||
| =PKG_CACHE_PATH= | ="$XDG_CACHE_HOME"/pkg-cache= |
|
||||
| =PSQL_HISTORY= | ="$XDG_DATA_HOME/psql_history"= |
|
||||
| =PYENV_ROOT= | ="$XDG_DATA_HOME"/pyenv= |
|
||||
| =PYLINTHOME= | ="$XDG_CACHE_HOME"/pylint= |
|
||||
| =PYTHONSTARTUP= | ="$HOME"/python/pythonrc= |
|
||||
| =RUSTUP_HOME= | ="$XDG_DATA_HOME"/rustup= |
|
||||
| =SQLITE_HISTORY= | ="$XDG_CACHE_HOME"/sqlite_history= |
|
||||
| =TERMINFO= | ="$XDG_DATA_HOME"/terminfo= |
|
||||
| =TERMINFO_DIRS= | ="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo= |
|
||||
| =TEXMFVAR= | ="$XDG_CACHE_HOME"/texlive/texmf-var= |
|
||||
| =W3M_DIR= | ="$XDG_DATA_HOME"/w3m= |
|
||||
| =WINEPREFIX= | ="$XDG_DATA_HOME"/wine= |
|
||||
| =XAUTHORITY= | ="$XDG_RUNTIME_DIR"/Xauthority= |
|
||||
| =XCOMPOSEFILE= | ="$XDG_CONFIG_HOME"/X11/xcompose= |
|
||||
| =XCURSOR_PATH= | =/usr/share/icons:$XDG_DATA_HOME/icons= |
|
||||
| =GRADLE_USER_HOME= | ="$XDG_DATA_HOME"/gradle= |
|
||||
| =DOTNET_CLI_HOME= | ="$XDG_DATA_HOME"/dotnet= |
|
||||
| =CUDA_CACHE_PATH= | ="$XDG_CACHE_HOME"/nv= |
|
||||
| =ANDROID_USER_HOME= | ="$XDG_DATA_HOME"/android= |
|
||||
|
||||
I also need to export this alias, because =wget= feels like it’s
|
||||
special.
|
||||
#+name: cleanup-aliases
|
||||
| Alias name | Expands to |
|
||||
|------------+------------------------------------------------|
|
||||
| =wget= | =wget --hsts-file=$XDG_DATA_HOME/wget-hsts= |
|
||||
| =yarn= | =yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config= |
|
||||
special, but these are exported in [[file:./scripts.md#wrappers][wrappers]] in my scripts
|
||||
documentation.
|
||||
|
||||
If you’re wondering how I got most of these variables, [[https://github.com/b3nj5m1n/xdg-ninja][xdg-ninja]] can
|
||||
help you with that.
|
||||
|
||||
#+begin_src sh
|
||||
<<export-variables(cleanup-variables)>>
|
||||
|
||||
<<aliases(cleanup-aliases)>>
|
||||
#+end_src
|
||||
|
||||
** PATH variable
|
||||
@ -271,22 +277,6 @@ export SUDO_ASKPASS="$HOME"/.local/bin/askpass
|
||||
export MANPAGER=less
|
||||
#+end_src
|
||||
|
||||
#+name: aliases
|
||||
#+begin_src emacs-lisp :var table=cleanup-aliases :wrap "src sh :exports none"
|
||||
(let ((trim-org <<trim-org>>))
|
||||
(mapconcat (lambda (line)
|
||||
(let ((alias (apply trim-org (list (car line))))
|
||||
(command (apply trim-org (list (cadr line)))))
|
||||
(format "alias %s='%s'" alias command)))
|
||||
table
|
||||
"\n"))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[a7565ff6f7d8df1fe5854ceefb918aadc6a6a431]: aliases
|
||||
#+begin_src sh :exports none
|
||||
alias wget='wget --hsts-file=$XDG_DATA_HOME/wget-hsts'
|
||||
#+end_src
|
||||
|
||||
#+name: path-concat
|
||||
#+begin_src emacs-lisp :var table=path-values :wrap "src sh :exports none"
|
||||
(let ((trim-org <<trim-org>>))
|
||||
|
Loading…
Reference in New Issue
Block a user