PCManFM: Difference between revisions

From ArchWiki
(Add default white background to PDF thumbnails because transparent PDF thumbnails are crap on dark themes)
(properly add PCManFM-Qt to intro)
 
(58 intermediate revisions by 15 users not shown)
Line 1: Line 1:
[[Category:File managers]]
[[Category:File managers]]
[[ar:PCManFM]]
[[Category:LXDE]]
[[cs:PCManFM]]
[[de:PCManFM]]
[[fr:PCManFM]]
[[it:PCManFM]]
[[it:PCManFM]]
[[ja:PCManFM]]
[[ja:PCManFM]]
[[pl:PCManFM]]
[[ru:PCManFM]]
[[ru:PCManFM]]
[[zh-hans:PCManFM]]
[[zh-hans:PCManFM]]
Line 17: Line 15:
{{Related|Nemo}}
{{Related|Nemo}}
{{Related articles end}}
{{Related articles end}}
[https://wiki.lxde.org/en/PCManFM PCManFM] is a free file manager application and the standard file manager of [[LXDE]].
 
[[Wikipedia:PCManFM|PCManFM]] is an extremely fast and lightweight file manager and the standard file manager of [[LXDE]]. It uses [[GTK]] for its UI and [[GVFS]] (within GNOME's [[Wikipedia:GIO (Software)|GIO]] library) to provide virtual filesystem functionality such as trashing files and mounting remote filesystems.
 
[https://github.com/lxqt/pcmanfm-qt PCManFM-Qt] is a port to [[Qt]] which is the standard file manager of [[LXQt]]. Despite using Qt as the UI toolkit, PCManFM-Qt retains [[GVFS]] rather than using KDE's [[Wikipedia:KIO|KIO]] [https://blog.lxde.org/2013/02/19/pcmanfm-file-manager-is-ported-to-qt/]. At their cores, both file managers are desktop-environment-agnostic.


== Installation ==
== Installation ==


[[Install]] the {{Pkg|pcmanfm}} package, {{Pkg|pcmanfm-gtk3}} for the GTK3 version or {{AUR|pcmanfm-git}} for the development version.
[[Install]] one of the following the packages:
 
* [[GTK|GTK 2]]: {{Pkg|pcmanfm}}
* [[GTK|GTK 3]]: {{Pkg|pcmanfm-gtk3}}
* [[Qt|Qt5]]: {{Pkg|pcmanfm-qt}}
 
Optionally also install {{Pkg|gvfs}} for support for trash, mounting volumes with [[udisks]] and remote filesystems and {{Pkg|gvfs-smb}} for SMB/CIFS support.
 
=== Development versions ===


[[Qt]] variants are available with {{Pkg|pcmanfm-qt}} and {{AUR|pcmanfm-qt-git}}.
Development versions are available from the [[AUR]]:


{{Pkg|gvfs}} is recommended for trash support, mounting with [[udisks]] and remote filesystems.
* GTK 2: {{AUR|pcmanfm-git}}
* Qt5: {{AUR|pcmanfm-qt-git}}
* Qt6: {{AUR|pcmanfm-qt6-git}}


== Desktop management ==
== Desktop management ==
The command to allow PCManFM to set wallpapers and enable the use of desktop icons is:


  pcmanfm --desktop
PCManFM can manage the desktop, including setting a background wallpaper and showing desktop icons. To launch the desktop manager, run:
 
  $ pcmanfm --desktop


The native desktop menu of the window manager will be replaced with that provided by PCManFM. However, it can easily be restored from the PCManFM menu itself by selecting {{ic|Desktop preferences}} and then enabling the {{ic|Right click shows WM menu}} option in the {{ic|Desktop}} tab.
The native desktop menu of the window manager will be replaced with that provided by PCManFM. The native menu can be restored from the PCManFM menu by selecting ''Desktop Preferences'' and then enabling the ''Show menus provided by window managers when desktop is clicked'' option in the ''Advanced'' tab.


=== Desktop preferences ===
=== Desktop preferences ===
If using the native desktop menu provided by a window manager, enter the following command to set or amend desktop preferences at any time:
If using the native desktop menu provided by a window manager, enter the following command to set or amend desktop preferences at any time:


  $ pcmanfm --desktop-pref
  $ pcmanfm --desktop-pref


It is worthwhile to consider adding this command to a keybind and/or the native desktop menu for easy access.
Consider adding this command to a keybind and/or the native desktop menu for easy access.


=== Creating new icons ===
=== Creating new icons ===
User content such as text files, documents, images and so forth can be dragged and dropped directly onto the desktop. To create shortcuts for applications it will be necessary to copy their {{ic|.desktop}} files to the {{ic|~/Desktop}} directory itself. Do not drag and drop the files there as they will be moved completely. The syntax of the command to do so is:


cp /usr/share/applications/<name of application>.desktop ~/Desktop
Files can be dragged and dropped directly onto the desktop. To create shortcuts for applications, copy their {{ic|.desktop}} files to the {{ic|~/Desktop}} directory. Do not drag and drop the files there as they will be moved completely. The command is:


For example - where installed - to create a desktop shortcut for {{pkg|lxterminal}}, the following command would be used:
$ cp /usr/share/applications/''name-of-application''.desktop ~/Desktop


cp /usr/share/applications/lxterminal.desktop ~/Desktop
For example to create a desktop shortcut for {{pkg|lxterminal}}:


For those who used the [[XDG user directories]] program to create their {{ic|$HOME}} directories no further configuration will be required.
$ cp /usr/share/applications/lxterminal.desktop ~/Desktop
 
For those who used the [[XDG user directories]] program to create their {{ic|$HOME}} directories, no further configuration will be required.


== Daemon mode ==
== Daemon mode ==


To run PCManFM in the background (to for example automatically mount removable media), use:
To run PCManFM as a background daemon (i.e. to automatically mount removable media), use:


  pcmanfm -d
  $ pcmanfm --daemon-mode
 
Only one instance of PCManFM may run as a daemon at atime.


Should automount fail, see [[udisks]].
Should automount fail, see [[udisks]].


== Autostarting ==
== Autostarting ==
How PCManFM may be autostarted as a [[daemon]] process or to manage the desktop for a standalone [[window manager]] will depend on the window manager itself. For example, to enable management of the desktop for [[Openbox]], the following command would be added to the {{ic|~/.config/openbox/autostart}} file:


pcmanfm --desktop &
PCManFM may be [[Autostarting#On Xorg startup|autostarted]] as a [[daemon]] process or to manage the desktop.


Review the relevant wiki article and/or official home page for a particular installed or intended window manager. Should a window manager not provide an autostart file, PCManFM may be alternatively autostarted by editing one or both of the following files:
== Additional features and functionality ==


* [[xinitrc]]: When using the [[SLiM]] [[display manager]] or [[Startx]] command
Less experienced users should be aware that a file manager alone especially when installed in a standalone [[window manager]] such as [[Openbox]] will not provide the features and functionality users of full desktop environments such as [[Xfce]] and [[KDE]] will be accustomed to. Review the [[file manager functionality]] article for further information.
* [[xprofile]]: When using a display manager such as [[LXDM]] or [[LightDM]]
 
== Additional features and functionality ==
Less experienced users should be aware that a file manager alone - especially when installed in a standalone [[Window manager]] such as [[Openbox]] - will not provide the features and functionality users of full desktop environments such as [[Xfce]] and [[KDE]] will be accustomed to. Review the [[file manager functionality]] article for further information.


== Tips and tricks ==
== Tips and tricks ==
Line 77: Line 88:
=== Get thumbnails for other file types ===
=== Get thumbnails for other file types ===


{{Merge|File manager functionality#Thumbnail previews|This section is not specific to PCManFM.}}
See [[File manager functionality#Use PCManFM to get thumbnails for other file types]].


PCManFM supports image thumbnails out of the box. However, in order to view thumbnails of other file types, PCManFM uses the information provided in the files located at {{ic|/usr/share/thumbnailers}}. The packages which provide a thumbnailer usually add the corresponding ''.thumbnail'' file at {{ic|/usr/share/thumbnailers}}. For example, in order to get thumbnails for OpenDocument files, you may install {{Pkg|libgsf}} from the official repositories. For video files' thumbnails, the package {{Pkg|ffmpegthumbnailer}} is required. For PDF files, you may install {{Pkg|evince}} from the official repositories, which provides {{ic|evince-thumbnailer}} and the corresponding file at {{ic|/usr/share/thumbnailers}}. However, if you prefer not to install {{ic|evince}}, you can also replicate the functionality of {{ic|evince-thumbnailer}} using {{Pkg|imagemagick}}'s {{ic|convert}} command. This is accomplished by creating a new file with the ''.thumbnailer'' extension (e.g.: {{ic|imagemagick-pdf.thumbnailer}}) at {{ic|/usr/share/thumbnailers}} with the following content:
=== Set the terminal emulator ===


  [Thumbnailer Entry]
You can configure what terminal emulator PCManFM should use for ''Tools > Open Current Folder in Terminal'' under ''Edit > Preferences > Advanced''.
  TryExec=convert
  Exec=convert %i[0] -background "#FFFFFF" -flatten -thumbnail %s %o
  MimeType=application/pdf;application/x-pdf;image/pdf;


{{Note|The ''[0]'' next to the input file is specified so that {{ic|convert}} only generates a thumbnail of the first page. This is a {{ic|convert}}-specific syntax and has nothing to do with the syntax of the thumbnailers' files.}}
=== Integrate an archiver ===


Following this example, you can specify custom thumbnailers by creating your own ''.thumbnail'' files. Keep in mind that {{ic|%i}} refers to the input file (the file which will have its thumbnail made), {{ic|%o}} to the output file (the thumbnail image) and {{ic|%s}} to the size of the thumbnail. These parameters will be automatically substituted with the corresponding data and passed to the thumbnailer program by PCManFM.
It is possible to choose the integrated archiver under ''Edit > Preferences > Advanced''. PCManFM and PCManFM-Qt both support {{Pkg|file-roller}}, {{Pkg|xarchiver}} (or {{Pkg|xarchiver-gtk2}}), {{Pkg|engrampa}} and {{Pkg|ark}} [https://github.com/lxde/libfm/blob/5346a5390a0881d5713a71e15f371132680056ee/data/archivers.list] [https://github.com/lxqt/libfm-qt/blob/d5c15390917f55a0d8ee3283234addf4f8bf5a40/data/archivers.list]. PCManFM-Qt additionally supports {{Pkg|lxqt-archiver}}, which is the default choice for LXQt.


{{Tip|If you only get thumbnails of certain files and not of all the files of the same type try increasing the maximum file size of the files that get a thumbnail at ''Edit > Preferences > Display''.}}
=== Adding custom items to the context menu ===


=== Set the terminal emulator ===
PCManFM supports [https://web.archive.org/web/20180627170128/http://www.nautilus-actions.org/?q=node/377 Desktop file specification extension] (DES-EMA) which allows you to add arbitrary items to the context menu of files and directories. To add your own items, create {{ic|~/.local/share/file-manager/actions/}} (if it does not already exist) and add {{ic|.desktop}} files inside:
 
{{hc|~/.local/share/file-manager/actions/''action''.desktop|2=
[Desktop Entry]
Type=Action
Profiles=''profile_id''
Name=''Action name in English''
Name[''cc'']=''Action name in Language''
Icon=''Icon name''
# Example: Icon=text-editor
[X-Action-Profile ''profile_id'']
MimeTypes=''MIME-types (semicolon separated)''
Exec=''command and arguments''
# Example: Exec=gedit %f
}}


You can configure what terminal emulator PCManFM should use for ''Tools > Open Current Folder in Terminal'' under ''Edit > Preferences > Advanced''.
You can bind one or more profiles to a single action by listing their id separated by semicolons. Profiles allow you to specify which commands to execute for which file types — thus the same action can run different commands depending on the type of file selected. Besides specific MIME types (e.g. {{ic|text/plain}} for text files), you can use the following general types:


=== Integrate an archiver ===
* {{ic|all/allfiles}} - any files;
* {{ic|inode/directory}} - any directories;
* {{ic|all/all}} - any files and directories.


You can choose the integrated archiver under ''Edit > Preferences > Advanced''. PCManFM supports {{Pkg|file-roller}}, {{Pkg|xarchiver}} (or {{Pkg|xarchiver-gtk2}}), {{Pkg|engrampa}}, {{Pkg|ark}} and {{Aur|squeeze-git}}.
{{Note|It is possible to run commands as root using [[polkit|pkexec]], but calling it directly will not work and you need to create an intermediate script as described on [https://web.archive.org/web/20220428194115/https://wiki.lxde.org/en/PCManFM#pkexec_method LXDE's wiki].}}


=== Templates are accessible under ''Create New...'' ===
=== Templates are accessible under ''Create New...'' ===
Line 106: Line 131:
=== Thumbnails ===
=== Thumbnails ===


Like some other file managers (e.g. [[Nautilus]]) PCManFM will load previews of all images in a folder. To not abuse the HDD, keep the number of images in a folder to a hundred.
{{Accuracy|When using a modern SSD, PCManFM can render thumbnails for directories containing thousands of media files without issue.}}
 
Like some other file managers (e.g. [[Nautilus]]), PCManFM will load previews of all images in a folder. To not abuse the HDD, keep the number of images in a folder to a hundred.


== Troubleshooting ==
== Troubleshooting ==


=== Open With dialog window empty ===
=== "Open With" dialog window empty ===


If you do not see any applications to choose from in the open with dialog, then you can try removing {{Pkg|gnome-menus}} and instead install {{Pkg|lxmenu-data}}. Furthermore, export the following variables:
If you do not see any applications to choose from in the open with dialog, then you can try removing {{Pkg|gnome-menus}} and instead install {{Pkg|lxmenu-data}}. Furthermore, set the following [[environment variables]]:


export XDG_MENU_PREFIX=lxde-
* {{ic|XDG_MENU_PREFIX{{=}}lxde-}}
export XDG_CURRENT_DESKTOP=LXDE
* {{ic|XDG_CURRENT_DESKTOP{{=}}LXDE}}


=== No "Applications" ===
=== No "Applications" ===
Line 121: Line 148:
You can try this method: Delete all files in the {{ic|$HOME/.cache/menus}} directory, and run PCManFM again.
You can try this method: Delete all files in the {{ic|$HOME/.cache/menus}} directory, and run PCManFM again.


PCManFM requires the environment variable ''XDG_MENU_PREFIX'' to be set. The value of the variable should match the beginning of a file present in the {{ic|/etc/xdg/menus/}} directory. E.g. you can set the value in your {{ic|.xinitrc}} file with the line:
PCManFM requires the environment variable {{ic|XDG_MENU_PREFIX}} to be set. The value of the variable should match the beginning of a file present in the {{ic|/etc/xdg/menus/}} directory. See [[#"Open With" dialog window empty]].
export XDG_MENU_PREFIX="lxde-"
 
See these threads for more information: [https://bbs.archlinux.org/viewtopic.php?pid=1110903], and especially this post from the Linux Mint forums: [http://forums.linuxmint.com/viewtopic.php?f=175&t=53986#p501920]
See these threads for more information: [https://bbs.archlinux.org/viewtopic.php?pid=1110903], and especially this post from the Linux Mint forums: [https://forums.linuxmint.com/viewtopic.php?f=175&t=53986#p501920]


=== No icons ===
=== No icons ===
{{Style|Use [[Template:hc]] when suggesting edits to configuration files}}
{{Accuracy|Should we be suggesting editing the global gtk configuration for a file manager?}}
{{Expansion|Software also supports gtk3, although only gtk2 referenced here}}


If you are using a [[window manager]] instead of a [[desktop environment]] and you have no icons for folders and files, specify a GTK icon theme.
If you are using a [[window manager]] instead of a [[desktop environment]] and you have no icons for folders and files, specify a GTK icon theme.


If you have e.g. {{Pkg|oxygen-icons}} installed, edit {{ic|~/.gtkrc-2.0}} '''or''' {{ic|/etc/gtk-2.0/gtkrc}} and add the following line:
If you have e.g. {{Pkg|oxygen-icons}} installed, edit {{ic|~/.gtkrc-2.0}} '''or''' {{ic|/etc/gtk-2.0/gtkrc}} and add the following line:
  gtk-icon-theme-name = "oxygen"
  gtk-icon-theme-name = "oxygen"
{{Note|All instances of PCManFM have to be restarted for changes to apply!}}
{{Note|All instances of PCManFM have to be restarted for changes to apply!}}


Else, use an different one (''gnome'', ''hicolor'', and ''locolor'' do not work). To list all installed icon themes:
Else, use an different one (''gnome'', ''hicolor'', and ''locolor'' do not work). To list all installed icon themes:
  $ ls ~/.icons/ /usr/share/icons/
  $ ls ~/.icons/ /usr/share/icons/


If none of them is suitable, install one. To list all installable icon packages:
If none of them is suitable, install one. To list all installable icon packages:
  $ pacman -Ss icon-theme
  $ pacman -Ss icon-theme
{{Tip|For an alternative GUI solution, install {{Pkg|lxappearance}} and apply an icon theme from there.}}
{{Tip|For an alternative GUI solution, install {{Pkg|lxappearance}} and apply an icon theme from there.}}


Line 145: Line 183:


Install {{Pkg|xbindkeys}}, {{AUR|xvkbd}} and edit {{ic|~/.xbindkeysrc}} to contain the following:
Install {{Pkg|xbindkeys}}, {{AUR|xvkbd}} and edit {{ic|~/.xbindkeysrc}} to contain the following:
{{bc|<nowiki>
 
{{hc|~/.xbindkeysrc|
# Sample .xbindkeysrc for a G9x mouse.
# Sample .xbindkeysrc for a G9x mouse.
"/usr/bin/xvkbd -text '\[Alt_L]\[Left]'"
"/usr/bin/xvkbd -text '\[Alt_L]\[Left]'"
Line 151: Line 190:
"/usr/bin/xvkbd -text '\[Alt_L]\[Right]'"
"/usr/bin/xvkbd -text '\[Alt_L]\[Right]'"
  b:9
  b:9
</nowiki>}}
}}
 
Actual button codes can be obtained with package {{Pkg|xorg-xev}}.
Actual button codes can be obtained with package {{Pkg|xorg-xev}}.


Add:
Add:
  xbindkeys &
  xbindkeys &
to your {{ic|~/.xinitrc}} to execute xbindkeys on log-in.
 
to your {{ic|~/.xinitrc}} to execute ''xbindkeys'' on log-in.


=== --desktop parameter not working or crashing X-server ===
=== --desktop parameter not working or crashing X-server ===
Line 166: Line 208:
=== Terminal emulator advanced configuration not saved ===
=== Terminal emulator advanced configuration not saved ===


Make sure you have rights on libfm configuration file:
{{Accuracy|Why would the libfm configuration file not have the "right permissions" by default?}}
 
Make sure you have the right permissions on the libfm configuration file:


  $ chmod -R 755 ~/.config/libfm
  $ chmod -R 750 ~/.config/libfm
  $ chmod 644 ~/.config/libfm/libfm.conf
  $ chmod 640 ~/.config/libfm/libfm.conf


=== Make PCManFM remember your preferred Sort Files settings ===
=== Make PCManFM remember your preferred Sort Files settings ===


You can use ''View > Sort Files'' to change the order in which PCManFM lists the files, but PCManFM won't remember that the next time you start it. To make it remember, go to ''Edit > Preferences'' and close. That will write your current sort_type and sort_by values into {{ic|~/.config/pcmanfm/LXDE/pcmanfm.conf}}.
You can use ''View > Sort Files'' to change the order in which PCManFM lists the files, but PCManFM will not remember that the next time you start it. To make it remember, go to ''Edit > Preferences'' and close. That will write your current sort_type and sort_by values into {{ic|~/.config/pcmanfm/LXDE/pcmanfm.conf}}.


=== "Not authorized" error when attempting to mount drive ===
=== "Not authorized" error when attempting to mount drive ===
Line 179: Line 223:
Make this [[polkit]] rule in {{ic|/etc/polkit-1/rules.d/00-mount-internal.rules}}:
Make this [[polkit]] rule in {{ic|/etc/polkit-1/rules.d/00-mount-internal.rules}}:


polkit.addRule(function(action, subject) {
{{Style|Inconsistent syntax within configuration section}}
    if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" &&
      subject.local && subject.active && subject.isInGroup("storage")))
      {
          return polkit.Result.YES;
      }
});


And add your user to storage group:
{{hc|/etc/polkit-1/rules.d/00-mount-internal.rules|<nowiki>
polkit.addRule(function(action, subject) {
  if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" &&
      subject.local && subject.active && subject.isInGroup("storage")))
      {
        return polkit.Result.YES;
      }
});
</nowiki>}}


# usermod -aG storage username
And add yourself to the storage [[user group]].


=== Operation not supported ===
=== Operation not supported ===


See the General troubleshooting article on [[General_troubleshooting#Session_permissions|Session permissions]].
Check first if you forgot to install the optional dependency {{Pkg|gvfs}}, otherwise see the article on [[General troubleshooting#Session permissions|Session permissions]].


=== Passwords are forgotten on system restart ===
=== Passwords are forgotten on system restart ===
Install a keyring application like [[GNOME/Keyring]], [[KDE Wallet]] or {{AUR|lxqt_wallet}} for network shares or an [[SSH agent]] if appropriate.
Install a keyring application like [[GNOME/Keyring]], [[KDE Wallet]] or {{AUR|lxqt_wallet}} for network shares or an [[SSH agent]] if appropriate.

Latest revision as of 06:35, 6 March 2024

PCManFM is an extremely fast and lightweight file manager and the standard file manager of LXDE. It uses GTK for its UI and GVFS (within GNOME's GIO library) to provide virtual filesystem functionality such as trashing files and mounting remote filesystems.

PCManFM-Qt is a port to Qt which is the standard file manager of LXQt. Despite using Qt as the UI toolkit, PCManFM-Qt retains GVFS rather than using KDE's KIO [1]. At their cores, both file managers are desktop-environment-agnostic.

Installation

Install one of the following the packages:

Optionally also install gvfs for support for trash, mounting volumes with udisks and remote filesystems and gvfs-smb for SMB/CIFS support.

Development versions

Development versions are available from the AUR:

Desktop management

PCManFM can manage the desktop, including setting a background wallpaper and showing desktop icons. To launch the desktop manager, run:

$ pcmanfm --desktop

The native desktop menu of the window manager will be replaced with that provided by PCManFM. The native menu can be restored from the PCManFM menu by selecting Desktop Preferences and then enabling the Show menus provided by window managers when desktop is clicked option in the Advanced tab.

Desktop preferences

If using the native desktop menu provided by a window manager, enter the following command to set or amend desktop preferences at any time:

$ pcmanfm --desktop-pref

Consider adding this command to a keybind and/or the native desktop menu for easy access.

Creating new icons

Files can be dragged and dropped directly onto the desktop. To create shortcuts for applications, copy their .desktop files to the ~/Desktop directory. Do not drag and drop the files there as they will be moved completely. The command is:

$ cp /usr/share/applications/name-of-application.desktop ~/Desktop

For example to create a desktop shortcut for lxterminal:

$ cp /usr/share/applications/lxterminal.desktop ~/Desktop

For those who used the XDG user directories program to create their $HOME directories, no further configuration will be required.

Daemon mode

To run PCManFM as a background daemon (i.e. to automatically mount removable media), use:

$ pcmanfm --daemon-mode

Only one instance of PCManFM may run as a daemon at atime.

Should automount fail, see udisks.

Autostarting

PCManFM may be autostarted as a daemon process or to manage the desktop.

Additional features and functionality

Less experienced users should be aware that a file manager alone — especially when installed in a standalone window manager such as Openbox — will not provide the features and functionality users of full desktop environments such as Xfce and KDE will be accustomed to. Review the file manager functionality article for further information.

Tips and tricks

Get thumbnails for other file types

See File manager functionality#Use PCManFM to get thumbnails for other file types.

Set the terminal emulator

You can configure what terminal emulator PCManFM should use for Tools > Open Current Folder in Terminal under Edit > Preferences > Advanced.

Integrate an archiver

It is possible to choose the integrated archiver under Edit > Preferences > Advanced. PCManFM and PCManFM-Qt both support file-roller, xarchiver (or xarchiver-gtk2), engrampa and ark [2] [3]. PCManFM-Qt additionally supports lxqt-archiver, which is the default choice for LXQt.

Adding custom items to the context menu

PCManFM supports Desktop file specification extension (DES-EMA) which allows you to add arbitrary items to the context menu of files and directories. To add your own items, create ~/.local/share/file-manager/actions/ (if it does not already exist) and add .desktop files inside:

~/.local/share/file-manager/actions/action.desktop
[Desktop Entry]
Type=Action
Profiles=profile_id
Name=Action name in English
Name[cc]=Action name in Language
Icon=Icon name
# Example: Icon=text-editor
 
[X-Action-Profile profile_id]
MimeTypes=MIME-types (semicolon separated)
Exec=command and arguments
# Example: Exec=gedit %f

You can bind one or more profiles to a single action by listing their id separated by semicolons. Profiles allow you to specify which commands to execute for which file types — thus the same action can run different commands depending on the type of file selected. Besides specific MIME types (e.g. text/plain for text files), you can use the following general types:

  • all/allfiles - any files;
  • inode/directory - any directories;
  • all/all - any files and directories.
Note: It is possible to run commands as root using pkexec, but calling it directly will not work and you need to create an intermediate script as described on LXDE's wiki.

Templates are accessible under Create New...

PCManFM adds the files in ~/Templates as Create New... context menu items on startup.

Thumbnails

The factual accuracy of this article or section is disputed.

Reason: When using a modern SSD, PCManFM can render thumbnails for directories containing thousands of media files without issue. (Discuss in Talk:PCManFM)

Like some other file managers (e.g. Nautilus), PCManFM will load previews of all images in a folder. To not abuse the HDD, keep the number of images in a folder to a hundred.

Troubleshooting

"Open With" dialog window empty

If you do not see any applications to choose from in the open with dialog, then you can try removing gnome-menus and instead install lxmenu-data. Furthermore, set the following environment variables:

  • XDG_MENU_PREFIX=lxde-
  • XDG_CURRENT_DESKTOP=LXDE

No "Applications"

You can try this method: Delete all files in the $HOME/.cache/menus directory, and run PCManFM again.

PCManFM requires the environment variable XDG_MENU_PREFIX to be set. The value of the variable should match the beginning of a file present in the /etc/xdg/menus/ directory. See #"Open With" dialog window empty.

See these threads for more information: [4], and especially this post from the Linux Mint forums: [5]

No icons

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: Use Template:hc when suggesting edits to configuration files (Discuss in Talk:PCManFM)

The factual accuracy of this article or section is disputed.

Reason: Should we be suggesting editing the global gtk configuration for a file manager? (Discuss in Talk:PCManFM)

This article or section needs expansion.

Reason: Software also supports gtk3, although only gtk2 referenced here (Discuss in Talk:PCManFM)

If you are using a window manager instead of a desktop environment and you have no icons for folders and files, specify a GTK icon theme.

If you have e.g. oxygen-icons installed, edit ~/.gtkrc-2.0 or /etc/gtk-2.0/gtkrc and add the following line:

gtk-icon-theme-name = "oxygen"
Note: All instances of PCManFM have to be restarted for changes to apply!

Else, use an different one (gnome, hicolor, and locolor do not work). To list all installed icon themes:

$ ls ~/.icons/ /usr/share/icons/

If none of them is suitable, install one. To list all installable icon packages:

$ pacman -Ss icon-theme
Tip: For an alternative GUI solution, install lxappearance and apply an icon theme from there.

No "Previous/Next Folder" functionality with mouse buttons

A method to fix this is with Xbindkeys.

Install xbindkeys, xvkbdAUR and edit ~/.xbindkeysrc to contain the following:

~/.xbindkeysrc
# Sample .xbindkeysrc for a G9x mouse.
"/usr/bin/xvkbd -text '\[Alt_L]\[Left]'"
 b:8
"/usr/bin/xvkbd -text '\[Alt_L]\[Right]'"
 b:9

Actual button codes can be obtained with package xorg-xev.

Add:

xbindkeys &

to your ~/.xinitrc to execute xbindkeys on log-in.

--desktop parameter not working or crashing X-server

Make sure you have ownership and write permissions on ~/.config/pcmanfm.

Setting the wallpaper either by using the --desktop-pref parameter or editing ~/.config/pcmanfm/default/pcmanfm.config solves the problem.

Terminal emulator advanced configuration not saved

The factual accuracy of this article or section is disputed.

Reason: Why would the libfm configuration file not have the "right permissions" by default? (Discuss in Talk:PCManFM)

Make sure you have the right permissions on the libfm configuration file:

$ chmod -R 750 ~/.config/libfm
$ chmod 640 ~/.config/libfm/libfm.conf

Make PCManFM remember your preferred Sort Files settings

You can use View > Sort Files to change the order in which PCManFM lists the files, but PCManFM will not remember that the next time you start it. To make it remember, go to Edit > Preferences and close. That will write your current sort_type and sort_by values into ~/.config/pcmanfm/LXDE/pcmanfm.conf.

"Not authorized" error when attempting to mount drive

Make this polkit rule in /etc/polkit-1/rules.d/00-mount-internal.rules:

This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.

Reason: Inconsistent syntax within configuration section (Discuss in Talk:PCManFM)
/etc/polkit-1/rules.d/00-mount-internal.rules
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.udisks2.filesystem-mount-system" &&
      subject.local && subject.active && subject.isInGroup("storage")))
      {
         return polkit.Result.YES;
      }
});

And add yourself to the storage user group.

Operation not supported

Check first if you forgot to install the optional dependency gvfs, otherwise see the article on Session permissions.

Passwords are forgotten on system restart

Install a keyring application like GNOME/Keyring, KDE Wallet or lxqt_walletAUR for network shares or an SSH agent if appropriate.