0

How can I configure what is executed under LXQt for a newly inserted medium? I would like the pcmanfm-qt file manager of LXQt to start in every case.

Because the current behavior is useless and weird. See below for what happens on my Lubuntu 18.10 (LXQt) system right now – I'd like to understand what causes the current weird behavior.

When I currently insert a USB mass storage device or SD card:

  1. For USB mass storage devices but not for SD cards, a popup by the PCManFM-Qt file manager would appear, asking what to do.

  2. For all devices, additionally a small black popover window in the bottom right would appear, showing the filesystem label and a mount icon.

  3. When clicking in the small black popover, really strange stuff happens:

    • the music player Audacious would start, scan the medium and create a playlist; this behavior started after I used the Gnome file manager Nautilus once under the Lubuntu desktop environment

    • after getting rid of Audacious, the disk usage analyzer Baobab would start for every newly inserted medium

    • after getting rid of Baobab, the Gnome file manager Nautilus would start for every newly inserted medium even though this is LXQt and not the standard Ubuntu / Gnome desktop environment

tanius
  • 6,303
  • 1
  • 39
  • 49

1 Answers1

1

The system how LXQt decides what to start when a medium is inserted, and why it can show odd behaviors, is well explained here. In short, LXQt starts will start whatever application is configured to handle the inode/mount-point (pseudo-)mimetype. This is influenced both by installing applications (which associate themselves with a mimetype) and desktop environments (which can change defaults), leading to a mess. In this case, I had installed LXQt on top of a normal Ubuntu installation.

Fortunately, there is a simple way to override the system's default mime-type associations with per-user settings:

Instructions

  1. Open the LXQt Configuration Center (lxqt-config) and click on "File Associations" there. Or directly start lxqt-config-file-associations.

  2. Navigate to "inode → mount-point", click "Change", and choose "PCManFM-Qt File Manager", the default file manager of LXQt.

  3. Let's also disable the additional popup of PCManFM-Qt when inserting a medium. (Reasons: it does not appear for SD cards which seems to be a bug, it is redundant anyway as there's still the bottom right popover, and the PCManFM-Qt popup is not part of the planned "proper solution" in the future.)

    1. In PCManFM-Qt, go to "Edit → Preferences → Volume".

    2. In section "Auto Mount", uncheck all three options.

    3. Confirm with "OK".

Background information

The small popover in the bottom right that appears when inserting a medium is created by the "Removable Media" panel widget of LXQt. When removing that widget, the popover no longer happens. That is why we only have to care about how to configure that piece of LXQt – what your other installed file managers and desktop environments would start when a medium is inserted is not relevant,as they don't get the chance to do so under LXQt.

Since Ubuntu 15.04, the user-specific mimetype settings are stored in ~/.config/mimeapps.list (source). Lubuntu / LXQt stores its own changes made with the lxqt-config-file-associations tool also in that file. So you could apply the instructions from above also by directly editing ~/.config/mimeapps.list and adding one line in section "Default Applications":

[Default Applications]
inode/mount-point=pcmanfm-qt.desktop;

The syntax of the mimeapps.list file is explained in this answer, while this answer shows what mimeapps.list file will be chosen by a specific desktop environment if multiple ones exist on a system.

tanius
  • 6,303
  • 1
  • 39
  • 49