Skip to content
tsujan edited this page Jul 31, 2021 · 47 revisions

PCManFM-Qt

General

This document is about advanced and, in some cases, hidden properties or functionalities of PCManFM-Qt.

Tab DND

Tabs can be reordered by the mouse. In Addition, under X11 and if the main view is not split, they can be detached or moved from one window to another.

When there are more than one tab, to detach a tab, drag and drop it outside all windows of PCManFM-Qt. Then, a new window will be created for the dropped tab.

To move a tab to another window, drag and drop it into that window. If the source window has only one tab, it will disappear after the tab is moved.

NOTE: Tab DND is disabled outside X11 because Wayland has a serious problem related to DND.

Permanently Deleting Files

If GVFS Trash support is installed, to delete a file permanently — in contrast to moving it into Trash — use Shift + Delete.

If you do not want Trash at all, you could uncheck Preferences → Behavior → File operations → Move deleted files to "trash bin" instead of erasing from disk.

Forward/Backward History

Each tab of PCManFM-Qt has a forward/backward history. To access and use it, right click the "Go Back" and "Go Forward" buttons on the tool bar. You can move through the history by clicking the items of the right click menu.

Filter Bar

If View → Toolbars → Permanent filter bar is checked, you should type inside the filter bar to filter files/folders. That may not be comfortable because you need to focus the filter bar for filtering and refocus the main view after filtering, e.g., by clicking inside them or using shortcuts.

To filter files/folders more easily, you can uncheck the above-mentioned item and type inside the main view. Once you type the first letter, the filter bar appears and filtering starts, while the main view keeps the focus.

To remove filtering, just press Escape or click the Clear icon of the filter bar (Ctrl + K can also be used). If you had selected some files before removing the filter, your selection will be preserved.

Let us call this a "transient filter bar". For the sake of consistency, if the filter bar is transient and if there is no selection, the first Space that is typed inside the view will only select the current item, without starting filtering. The current item may be marked by widget styles in different ways, e.g. it may have a dotted rectangle around its name or a faded line below it. There can only be one current item inside a focused widget. In Qt, the current item is selected by Space and deselected by Ctrl + Space everywhere; hence making an exception for the first Space.

For pasting text into the transient filter bar, press Shift + Insert inside the view. Of course, you could also show and focus the filter bar with Ctrl + I but Shift + Insert guarantees that the focus remains on the view.

Bulk Renaming

Bulk Renaming is a method of renaming multiple files without getting a prompt dialog for each one.

To rename files in bulk, select them and press Ctrl + F2 or click Edit → Bulk Rename. A dialog will show up, in which you could choose a name that is suffixed by #. # will be replaced by consecutive numbers, starting from 0 or any number you might choose in the spin-box of the Bulk Rename dialog. You could also put # at the start of the name or inside it.

If you confirm the dialog by pressing OK or Enter, the selected files will be renamed according to your chosen pattern, while their extensions, if any, will be preserved.

Changing Folder Icons

The icon of a folder can be changed in the File Properties dialog. Show File Properties by right clicking the folder and clicking Properties or by selecting it and pressing Alt + Enter/Return. There is a button on the top left of the General page. If you click it, a file dialog will be opened inside your active icon theme, where you could choose a customized icon for that folder.

To remove the customized icon of a folder, open it, show the hidden files inside it and delete the hidden file named .directory.

Icons of files cannot be changed because they show their mime types; they depend on the active icon theme.

Emblems

The first tab of File Properties dialog has a button for adding an emblem to a file — or a selection of files — and another button for clearing it. Emblems are small icons that appear at the bottom right corner of the main icon and should be chosen from the active icon theme. They require GVFS.

Emblems are user-specific. They are not really added to files but are attributed to them by the current user. So, they are not preserved when files are copied or transferred.

GVFS allows multiple emblems for each file but the File Properties dialog only sets one because the other corners of a file's icon are preserved for other purposes (like the symlink emblem).

Emblems can be used to distinguish certain files visually, especially non-folder files, whose icons cannot be changed.

Hiding Files/Folders without Renaming Them

A really hidden file has a name that starts with a dot. But, sometimes, you may not want to rename a file to make it hidden, e.g., when that file is used by an app. Also, folders like lost+found belong to root and should not be renamed.

Some file managers have a way of making files "virtually hidden". Technically, those files are not hidden but only treated as hidden by the file managers in question.

PCManFM-Qt has the above-mentioned functionality. To hide files without renaming them, create the file .hidden inside their parent directory and add to it the names of the files you want to hide in separate lines.

For example, you may create ~/.hidden as:

Public
Templates
Certain File

Then, the folders Public and Templates as well as the file Certain File inside your home directory are treated as hidden by PCManFM-Qt and some other file managers.

NOTE: Editing .hidden does not have an immediate effect because GLib (which does the file management in PCManFM-Qt) uses cache. It will take effect the next time its containing folder is opened. You could also wait a few seconds and reload the folder.

Thumbnails

PCManFM-Qt (actually, libfm-qt) creates thumbnails of images internally but it can also use external thumbnailers for other kinds of files.

User-defined thumbnailers can be created inside the directory ~/.local/share/thumbnailers. For each new thumbnailer to be seen, PCManFM-Qt needs to be restarted from LXQt Session SettingsDesktop.

The following examples show how to add user-defined thumbnailers for DjVu and PDF files. You can use them as a guide for creating other kinds of thumbnailers.

To have thumbnails for DjVu files, create a file like ~/.local/share/thumbnailers/djvu-djvu.thumbnailer as,

[Thumbnailer Entry]
Exec=ddjvu -format=tiff -page=1 -size=%sx%s %i %o
MimeType=image/vnd.djvu+multipage;image/vnd.djvu;

Then restart PCManFM-Qt. Of course, you need ddjvu, which belongs to djvulibre.

For PDF files, you can install graphicsmagick and create ~/.local/share/thumbnailers/graphicsmagick-pdf.thumbnailer as,

[Thumbnailer Entry]
Exec=gm convert -quality 100 -thumbnail %s -flatten %i\[0\] %o
MimeType=application/pdf;application/x-pdf;image/pdf;application/x-gzpostscript;application/postscript;application/vnd.ms-xpsdocument;

Again, restart PCManFM-Qt.

The file can have any name but its extension should be .thumbnailer. It should start with [Thumbnailer Entry] and have two keys, namely, Exec and MimeType.

The value of the MimeType key tells which file types should have thumbnails.

The value of the Exec key tells how thumbnails are created. It is a command-line that depends on the thumbnailing application but it always includes three elements: %s for the image size, %i for the "input" (the file whose thumbnail should be created), and %o for the "output" (the thumbnail itself). You need to be familiar with the thumbnailing application to know how it can create an image with a specific size out of a file. Then replace input, output and image size with %i, %o and %s in its command-line respectively and put it in front of Exec=.

"Admin" Mode vs. Root Instance

PCManFM-Qt can be launched as root under X11. The menu-item that does that is Tools → Open Tab in Root Instance. The command in Preferences → Advanced → Switch use command should be something like this:

lxsudo dbus-run-session -- %s

But a root instance may not be safe for various reasons. Moreover, no root instance is possible under Wayland. If you only want to transfer files that are owned by root, you could use the admin mode instead. Its menu-item is Tools → Open Tab in Admin Mode. The admin mode requires GVFS, which is an important optional dependency of PCManFM-Qt (libfm-qt).

You cannot open files in the admin mode, unless the associated applications support it. Most apps don't, especially Qt apps (however, FeatherPad can open text files in the admin mode if the user has the reading permission). But it can be useful with file transference.

Because the admin mode is provided by GVFS, PCManFM-Qt just calls it, without having control over it. For example, it has a time-out, after which, the root password will be asked again. PCManFM-Qt cannot change that.

Custom Actions

Clone this wiki locally