meowfetch cannot start if no environment variables are defined
9p4 opened this issue · comments
From #4
9p4:
If there is no config found, fallback to a system-wide config in /etc/meow.conf
Itsnexn:
We do not produce configuration at /etc/meow.conf by default; instead, it is generated in $HOME/.meow.conf or $XDG CONFIG HOME/meowfetch/meow.conf. As a result, we don't require a backup for it.
At the parser function, we additionally check to see if a directory exists.
As a result, I don't believe we need a fallback value for this function.
9p4:
There is an application for this. When calling meowfetch as part of a motd script, the script does not have environment variables initialized. Since the os.UserHomeDir and os.LookupEnv both use environment variables to get the location of the configuration, there ought to be a way for the system to fallback to a system-wide config.
https://pkg.go.dev/os#UserHomeDir
Itsnexn:
When calling meowfetch as part of a motd script, the script does not have environment variables initialized.
I don't understand what you mean by motd script.
Since the os.UserHomeDir and os.LookupEnv both use environment variables to get the location of the configuration, there ought to be a way for the system to fallback to a system-wide config.
there is no system-wide configuration. the program will generate config by itself if it does not exist.
please open an issue about this problem and we could continue this conversation there.
I think the best approach would be to copy the config file using the makefile at the install time. we could remove the embed and then change the parser.
I don't understand what you mean by motd script
When logging into an interactive shell (say over SSH), there is a banner displayed
This can be replaced with a script that outputs meowfetch instead.
there is no system-wide configuration. the program will generate config by itself if it does not exist.
The motd program is non-interactive, so it just displays "would you like to create a new config" and then exit instantly.
The most efficient method (in my opinion) is to simply transfer the configuration file to /etc/meowfetch/meow.conf
and change the fallback value to that. I'll also remove the auto-generate feature from the parser. I'll try to implement it by tomorrow.
I'll keep this issue updated.
EDIT: the transfer will be done in the makefile
.
This should fix it :) Please let me know if there was an issue...