linuxmint / mint-19.1-beta

BETA Bug Squah Rush
3 stars 3 forks source link

nemo: Nemo ignores custom settings in Root mode #43

Closed antrrax closed 5 years ago

antrrax commented 5 years ago

Describe the bug When I open Nemo as Root, in the terminal 'sudo nemo', Nemo opens but in the default language: English (not translated into my system language) And Nemo settings are the default settings, not the settings I've customized.

ex: I change this behavior in Nemo: "Click on a file's name twice to rename it", so it renames files with double mouse click.

But in Root mode, this option is disabled.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'terminal'
  2. type 'sudo nemo'

Expected behavior Opening Nemo in Root mode should maintain the system language. and should keep the settings set in user mode.

Frequency Does the issue happen:

Edition (Desktop environment): In which edition is this happening?

Live or post-install: Indicate if this is happening after the installation, or during the live session:

Screenshots If applicable, add screenshots to help explain your problem.

Locale: pt-BR utf-8

NikoKrause commented 5 years ago

Screenshot?

antrrax commented 5 years ago

Captura-de-tela-de-2018-12-08-22-02-07 in left: Nemo normal mode (pt-BR interface - system language) e custom settings in right: Nemo in Root mode (english interface) e default settings

NikoKrause commented 5 years ago

For the settings I think that's normal. If you change settings as normal user, they won't apply to root, because that's a different user. (You need root access to change settings of the root user.) Or has this been different in previous versions of Mint?

The weird stuff is the nonexisting translation. I can't reproduce it with my locale de.

antrrax commented 5 years ago

I actually changed my language to DE (to test), and Nemo was also translated in Root mode for the DE language. So it's a specific problem for my language Portugues [Brasil]

NikoKrause commented 5 years ago

Do you know, if this worked correctly in Mint 19 with your locale?

Can you also try Portuguese, Portugal UTF-8 (pt).

And if pt works, could you please try French, France UTF-8 (fr) and French, Canada UTF-8 (fr_CA)

My guess is, that it might be the underscore. Portuguese, Brazil is one of the few languages, which has an underscore in it's locale, which might cause the problem.

antrrax commented 5 years ago

I do not remember how behavior was in 19.0

I did the tests in all the languages requested - Nemo was in English

Portuguese, Brazil UTF-8 ===> Nemo in English (root mode) Portuguese, Portugal UTF-8 ===> Nemo in English (root mode) French, France UTF-8 ===> Nemo in English (root mode) French, Canada UTF-8 ===> Nemo in English (root mode)

ghost commented 5 years ago

For the settings I think that's normal. If you change settings as normal user, they won't apply to root, because that's a different user. (You need root access to change settings of the root user.) Or has this been different in previous versions of Mint?

In Mint 19.0 (sic), any customisations that one makes to root Nemo disappear when one re-opens Nemo or indeed when one refreshes a root Nemo window. There is at least one bug report about it - here. It's pretty annoying.

gm10 commented 5 years ago

@CottonEaster as far as I recall that was already broken in 18.3 even. The workaround I use in LM19 is a wrapper I called gksudo for old times' sake:

#!/bin/sh
/usr/bin/pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY HOME=$HOME "$@"

That loads nemo with superuser privileges but with your current user's settings. That's preferable in my opinion, anyway. I even use that on MATE for caja, even though caja does save settings correctly as root.

A related bug that both variants have no matter how you invoke root: After running the file browser as superuser you need to sudo chown $USER:$USER ~/.config/dconf/user because it messes up the permissions. A constant source of bugged joy on the forums... but I digress.

ghost commented 5 years ago

@gm10

Thanks. It really would be good were root nemo to remember things. As to the permissions bug: that needs fixing in the beta, surely. In the meantime: I presume I have to run the chown command only once ever, yes?

gm10 commented 5 years ago

@CottonEaster

As to the permissions bug: that needs fixing in the beta, surely. In the meantime: I presume I have to run the chown command only once ever, yes?

No, that's been broken since forever, too. You need to run it every time you invoke the file browser as root. Easiest if you combine it all into one script and use that instead of the built-in function (you'd need to modify the source and recompile nemo to change the built-in one).

Here's an example script:

#!/bin/bash
if [ $EUID != 0 ]
  then
    /usr/bin/pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY HOME=$HOME USER=$USER CWD=$PWD "$0" "$1"
  exit
fi

nemo "$CWD/$1"
chown $USER:$USER $HOME/.config/dconf/user

Create that in ~/.local/share/nemo/scripts under any name and don't forget to chmod u+x it to make it executable. Now right click > Scripts > (name you gave the script) to invoke a superuser instance of nemo which both uses your user's settings and fixes permissions once you close it.

But while a little do-it-yourself is fun, this should really get fixed.

clefebvre commented 5 years ago

I don't think it's an issue with nemo. It looks like a design limitation in systemd runtime dir handling (which impacts dconf handling in elevated privs).

Anyhow, let's track this at https://github.com/linuxmint/nemo/issues/1676, no need to duplicate it here.

gm10 commented 5 years ago

Well, it is nemo's problem insofar as it shouldn't run with root user settings, anyway, and instead use the regular user's settings, see my workaround above.

ghost commented 5 years ago

Also: whatever the source of the problem, the problem is a moderately major inconvenience for Mint users. For, especially: setting a view mode for a (root) Nemo folder, moving to another folder, moving back, and finding the view mode has been reset - all within, as it can be, seconds of each other - this is not a good user experience, if I may say so. And sometimes one does need to do things as root (and sometimes those things are inconvenient, at least for some users, to do via terminal).