Open matyama opened 2 years ago
helm >= 3
supports XDG out of the box so it should be safe to drop/migrate ~/.helm
(check helm version
first tho)
NSS data in ~/.pki
should be safe to move to XDG directories, see: https://bugzilla.mozilla.org/show_bug.cgi?id=818686 . Also Chrome does seem to use XDG (after quick check of the contents of XDG_CONFIG_HOME
).
Migration commands:
mkdir -p $XDG_CONFIG_HOME/pki/nssdb $XDG_DATA_HOME/pki/nssdb && \
mv $HOME/.pki/nssdb/pkcs11.txt $XDG_CONFIG_HOME/pki/nssdb && \
mv $HOME/.pki/nssdb/*.db $XDG_DATA_HOME/pki/nssdb && \
rm -r $HOME/.pki
NSS data in
~/.pki
should be safe to move to XDG directories, see: https://bugzilla.mozilla.org/show_bug.cgi?id=818686. Also Chrome does seem to use XDG (after quick check of the contents ofXDG_CONFIG_HOME
).
After further testing Chrome does seem to re-create ~/.pki
and indeed they have an open issue for it: https://bugs.chromium.org/p/chromium/issues/detail?id=1038587.
Adding an item for it to the list.
~/.pki
is also created by vscode - mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=818686 and verified
Adding an item for it to the list.
~/.vscode
is problematic too (XDG support is still an open issue). It's contents is
.vscode
├── argv.json
└── extensions
At least partial fix could be
export VSCODE_EXTENSIONS="$XDG_DATA_HOME/vscode/extensions"
or setting a global alias or a script for running code
with --user-data-dir ~/.config/vscode --extensions-dir ~/.config/vscode/extensions
options.
The argv.json
file still remains an issue tho.
base16-shell has
~/.vimrc_background
in $BASE16_SHELL_HOME/profile_helper.sh
~/.base16_theme
which it dynamically symlinks for selected theme/scriptBest approach would be to open a PR. Alternatively, for now and to test, profile_helper.sh
could be modified/replaced in Makefile
(as the last step of base16-shell
target).
Note: Probably best place to use for these would be either XDG_STATE_HOME
or XDG_CONFIG_HOME
.
It's not quite clear which XDG directories one should use (except obvious XDG_CONFIG_HOME
). https://wiki.archlinux.org/title/XDG_Base_Directory mentions that despite the fact $HOME
is still the default dotfile path, if XDG directories shoudl be supported and the docs/PRs/issues mention that XDG_CACHE_HOME
might be used by cython.
So it should be sufficient to just run
mv ~/.ipython $XDG_CONFIG_HOME/ipython
GHC should support XDG since 9.2.1
according to this commit.
This means that older versions probably will keep using/creating ~/.ghc
, unless changes to ghcup
will cover this case as well.
As a potential workaround (perhaps just for older GHC versions), one could set a global ghci
alias that will force storing history file locally:
alias ghci="ghci -flocal-ghci-history"
Although, this might pollute the $PWD
at unexpected locations, such as $HOME
- which would defeat the purpose.
GHC should support XDG since
9.2.1
according to this commit.This means that older versions probably will keep using/creating
~/.ghc
, unless changes toghcup
will cover this case as well. .... Although, this might pollute the$PWD
at unexpected locations, such as$HOME
- which would defeat the purpose.
Even with ghcup
changes (see a7b800aeb9027e310bb79d4c14c4ad6eced27089), ~/.ghc
is still created with older compilers.
yarn
is partially supported and according to the XDG list. The issue is still open as there are two remaining problems with current implementation:
~/.yarnrc
has a workaround in the form of an alias using --use-yarnrc
with XDG_CONFIG_HOME
location~/.yarn/bin
dir created that shoudl instead go either to $XDG_DATA_HOME/yarn/bin
or XDG_BIN_HOME
should be used. There does not seem to be a good solution for that at this moment.Other than that ~/.yarn
should go to XDG_DATA_HOME
and other yarn dirs similarly to XDG_CACHE_HOME
etc.
~/.redhat
dir is most likely due to vscode
's user data collection. Since vscode does not currently support XDG by itself, it's quite unlikely that the telemetry would be configurable.
Therefore, the best option to get rid of ~/.redhat
is to disable the telemetry in vscode and just remove the directory.
Since the shell in use is zsh
, bash
configs are not commited in this repo. So to change the location of the ~/.bash_history
file once can manually run the following:
mkdir -p "$XDG_STATE_HOME"/bash
mv ~/.bash_history $XDG_STATE_HOME/bash/history
and add this line to ~/.bashrc
:
export HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/bash/history"
~/.selected_editor
is generated/used by select-editor
and should not be necessary when EDITOR
and VISUAL
environment variables are set. For reference see: https://askubuntu.com/questions/55022/changing-default-crontab-editor
Tested by removing the file and running crontab -e
and it seems fine - the file was not re-created and it opened in $EDITOR
.
Scala 3 (dotty), does not recognize scala -Dscala.shell.histfile=...
and creates ~/.dotty_history
when running a REPL.
After some googling, I've not found any relevant resources on this issue - i.e. how to change the default location where the REPL history is stored.
nvidia-settings
does not support XDG specs at this moment. Current workaround is to call it with --config
option to set a custom config file path (under XDG_CONFIG_DIR
).
c7edcf0035611caa460026f53c69329b504db299 introduces an alias for nvidia-settings
which works when called manually from a terminal but ~/.nvidia-settings-rc
still gets (re)created when the program is invoked as a Gnome app (i.e. from the menu).
A possible hack to solve the remaining issue could be to modify /usr/share/applications/nvidia-settings.desktop
by adding the same --config
option to the command underExec
. This would also need a sudo update-desktop-database
.
1e95ce3 fixes remaining issue with the Gnome desktop nvidia-settings
application config path. There is a
make nvidia-settings-rc-xdg-path
command to edit the desktop entry accordingly.
4f7f79bbff04ba5f0fdc6760d4ee8017ba35cf71 removes the auxiliary ~/.zshenv
in favor of a (systemd) user-specific config under $XDG_CONFIG_HOME/environment.d/
.
1f2a9a8168e5401f19d59f9f9ec352b0704a9674 is an attempt to get rid of ~/.rpmdb
created on Ubuntu (probably by apt
or snap
or something).
Note that it still might get created, because the overshadowing rpm
alias will only work (be set) in ZSH context.
987255151f3ec0182e9c08ece590213d998f11d1 moves (and solves the issue of) the ~/.binenv
.
b3c819b splits and moves ~/.kube
to $XDG_CONFIG_HOME/kube
and $XDG_CACHE_HOME/kube
8d2bd51 is an attempt to get rid of ~/.debug
Note that the perf config
is currently set just for --system
, so it's a question, whether if invoked under current USER it's gonna work. The issue with using --user
option is that it creates ~/.perfconfig
, which defeats the purpose here.
fe59105 removes thunderbird
which solves the issue with ~/.thunderbird
created/used by keybase
app:
~/.pki/nssdb
~/.cachekeybase.app.serverConfig
bash config scripts such as ~/.bashrc
were addressed in 752686b
Unclutter
$HOME
directory by moving config files toXDG_CONFIG_HOME
,XDG_DATA_HOME
and/orXDG_CACHE_HOME
.See Arch's docs on XDG support.
This is a tracking issue for following apps/tools:
~/.gitconfig
- move to$XDG_CONFIG_HOME/git/config
direnv
: https://github.com/direnv/direnv#the-stdlib~/.binenv
byobu
- see docs onBYOBU_CONFIG_DIR
~/.oh-my-zsh
.p10k.zsh
: usePOWERLEVEL9K_CONFIG_FILE
~/.poetry
~/.npm
ghcup
(ghc
,cabal
) see: https://www.haskell.org/ghcup/guide/#xdg-supportstack
~/.helm
~/.minikube
~/.kube
- ~hard-coded, there's an open issue~ setKUBECONFIG
andKUBECACHEDIR
~/.rustup
- not yet supported out-of-the-box, setRUSTUP_HOME
~/.cargo
- not yet supported out-of-the-box, setCARGO_HOME
~/.sdkman
and possibly managed JVM components: Java, Scala, Kotlin, kscript, maven, gradle~/.java
~/.sbt
and~/.ivy2
- still an open issue but there's a workaround runsbt
with-ivy
and-sbt-dir
pointing toXDG_DATA_HOME
locations~/.kscript
- setKSCRIPT_CACHE_DIR
~/.m2
- use customsettings.xml
and follow current workaround~/.gradle
- setGRADLE_USER_HOME
~/go
- not yet supported out-of-the-box, setGOPATH
~/.gem
(ruby)~/.travis/
~/.aws
- setAWS_SHARED_CREDENTIALS_FILE
andAWS_CONFIG_FILE
less
- should be supported in newer versions or useLESSHISTFILE
andLESSKEY
~/.wgetrc
,~/.wget-hsts
~/.ipython
- supported (i.e. files are picked up) if manually moved to XDG dirs, see 8.x release notes~/.jupyter
- not yet supported out-of-the-box, setJUPYTER_CONFIG_DIR
~/.kaggle
- setKAGGLE_CONFIG_DIR
~/.crawl
~/.terraform.d/
- hard-coded, open issue~/.thunderbird
- hard-coded: https://bugzilla.mozilla.org/show_bug.cgi?id=735285~/.mozilla/
- fixed (not present) with Ubuntu 22.04.1 LTS~/.pki
- still created byvscode
andkeybase
, works for firefox~/.pki
~~/.pki
, possibly~/.dotnet/corefx
- not using VS Code anymore~/.gnome
- generallyxdg-utils
, currently hard-coded inxdg-desktop-menu
, used e.g. by chromium, PR with fix exists, however it is not merged yet~~/.vscode
- not using VS Code anymore~/.lynxrc
, possibly~/.lynx_cookies
- useLYNX_CFG
orLYNX_CFG_PATH
(see https://linux.die.net/man/1/lynx)~~/.gnupg
- useGNUPGHOME
but check the notes (needs additional tweak)~/.vimrc_background
hard-coded in$BASE16_SHELL_HOME/profile_helper.sh
and.base16_theme
symlinked~/.nvidia-settins-rc
- created bynvidia-settings
, not yet supported out-of-the-box, set an alias withnvidia-settings --config ...
~/.nv
(CUDA) - setCUDA_CACHE_PATH
~/.keras
- setKERAS_HOME
, but there is/was an issue withtf.keras
~/sklearn_learn_data
- setSCIKIT_LEARN_DATA
~/tensorflow_datasets
- setTFDS_DATA_DIR
~/snap/
- XDG spec support is "planned work"~/.krew/
- modifyKREW_ROOT
and set it for installation, see docs~/.yarn/
- should be partially supported, workaround for~/.yarnrc
is to define an alias with--use-yarnrc
(if such exists) usingXDG_CONFIG_HOME
~/.sudo_as_admin_successful
- withsudo >= 1.9.6
one can setadmin_flag
in/etc/sudoers
~/.redhat
- contains single fileanonymousId
, most likely created byvscode
's telemetry~/.vimdid
~/.bash_history
- setHISTFILE
in.bashrc
similarly as it's done in.zshrc
~/.python_history
- hard-coded, there are some workarounds but it seems that only from python itself~/.scala_history
- can be changed withscala -Dscala.shell.histfile=...
, note: checkspark-shell
, applies to Scala 2 orSBT_OPTS
could work too~/.dotty_history
- applies to Scala 3~~/.selected_editor
- used byselect-editor
, should not be necessary withEDITOR
set~/.docker
- setDOCKER_CONFIG
~/.debug
- created and used byperf
, ~currently hard-coded~, configured viaperf config --system buildid.dir=...
~/.cachekeybase.app.serverConfig
- created bykeybase
app