Skip to content

Allow overriding the config file location #370

Closed

Description

@SVendittelli

Problem

I want to be able to specify the location of my config file, rather than being forced to use the platform default.

Proposed solution

When looking up the config file, first check the path specified by an environment variable such as $SLUMBER_CONFIG_PATH. If that path does not exist, then fallback to the default location. This is a common pattern for CLI apps, and I think it would be a good fit for slumber.

Current workaround

Using symlinks to store the canonical version of the config file where I would like, but providing a linked version where slumber looks for it. This approach does work, but it means swapping between config files or having one location across platforms is harder to configure.

Additional context

Other apps that use environment variables to specify non-default config locations:

  1. bat
  2. ripgrep

Activity

  1. SVendittelli commented on Sep 8, 2024

    @SVendittelli
    ContributorAuthor

    @LucasPickering if you agree to this suggested feature, I would be willing to try and implement it myself. I haven't written rust before, so it might not happen quickly

  2. LucasPickering commented on Sep 8, 2024

    @LucasPickering
    Owner

    @SVendittelli I'm curious, could you elaborate on the use case for this? The intention of the config file is to be modified infrequently, and to be common across all sessions of Slumber. I can see the use case of putting it in a dot files repo, but I'm confused by the part about "swapping between config files". Is this something you would want to do?

  3. SVendittelli commented on Sep 8, 2024

    @SVendittelli
    ContributorAuthor

    Sure, no worries. The primary use case I had in mind was a dotfiles repo and that was my motivation for requesting the feature.

    The other use case I had in mind was using something like direnv to set different slumber config files per project. Although I don't currently need to, I can imagine wanting separate ignore_certificate_hosts for personal and work projects.

    I completely acknowledge that one could just list all the hosts to ignore in the default config file and have no issues, so this is admittedly a niche use case. What I really want is the dotfiles repo support.

  4. added a commit that references this issue on Sep 9, 2024
    7ebc263
  5. added
    qolImprovements that make usage smoother, without introducing new functionality
    on Sep 9, 2024
  6. added 2 commits that reference this issue on Sep 9, 2024
    dbed26a
    6101f3d
  7. added a commit that references this issue on Sep 13, 2024
    a116ce5
  8. added a commit that references this issue on Oct 13, 2024
  9. added a commit that references this issue on May 11, 2026
  10. added a commit that references this issue on May 13, 2026
  11. added a commit that references this issue on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    qolImprovements that make usage smoother, without introducing new functionality

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions