Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | MATE: No desktop icons + context menu on root session #3160

Closed
MichaIng opened this issue Oct 15, 2019 · 13 comments · Fixed by #4390
Closed

DietPi-Software | MATE: No desktop icons + context menu on root session #3160

MichaIng opened this issue Oct 15, 2019 · 13 comments · Fixed by #4390
Labels
Solution available 🥂 Definite solution has been done
Milestone

Comments

@MichaIng
Copy link
Owner

Many thanks for reporting @Gokujo: #3159
Due to: mate-desktop/caja#871

Workaround:

mkdir -p /root/.config/autostart
cat << _EOF_ > /root/.config/autostart/caja.desktop
[Desktop Entry]
Type=Application
Exec=caja --force-desktop
Hidden=false
X-MATE-Autostart-enabled=true
Name=root-desktop
_EOF_
  • Should not be applied by default due to security aspects with caja + root.
  • Handle as known limitation but enhance non-root user desktop session, e.g. (offer to) pre-create default desktop icons (with sudo prefix where required) automatically when user chooses custom auto-login user. Or check for automated solution via skeleton desktop content on first login of any user?
@MichaIng MichaIng modified the milestones: v6.34, v6.35 Nov 28, 2020
@MichaIng MichaIng modified the milestones: v7.0, v7.1 Feb 14, 2021
@MichaIng MichaIng modified the milestones: v7.1, v7.2 Apr 14, 2021
@Joulinar
Copy link
Collaborator

Joulinar commented Apr 28, 2021

@MichaIng
Not sure if there is a relation but we have a report on the forum https://dietpi.com/phpbb/viewtopic.php?t=8949
There is a challenge to launch most System Tools apps from menu.

I did a test and could verify the behaviour. Even creating the desktop shortcuts using the workaround did not change anything. Even these items are not working and don't do anything.

@MichaIng
Copy link
Owner Author

Since all of these are console applications, probably there is no default terminal applied? Does running x-terminal-emulator from terminal emulator work (should start another one)?

@Joulinar
Copy link
Collaborator

Joulinar commented Apr 28, 2021

this doesn't change anything. The 2nd terminal is open but still our shortcut's don't do anything


EDIT
it is working if I adjust the shortcut like this

#Terminal=true
Exec=mate-terminal -x /boot/dietpi/dietpi-config

hash Terminal=true and add mate-terminal to the Exec command

@MichaIng
Copy link
Owner Author

Is x-terminal-emulator actually starting the MATE terminal or a different one? From all I know desktop shortcuts with Terminal=true invoke x-terminal-emulator, so it would be bad if MATE either doesn't do it or if mate-terminal was not compatible with other X terminal emulators so that the default invocation did not work, still making itself an "alternative" for x-terminal-emulator.

I guess apt install xterm would solve it as well (replacing the alternative), but xterm looks quite ugly compared to the native desktop terminal emulators.

But just to rule it out, is the issue the same when logging in as non-root user?

@Joulinar
Copy link
Collaborator

mate-terminal is used to start MATE terminal according the shortcut. I can do some more test later the evening if you like. Especially with non-root user dietpi

@Joulinar
Copy link
Collaborator

thats the Exec command for the terminal inside mate-terminal.desktop

TryExec=mate-terminal
Exec=mate-terminal

as you already indicate, apt install xterm will fix it. However there is a huge difference in look & feel

xterm

image

vs mate-terminal

image

@MichaIng
Copy link
Owner Author

MichaIng commented Apr 28, 2021

Jep that difference is the reason why xterm is not installed anymore by default, as it always is the highest priority x-terminal-emulator.

Little background on x-terminal-emulator:

  • x-terminal-emulator is not an own tool but an "alternative" command, a symlink that points to /etc/alternatives/x-terminal-emulator which points to any compatible X terminal emulator, controlled by the "alternatives" system: update-alternatives --help
  • All terminal emulators add themselves as x-terminal-emulator alternative, with a specific priority and the system creates the symlink for the one with highest priority. Admin can change priorities or manually select a specific one via update-alternatives command.
  • Of course, every alternative MUST be compatible with the basic syntax expected. E.g. xterm uses -e option to call scripts, so I guess that desktop shortcuts as well call x-terminal-emulator -e <Exec command>. If mate-terminal requires a different option/syntax, then it is not compatible, and it would be a bug that it adds itself as x-terminal-emulator, I'd say. It has the -e option, but the -x option as well, which you used successfully, and I didn't understand the difference from the man page so far.

sh, editor, pager and awk work the same way. ToDo: Replace all nano calls with editor, to have the user preferred editor used 😃.

Would be good to know if the issue is the same with a non-root user. Then we could further check why it does not work with mate-terminal, and in case send a bug report to Debian.

@Joulinar
Copy link
Collaborator

for the user on the forum, should I offer apt install xterm as workaround? even if it is not perfect?

@MichaIng
Copy link
Owner Author

Yes, at least it's an easy solution and restores DietPi v6.34 behaviour where xterm was installed together with the X server automatically.

@MichaIng
Copy link
Owner Author

MichaIng commented Apr 28, 2021

Interesting. x-terminal-emulator points to a wrapper perl script /usr/bin/mate-terminal.wrapper which does the -e => -x translation, when arguments are passed. Obviously this is required in case of arguments:

    elsif ($opt eq '-e')
    {
        $arg = shift(@ARGV);
        if (@ARGV)
        {
            push(@args, '-x', $arg, @ARGV);
            last;
        }
        else
        {
            push(@args, '-e', $arg);
        }
        last;
    }

Using the -e option with our script makes the terminal starting and stopping immediately, with -x it works. Strangely here, using mate-terminal -x /boot/dietpi/dietpi-config exits as well immediately.
... ahh, mate-terminal must call the script without any option and -x is dropped by /usr/bin/mate-terminal.wrapper, that's the reason.

Okay the way MATE sets this up currently, is not compatible with native desktop console shortcuts. I'll re-add xterm install for MATE, as an ugly terminal is better than no terminal 😉: 5cb27f0

@Joulinar
Copy link
Collaborator

ok, again we learned something today :)

@MichaIng
Copy link
Owner Author

While there are ways for start Caja as root user and hence show desktop icons and enable menu entries for root sessions, it's not good to hack around this "security feature" of MATE.

#4390 addresses the issue by making it much easier and reliable to autologin as non-root user into a desktop in general. It is now done via LightDM as well, but making use of its autologin capabilities. So no need to apply any custom permissions or mess with legacy X server wrapper, but using the same reliable method that works for the manual desktop login as well.

@MichaIng
Copy link
Owner Author

Marking this as closed in faviour of #3586.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Solution available 🥂 Definite solution has been done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants