Whenever I run any command line tools without sudo, they take the settings as in ~/.config and work fine. But whenever I run the same CLI tools with same parameters but with sudo, it falls back to default setting. How can I make this behavior consistent?
Thanks for the heads up! I will try the given solutions.
What do you exactly mean by this?
A lot of times
sudo -E
will solve these types of issues because it preserves current environments variables. Honestly it might be all that’s needed to fix your current issue, because XDG_CONFIG_HOME is probably what the app is looking for, which will get passed with -E without all the extra stuff in my first response.The letter ~ (tilde) is relative to the current user. When you use sudo, you become root. So ~ points to
/root
. Whereas if you are not using sudo then ~ points to/home/yourname