Add utility to fix some locations

- some locations are automatically created by some programs and need
  to be "fixed" from time to time
- Example: Gnome Seahorse (i.e., the passwords and keyrings application)
  uses ~/.pki by default but switches to $XDG_DATA_HOME/pki if it exists
  => we move the location to make everything $XDG compliant
This commit is contained in:
Alexander Hess 2023-05-08 11:17:05 +02:00
parent 5d5dd9d0bc
commit a056361112
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
2 changed files with 18 additions and 0 deletions

View file

@ -139,6 +139,23 @@ _restore_gnome() {
_fix_locations() {
# Gnome Seahorse (i.e., "Keyrings") uses ~/.pki by default but also
# detects $XDG_DATA_HOME/pki if it is there and uses it insead;
# setting this explicitly via an environment variable is not possible
if [ -d "$HOME/.pki" ]; then
if [ -d "$XDG_DATA_HOME/pki" ]; then
echo "Warning: both $HOME/.pki and $XDG_DATA_HOME/pki exist!"
else
mv "$HOME/.pki" "$XDG_DATA_HOME/pki"
fi
fi
}
run-private-scripts() { # in the Nextcloud
sudo --validate || return
@ -162,6 +179,7 @@ update-machine() {
_update_zsh
_update_python
_restore_gnome
_fix_locations
run-private-scripts
sudo --reset-timestamp

View file