Timeshift: Bad file explorer in Kubuntu 18.04

Created on 19 Jun 2018  路  9Comments  路  Source: teejee2008/timeshift

After selecting a specific backup and after clicking the browse button, the default file browser Dolphin will not open, but open the Gwenview image viewer.

Steps needed to repeat the error:

  • install Kubuntu
  • install Timeshift
  • create backup
  • open backup

I also checked the manjaro and there is the same problem, also the problem concerns more the environment, not the system.

question

Most helpful comment

I had the same problem on Lubuntu: Pressing the browse button opens Audacious.
The reason is that xdg-open is not really meant be used by the root account. Root is no
desktop user.

Timeshift runs under the root account and xdg-open finds no .desktop file for mime type
inode/directory, because the root account has no .desktop files at all.
xdg-open then defaults to /usr/share/applications/defaults.list which
happens to be the unmodified "gnome" list in Lubuntu, containing the following line:
inode/directory=nautilus-folder-handler.desktop

But on Lubuntu the nautilus-folder-handler.desktop item does not exist.
Lubuntu does not use nautilus.
Apparently the system then takes the first application that has inode/directory in
its accepted mime types, in my case Audacious.

The problem could be solved for Lubuntu by changing the offending line in
/usr/share/applications/defaults.list to:
inode/directory=pcmanfm.desktop
but I am not sure if that survives possible updates of the system.

A better solution is to add a new defaults.list file to the root account:
/root/.local/share/appplications/defaults.list
containing only these two lines:

inode/directory=pcmanfm.desktop
x-directory/normal=pcmanfm.desktop

All 9 comments

You need to fix the associations for the inode/directory mime type on your system (check on Google).

Timeshift executes xdg-open to open snapshot folder in file manager. xdg-open uses the default file/folder associations on your system. Your system seems to be configured to open with Gwenview. You need to change that to Dolphin.

I have a problem, here are some logs, I hope it is useful:
Kubuntu 18.04
Timeshift 18.6.1

emanu@emanuc:~$ timeshift-launcher
Configurazione caricata: /etc/timeshift.json
/dev/sda1 is mounted at: /mnt/timeshift/backup, options: rw,relatime,compress=lzo,ssd,space_cache,autodefrag,subvolid=5,subvol=/
Executing Dolphin as root is not possible.
Executing Dolphin as root is not possible.
Warning: program returned non-zero exit code #1
WARNING: You don't seem to have any mimeinfo.cache files.
Try running the update-desktop-database command. If you
don't have this command you should install the
desktop-file-utils package. This package is available from
http://freedesktop.org/wiki/Software/desktop-file-utils/
Can't call method "get_value" on an undefined value at /usr/bin/mimeopen line 159.
[19190:19190:0708/201321.389564:ERROR:zygote_host_impl_linux.cc(88)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: firefox: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: iceweasel: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: seamonkey: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: mozilla: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: epiphany: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: konqueror: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: chromium-browser: not found
[19216:19216:0708/201321.442664:ERROR:zygote_host_impl_linux.cc(88)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening '/mnt/timeshift/backup/timeshift-btrfs/snapshots'
Configurazione salvata: /etc/timeshift.json

According to the error message, your system does not support running file manager (Dolphin) as root. You won't be able to browse the snapshots.

I had the same problem on Lubuntu: Pressing the browse button opens Audacious.
The reason is that xdg-open is not really meant be used by the root account. Root is no
desktop user.

Timeshift runs under the root account and xdg-open finds no .desktop file for mime type
inode/directory, because the root account has no .desktop files at all.
xdg-open then defaults to /usr/share/applications/defaults.list which
happens to be the unmodified "gnome" list in Lubuntu, containing the following line:
inode/directory=nautilus-folder-handler.desktop

But on Lubuntu the nautilus-folder-handler.desktop item does not exist.
Lubuntu does not use nautilus.
Apparently the system then takes the first application that has inode/directory in
its accepted mime types, in my case Audacious.

The problem could be solved for Lubuntu by changing the offending line in
/usr/share/applications/defaults.list to:
inode/directory=pcmanfm.desktop
but I am not sure if that survives possible updates of the system.

A better solution is to add a new defaults.list file to the root account:
/root/.local/share/appplications/defaults.list
containing only these two lines:

inode/directory=pcmanfm.desktop
x-directory/normal=pcmanfm.desktop

@teejee2008 xdg-open man page said that xdg-open shouldn't be run from root too (https://linux.die.net/man/1/xdg-open). Looks like you run xdg-open through the pkexec for files/websites (https://github.com/teejee2008/timeshift/blob/master/src/Utility/TeeJee.System.vala#L356), but not for directories(https://github.com/teejee2008/timeshift/blob/master/src/Utility/TeeJee.System.vala#L370). Why?

@teejee2008 can you check this please?

Files in the snapshot directory are owned by root. Opening it in a file manager running as a normal user is not useful.

I'll change this so that the file manager is opened directly instead of using xdg-open.

For now, just before it is fixed on v19.06 as @teejee2008 said above (June 30, 2019 is the latest planned day for release), you can do the workaround commented by @willem179.

I share with you a little video of my issue on KDE neon 5.15 (it opened VScode instead of the file explorer) and the corresponding steps I made to fix it:

https://streamable.com/wzpa8

is this still due to be fixed for KDE in a few days ? I have not been able to use timeshift for a long time and am looking forward to using it again.
I have tried the workarounds but Manjaro KDE does not allow dolphin to run as root so none of them worked.
Thx.

Was this page helpful?
0 / 5 - 0 ratings