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

Deprecate $HOME/.xkb path in favor of XDG_CONFIG_HOME/xkb #572

Closed
bam80 opened this issue Dec 26, 2024 · 5 comments · Fixed by #576
Closed

Deprecate $HOME/.xkb path in favor of XDG_CONFIG_HOME/xkb #572

bam80 opened this issue Dec 26, 2024 · 5 comments · Fixed by #576
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation needs info

Comments

@bam80
Copy link

bam80 commented Dec 26, 2024

So our lookup path sequence becomes - in that order:

  • XDG_CONFIG_HOME/xkb

  • $HOME/.xkb
    ...

I think $HOME/.xkb is not necessary any more,
the random dotstyle-configs/dirs in $HOME are deprecated nowadays, being fully replaced by XDG_CONFIG_HOME path which renders to something like ${XDG_CONFIG_HOME:-$HOME/.config}:

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

https://specifications.freedesktop.org/basedir-spec/latest/#variables

So I would suggest just drop $HOME/.xkb as legacy one to teach people good practice.

Originally posted by @bam80 in #162 (comment)

@wismill
Copy link
Member

wismill commented Dec 26, 2024

While I agree ~/.config/xkb is a better configuration location, I’m not sure “teach people good practice” is a good argument to introduce such a breaking change.

It would break the keyboard configuration of people relying on this and it’s quite difficult to debug if one is not familiar with XKB. Indeed, some people may install their files in ~/.xkb following instructions but without any knowledge of XKB. Even for more experienced people, debugging this may be time-consuming.

Added to that, XDG Base Directory Specification is more a convention than a standard, so it’s difficult to know if all setups using xkbcommon support it.

Supporting ~/.xkb config folder has no maintenance cost for us and its lookup really marginally impacts performance, so “teach people good practice” seems a weak argument and patronizing.

We already promote the XDG specification by looking its directories up first.

CC @whot, since you authored #162.

@wismill wismill added compile-keymap Indicates a need for improvements or additions to keymap compilation needs info labels Dec 26, 2024
@bam80
Copy link
Author

bam80 commented Dec 26, 2024

I believe the change is inevitable. The XDG's Specification is a standard de-facto for quite a long time, and our lib has already adopted it.
Any app which had legacy path for configs at some point in the past doesn't have to keep that forever.

Alternatively, we could declare that legacy path as deprecated for some time in the docs/release notes, and then remove after.

@bam80 bam80 changed the title Drop $HOME/.xkb support Drop $HOME/.xkb support in favor of XDG_CONFIG_HOME path Dec 26, 2024
@bam80 bam80 changed the title Drop $HOME/.xkb support in favor of XDG_CONFIG_HOME path Drop $HOME/.xkb path support in favor of XDG_CONFIG_HOME/xkb Dec 26, 2024
@bam80 bam80 changed the title Drop $HOME/.xkb path support in favor of XDG_CONFIG_HOME/xkb Deprecate $HOME/.xkb path in favor of XDG_CONFIG_HOME/xkb Dec 30, 2024
@whot
Copy link
Contributor

whot commented Jan 5, 2025

Ack for deprecating it in the documentation (potentially mostly hiding it) but removal of the functionality is just going to cause potential breakage for now good technical reason.

$HOME/.xkb was supported before the addition of the xdg directories.

@bam80
Copy link
Author

bam80 commented Jan 5, 2025

I would ask to make runtime DEPRECATED!-marked log output etc. whenever the legacy path is encountered.

@bam80
Copy link
Author

bam80 commented Jan 5, 2025

deprecating it in the documentation (potentially mostly hiding it)

Hiding is not good. We should emphasize the path support could be deleted any time in the future versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compile-keymap Indicates a need for improvements or additions to keymap compilation needs info
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants