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

Change .insectrc location #307

Closed
triallax opened this issue Jun 3, 2022 · 7 comments · Fixed by #392
Closed

Change .insectrc location #307

triallax opened this issue Jun 3, 2022 · 7 comments · Fixed by #392

Comments

@triallax
Copy link
Contributor

triallax commented Jun 3, 2022

Having .insectrc directly in ~ isn't super great in my opinion. Having it somewhere in $XDG_CONFIG_HOME/insect would be better.

@sharkdp
Copy link
Owner

sharkdp commented Jun 4, 2022

I was recently looking for my insectrc in ~/.config... so yeah. I totally agree. I don't think there is any disadvantage in also allowing ~/.insectrc (if only for backwards compatibility), but I would also suggest we switch the suggested default path to something in $XDG_CONFIG_HOME/insect. Maybe $XDG_CONFIG_HOME/insect/init.ins. Or just $XDG_CONFIG_HOME/insect/init.

@triallax
Copy link
Contributor Author

triallax commented Jun 4, 2022

Which file should take priority if both are present, ~/.insectrc or whatever new location we'll choose? I'm inclined to choose the latter.

@sharkdp
Copy link
Owner

sharkdp commented Jun 4, 2022

Agreed

@triallax triallax added this to the v5.9.0 milestone Dec 28, 2022
@signalno11
Copy link

@mhmdanas I have a proposal. Basically after a lot of drama, developers developing the PolyMC project abandoned it and started Prism instead. Basically, once you open it for the first time, It'll tell you that there's config files, and tell you to move them. (Since it's only one file we can just have it moved by an insect tbh).

TL;DR: I think the default location should be changed, but notify the user if they have a config file in ~/

@triallax
Copy link
Contributor Author

Thank you for your opinion.

TL;DR: I think the default location should be changed, but notify the user if they have a config file in ~/

I'd rather not make this a breaking change that requires user intervention if this is what you mean, because the code needed to support the two locations is negligible. Just an informational message to inform the user might be okay, but I think even that isn't really necessary.

@signalno11
Copy link

User intervention is certainly not necessary. The file should be moved, and the user should be notified as such. That's all.

@triallax
Copy link
Contributor Author

triallax commented May 24, 2023

It absolutely would in some cases. For instance, if you manage your dotfiles in version control like I do, you'd have to move .insectrc to ~/.config/insect/insectrc manually in your dotfiles repo.

triallax added a commit to triallax/insect that referenced this issue Jul 7, 2023
- Allow passing expression as multiple arguments
  This allows e.g. `insect 1 + 1`, whereas previously this would've been
  considered an error.
- Use insectrc in non-interactive mode too.
  Fixes sharkdp#377.
- Add alternative location for insectrc ($XDG_CONFIG_HOME/insect/
  insectrc). Fixes sharkdp#307.
- Exit with non-zero exit code if evaluating argument fails.
triallax added a commit to triallax/insect that referenced this issue Jul 7, 2023
- Allow passing expression as multiple arguments
  This allows e.g. `insect 1 + 1`, whereas previously this would've
  caused an error.
- Use insectrc in non-interactive mode too.
  Fixes sharkdp#377.
- Add alternative location for insectrc ($XDG_CONFIG_HOME/insect/insectrc).
  Fixes sharkdp#307.
- Exit with non-zero exit code if evaluating argument fails.
triallax added a commit to triallax/insect that referenced this issue Jul 21, 2023
- Allow passing expression as multiple arguments
  This allows e.g. `insect 1 + 1`, whereas previously this would've
  caused an error.
- Use insectrc in non-interactive mode too.
  Fixes sharkdp#377.
- Add alternative location for insectrc ($XDG_CONFIG_HOME/insect/insectrc).
  Fixes sharkdp#307.
- Exit with non-zero exit code if evaluating argument fails.
triallax added a commit that referenced this issue Jul 22, 2023
- Allow passing expression as multiple arguments
  This allows e.g. `insect 1 + 1`, whereas previously this would've
  caused an error.
- Use insectrc in non-interactive mode too.
  Fixes #377.
- Add alternative location for insectrc ($XDG_CONFIG_HOME/insect/insectrc).
  Fixes #307.
- Exit with non-zero exit code if evaluating argument fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants