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?

  • ClotOP
    link
    fedilink
    English
    1
    edit-2
    10 days ago

    Thanks for the heads up! I will try the given solutions.

    but that doesn’t do anything with ~/.config

    What do you exactly mean by this?

    • @JohnnyMac@lemmy.world
      link
      fedilink
      English
      3
      edit-2
      10 days ago

      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.

    • @MadhuGururajan@programming.dev
      link
      fedilink
      English
      210 days ago

      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