Comments (10)
Yes, that is also implemented. I didn't mention it because it was already previously implemented
from joshuto.
Could you clarify more on what needs to be done here?
Are you saying when we install, we should also install config files into ~/.config/joshuto
or /etc/default/joshuto
?
from joshuto.
It's a matter of opinion where the configuration goes. Just so it's easy for the end user to create the default configuration somewhere. The best idea would be to behave like ranger and have a command for joshuto to create the default configuration or atleast copy it from somewhere to a suited directory.
I no longer think that ~/.config/joshuto
or /etc/default/joshuto
should be the install target for the configuration as ~/.config/joshuto
is locked for one user and might be unaccessable to other users wishing to see the configuration and I did not understand fully what /etc/default
was. Best directory to install the configuration would be /etc/joshuto
as it is readable to anyone. An alternative to that would be /usr/share/joshuto
.
from joshuto.
I think this would be better handled by package managers rather than the build tools.
However, we can potentially add functionality to tell joshuto to produce a sane default config.
ie.
~$ joshuto --generate-config <path>
which will generate a default config into given directory or or something like that
from joshuto.
In that case, how would joshuto remember where the configs are? I think an environment variable would work best for this.
Example: (.zshenv
, .env
, etc.)
export JOSHUTO_CONFIG_HOME="$XDG_CONFIG_HOME/joshuto"
Perhaps the --generate-config
option could default to generation using this environment variable if the user doesn't include the <path>
argument.
Of course, if the user doesn't have $JOSHUTO_CONFIG_HOME
set, and doesn't include the <path>
argument, there's a problem. This could be solved a couple of ways.
- Hardcode a default value into joshuto, such as
$XDG_CONFIG_HOME/joshuto
- Output an error message to stdout.
The first option, I believe, is quite a bit more palatable.
from joshuto.
In that case, how would joshuto remember where the configs are? I think an environment variable would work best for this.
Example: (
.zshenv
,.env
, etc.)export JOSHUTO_CONFIG_HOME="$XDG_CONFIG_HOME/joshuto"Perhaps the
--generate-config
option could default to generation using this environment variable if the user doesn't include the<path>
argument.Of course, if the user doesn't have
$JOSHUTO_CONFIG_HOME
set, and doesn't include the<path>
argument, there's a problem. This could be solved a couple of ways.* Hardcode a default value into joshuto, such as `$XDG_CONFIG_HOME/joshuto` * Output an error message to stdout.
The first option, I believe, is quite a bit more palatable.
Joshuto currently already does this. See wiki/configuration
Joshuto is configured from files inside
$XDG_CONFIG_HOME/joshuto
(usually$HOME/.config/joshuto/
on GNU/Linux).
from joshuto.
If $XDG_CONFIG_HOME
is not set, it's default should always be $HOME/.config/
. (I don't know why I didn't mention XDG directories. Must have forgotten. I hate having dotfiles in my home directory and programs which does not follow xdg user directories).
So to summarize so far the configuration should be searched in / created in these directories in ascending order:
--config <path> (with a config path argument that exits the program if path does not exist / not readable)
"$JOSHUTO_CONFIG_HOME/"
"$XDG_CONFIG_HOME/joshuto/"
"$HOME/.config/joshuto/"
The last entry should always exist on all known linux systems (Correct me if I'm wrong) which means that there is always a valid default to use.
from joshuto.
If
$XDG_CONFIG_HOME
is not set, it's default should always be$HOME/.config/
. (I don't know why I didn't mention XDG directories. Must have forgotten. I hate having dotfiles in my home directory and programs which does not follow xdg user directories).
So to summarize so far the configuration should be searched in / created in these directories in ascending order:
--config <path> (with a config path argument that exits the program if path does not exist / not readable)
"$JOSHUTO_CONFIG_HOME/"
"$XDG_CONFIG_HOME/joshuto/"
"$HOME/.config/joshuto/"
The last entry should always exist on all known linux systems (Correct me if I'm wrong) which means that there is always a valid default to use.
Yea, we can do this.
It might require some major refactoring for the --config
option because some of the configs are stored as global variables that are kind of hardcoded at compile time.
It will either require some changes to the loading of the configs, or make the configs not global, which requires a lot of changes elsewhere.
The other options should be fairly straightforward to implement though.
from joshuto.
10f2eed: Added support for
$JOSHUTO_CONFIG_HOME
$HOME/.config/joshuto
If you strongly feel there is a need for --config
or --generate-config
, feel free to re-open this issue
from joshuto.
10f2eed: Added support for
* `$JOSHUTO_CONFIG_HOME` * `$HOME/.config/joshuto`
If you strongly feel there is a need for
--config
or--generate-config
, feel free to re-open this issue
It seams that you forgot to mention entry "$XDG_CONFIG_HOME/joshuto/"
before closing.
You did add support for it with this code snippet?
if let Ok(dirs) = xdg::BaseDirectories::with_prefix(PROGRAM_NAME) {
config_dirs.push(dirs.get_config_home());
}
from joshuto.
Related Issues (20)
- Program hangs when executing `subdir_fzf` on a large directory HOT 1
- Fonts not rendered HOT 2
- how can i use joshuto in wsl HOT 2
- listing large image sqeuence is much slower than nnn HOT 1
- sss
- open file without extension HOT 4
- Support for customizing file icons
- ANSI escape codes not working in preview HOT 4
- [Feature Request] Access permission to view HOT 2
- cargo install error: failed to resolve: maybe a missing crate 'sys' HOT 3
- [Bug Report] could not compile 'trash' (Android Termux) HOT 2
- failed to install the latest version HOT 4
- how to preview image in wsl by joshuto
- error[E0308]: mismatched types HOT 4
- Feature Request: CSI u Support HOT 2
- Unexpected behavior caused when escaping characters output in the preview
- how to cancel a task (in task view) HOT 1
- Include --locked install instructions HOT 1
- command line shell operations
- [Proposal] New release HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from joshuto.