5

Is it possible to have some settings for Midnight Commander when run as user

$ mc

and some different settings (e.g. skin) when run as root?

$ sudo mc

The motivation is that it is immediately recognizable whether I'm using mc as root or as a regular user so that I'm aware of the "power" I have.

I tried to change the skin in Options -> Appereance and then saving the setup by Options -> Save setup both when mc and sudo mc but the settings are always just the last ones saved, no matter how the mc was started (both for "viewing" the settings and saving the settings).

zegkljan
  • 428
  • 7
  • 19

1 Answers1

5

If you invoke sudo with the -H switch, mc should read/write its settings to root's home directory /root/.config/mc instead of writing them to your own home directory ~/.config/mc. From man sudo:

 -H, --set-home
             Request that the security policy set the HOME environment
             variable to the home directory specified by the target user's
             password database entry.
steeldriver
  • 142,475