PCManFM

PCManFM[dead link 2022-09-22 ] is a free file manager application and the standard file manager of LXDE.

Installation

Install the package, for the GTK3 version or for the development version.

Qt variants are available with and .

gvfs is recommended for trash support, mounting with udisks and remote filesystems.

Desktop management

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

$ 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 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

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

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 .desktop files to the 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

For example — where installed — to create a desktop shortcut for , the following command would be used:

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

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

Daemon mode

To run PCManFM in the background (to for example automatically mount removable media), use:

$ pcmanfm -d

Should automount fail, see udisks.

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 file:

pcmanfm --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

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 supports , (or ), and .

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. for text files), you can use the following general types:

  • - any files;
  • - any directories;
  • - any files and directories.

Templates are accessible under Create New...

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

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.

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 and instead install . Furthermore, export the following variables:

export XDG_MENU_PREFIX=lxde-
export 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 to be set. The value of the variable should match the beginning of a file present in the directory. E.g. you can set the value in your .xinitrc file with the line:

export XDG_MENU_PREFIX="lxde-"

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

No icons

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. installed, edit or and add the following line:

gtk-icon-theme-name = "oxygen"

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

No "Previous/Next Folder" functionality with mouse buttons

A method to fix this is with Xbindkeys.

Install , xvkbdAUR and edit to contain the following: Actual button codes can be obtained with package xorg-xev.

Add:

xbindkeys &

to your to execute xbindkeys on log-in.

--desktop parameter not working or crashing X-server

Make sure you have ownership and write permissions on .

Setting the wallpaper either by using the parameter or editing solves the problem.

Terminal emulator advanced configuration not saved

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 .

"Not authorized" error when attempting to mount drive

Make this polkit rule in /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 your user to storage group:

# usermod -aG storage username

Operation not supported

See the General troubleshooting article on Session permissions.

Passwords are forgotten on system restart

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

gollark: Better *how*?
gollark: Oh, flash storage, that is a huge one.
gollark: ... which we *have had*, modern computers are better than 30-year-old ones.
gollark: So, say, OLEDs, capacitative touchscreens (okay, I'm not sure how old those are), much faster RAM and new RAM technologies, laptops which you can actually carry, and transistors at the scale of tens of nanometres are not "new technologies"?
gollark: Laptops now are very different to ye olden laptops, touchscreens... are generally better now, I guess, LCDs can go to crazy resolutions and refresh rates and are being replaced by OLEDs in some areas, "microprocessors" is so broad and ignores the huge amount of advancement there.
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.