Difference between revisions of "PCManFM"

From LXDE.org
Jump to: navigation, search
(added testing informations)
(pkexec method)
 
(114 intermediate revisions by 20 users not shown)
Line 1: Line 1:
{| class="infobox" " align="right" cellspacing="4" cellpadding="1" style="width:20em; font-size:90%; text-align:left; border:1px solid grey; margin:1em; background:ghostwhite;"
+
{{Infobox component|
| colspan="3" align="center"| '''PCMan File Manager'''
+
name              = PCMan File Manager
|-
+
|image            = PCMan File Manager.png
| colspan="3" align="center"| [[Image:PCMan File Manager.png|250px]]
+
|image description =
|-
+
|developer        = Hong Jen Yee (PCMan)
| style="width:30%" | '''Developer'''
+
|version          = {{VersionAndDate | pcmanfm |y|}}
| Hong Jen Yee
+
|date             = {{VersionAndDate | pcmanfm ||y}}
|-
+
|genre            = File Manager
| '''Latest version'''
+
|license          = GNU General Public License
| 0.5.1
+
|website          = [http://blog.lxde.org/?cat=28/ blog.lxde.org]
|-
+
|}}
| '''Release date and age'''
+
'''PCMan File Manager''' (PCManFM) is a file manager application developed by Hong Jen Yee from Taiwan which is meant to be a replacement for Nautilus, Konqueror and Thunar. Released under the GNU General Public License, PCManFM is free software. PCManFM is the standard file manager in LXDE, which is also developed by the same author in conjunction with other developers. Since 2010, PCManFM has undergone a complete rewrite from scratch. So the new PCManFM is totally different from the old 0.5.x series. Build instructions, the ways to setup, and configuration files are different, too.
| 03 June, 2009
 
|-
 
| '''Frequently updated'''
 
| yes
 
|-
 
| '''Programming language'''
 
| C
 
|-
 
| '''Platform'''
 
| Cross-platform, Unix-like
 
|-
 
| '''Status'''
 
| active
 
|-
 
| '''Genre'''
 
| File Manager
 
|-
 
| '''License'''
 
| GNU General Public License
 
|-
 
| '''Website'''
 
| [http://pcmanfm.sourceforge.net pcmanfm.sourceforge.net]
 
|}
 
PCMan File Manager (PCManFM) is a file manager application developed by Hong Jen Yee from Taiwan which is meant to be a replacement for Nautilus, Konqueror and Thunar. Released under the GNU General Public License, PCManFM is free software. PCManFM is the standard file manager in LXDE, which is also developed by the same author in conjunction with other developers.
 
  
 
PCManFM is intended to follow the specifications given by Freedesktop.org for interoperability in free software.
 
PCManFM is intended to follow the specifications given by Freedesktop.org for interoperability in free software.
  
=Features=
+
== Features ==
 
PCManFM's features include:
 
PCManFM's features include:
 
+
* Full gvfs support with seamless access to remote filesystems (Able to handle <nowiki>sftp://</nowiki>, webdav://, smb://, ...etc when related backends of gvfs are installed.)
* Thumbnails for pictures
+
* Thumbnails for pictures (default only for local pictures) with optional EXIF support
* Desktop - Icons[clarify]
+
* Desktop management - shows wallpaper and desktop icons, highly customisable, with possibility to have different wallpapers on each desktop and on each monitor
* Internet bookmarks
+
* Bookmarks - saved places. You can see them in the left panel of PCManFM. Visible from other Gtk+ applications.
* It is multilingual
+
* Multilingual (translated in several languages)
* Inotify support (experimental)
 
* Multithreading to load large directories quickly
 
 
* Can be started in one second on normal machine
 
* Can be started in one second on normal machine
* Tabbed browsing (Similiar to Firefox)
+
* Tabbed windows (similar to Firefox tabs)
* Built-in volume management (mount/umount/eject through HAL)
+
* Volume management (mount/unmount/eject, requires gvfs) with optional automounting
* Built-in file searching utility (GUI frontend for the UNIX find + grep command)
 
 
* Drag & Drop support
 
* Drag & Drop support
 
* Files can be dragged among tabs
 
* Files can be dragged among tabs
* Load large directories in reasonable time
+
* File association support (e.g. default application to open)
* File association support (Default application)
+
* Provides icon view, compact view, detailed list view and thumbnail view.
* Handles non-UTF-8 encoded filenames correctly
+
* Standard compliant (follows the FreeDesktop.org guidelines)
* Provides icon view, compact view, and detailed list view
 
* Standard compliant (Follows FreeDesktop.org)
 
 
* Clean and user-friendly interface (GTK+ 2)
 
* Clean and user-friendly interface (GTK+ 2)
 +
* Trash can support
 +
* Applications menu virtual folder support
 +
* Applications system menu full editing is available
 +
* File system advanced search
 +
* Optional two-panel view mode
 +
* Full accessibility support for persons with disabilities
 +
* A possibility to have different view options for some folders
 +
* Customizable main window layout
 +
* Third-party plugins support
 +
* Extended terminal emulators support
 +
* File templates support (both GNOME and KDE styles are supported) to simple creation of new files
 +
 +
== Get and Compile the Source Code ==
 +
Please, refer to the [[LXDE:PCManFM build and setup guide|complete build and setup guide]] for PCManFM/libfm.
 +
 +
== Setup ==
 +
=== Desktop Path ===
 +
If your desktop displays the files of your /home/ and not the files on your real Desktop path, you probably do not have an established path "Desktop". To fix this please do the following:
 +
* mkdir ~/Desktop
 +
* nano ~/.config/user-dirs.dirs
 +
* change XDG_DESKTOP_DIR="$HOME" to XDG_DESKTOP_DIR="$HOME/Desktop"
 +
* and restart your LXDE session (log out and log in).
  
¿What don't have?
+
=== Desktop Icons/links ===
*Don't have support for SAMBA, you can't use \\192.168.0.10  \\houselaptop  or smb:\\houselaptop
+
If you start PCManFM with the option "--desktop", it will allow PCManFM to set wallpapers and enable the use of desktop icons. However desktop links are not totally obvious. Here are some hints.
  
PCManFM's look and feel can be modified to be like Windows Explorer. Therefore it is useful for people transitioning from Microsoft Windows to Linux.
+
;Create desktop files with the GUI:
 +
# Open context menu on desktop, and create new empty file with name ''myapplication.desktop'' (or choose other name if such file already exists)
 +
# Right-click on new file, choose ''Properties'' and change name, icon, command, etc. to desired ones.
  
= Issues =
+
;Manually create desktop icons:
 +
Open the files with editor to see how they work:
 +
* Look at the examples here: ''/usr/share/applications''
 +
* A typical file name is like this one: ''leafpad.desktop'' The file name won't show up on pcmanfm but name stated inside the file instead.
  
http://www.bekkine.ws/archives/11-Simple-Trashcan-Implementation-for-Linux-Users.html
+
;Other Hints:
 +
* Copy files from ''/usr/share/applications'' to your ~/Desktop folder.
 +
* Drag and drop an application from ''Applications'' special folder onto your desktop.
 +
* Make your own desktop files by following the examples above and put them in your ~/Desktop folder.
 +
* The same ''*.desktop'' files can be used for the buttons in the lxpanel, refer to [[LXPanel]] documentation for details.
 +
* Drag and drop a link from browser or mail client onto your desktop to create a shortcut.
 +
* Create a template in your ~/Templates folder - file name on creation will be new file name template, contents will be used as template in context menu ''Create New...'' submenu. Example of template:
 +
[Desktop Entry]
 +
Type=Application
 +
Name=New Application
 +
Icon=exec
  
The user should be aware that there is no trash - files are lost permanently. A dialog pops up when deleting, to confirm this. If the user is not happy with this, it is possible to:
+
;Trashcan
* use Thunar from XFCE, which should be easily installed from the repositories, in many Linux distros. Thunar is not quite as light as PCManFM, and doesn't control the desktop icons like PCManFM does, but still works well within LXDE.
+
If you use PCManFM to manage your desktop, you may want to have an icon for the trashcan, too. Since version 1.2.0 you can simply open desktop properties window and check the appropriate box.
* [http://www.bekkine.ws/archives/11-Simple-Trashcan-Implementation-for-Linux-Users..html Create a trashcan] which will work with command line, and should work with PCManFM ''(has anyone confirmed this?)'' This also describes how to create a desktop trash icon.
 
  
=Desktop Path=
+
Before version 1.2.0 this didn't work out of the box. To add a working trashcan symbol to your desktop for older PCManFM version, simply follow these steps (credits to ronniew):
  
If your desktop displays the files of your /home/ and not the files on your real Desktop path, you probably do not have an established path "Desktop". To fix this please do the following:  
+
* Right click on a free place on your desktop and create a new file by using the context menu and use "Trash" at it's name
 +
* Edit the new file with leafpad or any other text editor and enter the following text:
 +
 
 +
#!/usr/bin/env xdg-open
 +
[Desktop Entry]
 +
Version=1.0
 +
Name=Check Trash
 +
Comment=Browser
 +
Exec=pcmanfm trash:///
 +
Terminal=false
 +
X-MultipleArgs=false
 +
Type=Application
 +
Icon=gnome-stock-trash.svg
 +
Categories=Application;Desktop;Filemanager
 +
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;
 +
StartupWMClass=Pcmanfm
 +
StartupNotify=true
 +
 
 +
* Save the newly edited file and close leafpad. That's it.
 +
Note though the trashcan icon in this solution cannot follow the Trash Can state (empty or full). Upgrade PCManFM to newer version to get it working out of the box and eliminate this workaround.
 +
 
 +
===Multiple monitor setup===
 +
Since version 1.2.0 all the monitor settings are completely independent for each monitor. Therefore if you want some of old behavior you should do things differently.
 +
 
 +
;Desktop wallpaper
 +
* If you wish your wallpaper to span over your whole screen composed of multiple monitors then choose option 'Stretch to fill the complete screen' for wallpaper mode in the Desktop Preferences window and then choose the same wallpaper file on each desktop.
 +
 
 +
;Desktop icons
 +
* If you wish to have the same icons from ~/Desktop folder on each monitor then just set 'Default' as an option for 'Use desktop as a folder (show icons on it) by path:' in the Desktop Preferences.
 +
* If you wish to have icons only on a single monitor then uncheck the box option 'Use desktop as a folder (show icons on it) by path:' in the Desktop Preferences.
 +
* If you wish to have different icons on each monitor then use 'Custom:' option for 'Use desktop as a folder (show icons on it) by path:' in the Desktop Preferences.
 +
 
 +
=== Add own options to the files context menu ===
 +
The file managers such as PCManFM support the [http://www.nautilus-actions.org/?q=node/377 Desktop file specification extension (DES-EMA)] designed specifically for the purpose to extend menus of file managers. Create own desktop entry file with required actions and you will have them added to the context menu instantly. You can do it either manually using any text editor (files should be placed into the directory ''~/.local/share/file-manager/actions'') or using dedicated application such as ''nautilus-actions-config-tool''.
 +
 
 +
== Create New... ==
 +
In the folder context menu the very first item is a ''Create New...'' submenu. Using this submenu you can create different types of files. Basic types are '''Folder''' and '''Empty File'''. To add some other types into this submenu you need LibFM at least version 1.2.0. You can have both system-wide templates and your own templates shown in the submenu. To use system-wide templates appropriate setting should be enabled in Preferences. To use your own templates you should have ~/Templates folder (it may have localized name instead, look into ~/.config/user-dirs.dirs file, appropriate setting is XDG_TEMPLATES_DIR) and you can put your own template file into that directory. Both GNOME template style and KDE template style are supported.
 +
The GNOME template style means new file name template will be taken as the name of file in the ~/Templates directory, the contents of the template file will be copied into new file.
 +
The KDE template style means each template has own Desktop Entry file with ''Type=Link'' where new file name template will be set in ''URL'' field of the Desktop Entry and if the file mentioned in ''URL'' field exists then its contents will be copied into new file.
 +
 
 +
Note that you have to restart PCManFM if ~/Templates folder didn't exist before and you created it. Otherwise it will be ignored by PCManFM.
 +
 
 +
== How view settings change in one PCManFM window affects other PCManFM windows ==
 +
=== Settings that are always the same for new created windows ===
 +
{| class="wikitable" style="text-align: center;"
 +
! The setting !! Initial value
 +
|-
 +
| Dual Pane Mode || Disabled
 +
|-
 +
| Fullscreen Mode || Disabled
 +
|-
 +
| View Mode || Set from Preferences
 +
|-
 +
| Files Filter || Show all
 +
|}
 +
 
 +
=== Settings that affect current and initial setting for each new window created after change was made ===
 +
* Side bar mode
 +
* Path bar mode
 +
* Sort settings
 +
* Hidden files visibility
 +
 
 +
=== Settings that affect initial setting for each new window created after some window was closed ===
 +
* Window size
 +
* Window maximized state
 +
 
 +
=== Settings that affect current as well as any other opened window immediately ===
 +
* Toolbar layout
 +
* Status bar visibility
 +
* Size of icons
 +
* Preferences settings except Default View Mode
 +
 
 +
== Tips and Tricks ==
 +
=== General usage ===
 +
* Next keyboard actions will work on folder in the current tab even if keyboard focus is on Sidebar or Toolbar buttons:
 +
** Selected File Properties
 +
** Context menu for selection
 +
* Next keyboard actions will work depending on keyboard focus:
 +
** Cut selected into clipboard
 +
** Copy selected into clipboard
 +
** Paste clipboard content
 +
** Delete selected
 +
** Select all
 +
* All other keys mentioned in main menu work always on folder in the current tab.
 +
* Context menu for folder selection can be called by pressing standard context menu keys ('Menu', or 'Shift' + 'F10'). In versions 1.1.x it can be done by pressing 'Shift' + 'Menu' instead.
 +
* Pressing 'Ctrl' + 'Menu' when folder view is focused calls context menu for folder itself. In versions 1.1.x it can be done by pressing 'Menu' instead.
 +
* You can select few files by pressing cursor keys while holding 'Shift'.
 +
* You can toggle selection of focused file by pressing 'Ctrl' + space.
 +
* A properties window for the selected file can be called by pressing 'Alt' + 'Enter'.
 +
* When keyboard focus is in the Location Bar, key 'Tab' does completion and never leave the bar.
 +
* Pressing 'Enter' in the Location Bar will change keyboard focus onto folder in the current active tab.
 +
* Pressing 'Shift' + 'Tab' in the Location Bar will change keyboard focus onto Sidebar.
 +
----
 +
* View mode (icons, list, etc.) for current tab can be changed in main menu. Unlike to other changes, this one does not affect other tabs and not remembered for further usage. To change view mode for all new tabs and windows use the setting in the Preferences window.
 +
* You can use independent view settings (view mode, sort options, and ''show hidden'' option) for some folder by checking an option in main menu.
 +
----
 +
* You can disable showing icons on the desktop in the desktop preferences.
 +
 
 +
=== Run as root ===
 +
You can use [http://www.nautilus-actions.org/?q=node/377 Desktop file specification extension (DES-EMA)] to add support for opening some folder as root. Example of the desktop entry that implements such feature in file and folder context menus:
 +
[Desktop Entry]
 +
Name = Open as Root
 +
Tooltip = Open the folder as root
 +
Icon = terminal
 +
Profiles = on_folder;
 +
 +
[X-Action-Profile on_folder]
 +
Name = Open as Root
 +
MimeTypes = inode/directory;
 +
SelectionCount = 1
 +
Schemes = file;
 +
Exec = gksudo pcmanfm %f
 +
You can replace ''gksudo'' above with another application that gives you '''root''' privileges in dependence which one do you have in your system, such as ''gksu'' (Debian Sqeeze) or ''beesu'' (Fedora Core).
 +
 
 +
You can replace ''pcmanfm'' above too, with ''pcmanfm-qt'' for example.
 +
 
 +
That file should be put into the directory '''~/.local/share/file-manager/actions''' to take effect.
 +
 
 +
PCManFM versions 0.4 thru 1.1 had the option in main menu: "Tools" > "Open Current Folder as Root", but now it is removed due to security considerations.
 +
 
 +
==== Ubuntu 18.04 gksudo was removed  ====
 +
===== pkexec method =====
 +
This method allow to replace gksudo with bash script and pkexec.
 +
 
 +
Create xsudo file:
 +
touch xsudo
 +
Make it executable:
 +
chmod +x xsudo
 +
Insert this:
 +
#!/bin/bash
 +
if [ -z $1 ]; then
 +
  echo -e "at least 1 argument required!\n" >> /dev/stderr
 +
  exit 1
 +
fi
 +
COMMAND=$1
 +
shift #shift first arg
 +
for ARG in "$@"
 +
do
 +
  if [ -z "$ARGS" ]; then
 +
  ARGS="$ARG"
 +
  else
 +
  ARGS="$ARGS $ARG"
 +
  fi
 +
done
 +
ARGS=\'$ARGS\'
 +
eval pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $COMMAND $ARGS
 +
exit 0
 +
 
 +
Now you can use xsudo script to run application as root. Example:  
 +
xsudo geany /etc/shadow
 +
This will open /etc/shadow with geany editor.
  
* mkdir ~/Desktop
+
===== admin:// method =====
* nano ~/.config/user-dirs.dirs (as root)
+
This method works good with PCManFM 1.2.5.
* change XDG_DESKTOP_DIR="$HOME" to XDG_DESKTOP_DIR="$HOME/Desktop"
 
* and restart your LXDE session.
 
  
In case you are not able to add icons to the LXDE Desktop by clicking Add To Desktop, or if an error message pops up while adding a new folder/file in the desktop, please add a Desktop folder in your home directory. To do this, just type the following in a terminal:
+
Create ~/.local/share/applications/open_as_root.desktop
* mkdir ~/Desktop
 
  
=Desktop Icons/links=
+
[Desktop Entry]
 +
Type=Application
 +
Name=Open as root
 +
Exec=pcmanfm admin://%f
 +
Categories=Other;
 +
NoDisplay=true
 +
MimeType=inode/directory
 +
Terminal=false
 +
Icon=file-manager
  
Desktop links are not totally obvious.  Here are some hints.
+
Edit if exists or create new ~/.config/mimeapps.list
==How to Make Them==
 
Open the files with editor to see how they work:
 
* Look at the examples here:  ''/usr/share/applications''
 
* A typical file name is like this one: ''leafpad.desktop''  The ''.desktop'' file extension won't show up on pcmanfm.
 
=Other Hints=
 
* Copy files from ''/usr/share/applications'' to your ~/Desktop folder.
 
* Make your own desktop links by following the examples above and put them in your ~/Desktop folder.
 
* The same ''.desktop'' files are used for the buttons in the lxpanel (bottom task bar).
 
  
= Testing PCManFM =
+
Change as follows:
  
Here you can find the speciall Informations for PCManFM.
+
[Added Associations]
 +
inode/directory=open_as_root.desktop;
  
== Adresses ==
+
== Known GTK issues ==
 +
* Non-mountable entries in /etc/fstab may cause 100% CPU load on mount attempt. The bug is reported to GNOME. '''Workaround''': disable option 'Mount mountable volumes automatically on program startup' in Preferences or (better) remove those devices from /etc/fstab.
 +
* Some pictures are big in pixels size while small in file size (for example, 250 Mpix image can easily be 1 MB file) so to avoid memory overload maximum thumbnail file size is checked not only against its size in KB but also against its size in Kpix as well.
  
* Subversion: https://pcmanfm.svn.sourceforge.net/svnroot/pcmanfm
+
== Bug reports, patch submissions or feature requests ==
* Tracker: http://sourceforge.net/tracker/?group_id=156956
+
* Tracker: http://sourceforge.net/tracker/?group_id=156956 (broken link)
 
* Bugtracker: http://sourceforge.net/tracker/?group_id=156956&atid=801864
 
* Bugtracker: http://sourceforge.net/tracker/?group_id=156956&atid=801864
  
== Compiling options ==
+
== See also ==
 
+
* [[Extension modules for LibFM]]
For libfm there are currently no special compiling options.
+
* [[How to contribute into translating LXDE]]
 +
<!--* [[PCManFM Roadmap]] (outdated)-->
  
=External Links=
+
== External Links ==
* http://pcmanfm.sourceforge.net
+
* [[wikipedia:PCMan File Manager|Wikipedia article]]
 +
* [http://blog.lxde.org/?cat=28 Official blog]
  
[[Category:Free X file managers]]
 
[[Category:Free software programmed in C]]
 
 
[[Category:LXDE]]
 
[[Category:LXDE]]
[[Category:LXDE Components]]
+
[[Category:Component]]
[[Category:LXDE Module]]
 
[[Category:LXDE File Manager]]
 
 
 
  
 
[[de:PCManFM]]
 
[[de:PCManFM]]
 
[[es:PCManFM]]
 
[[es:PCManFM]]
 
[[fr:PCManFM]]
 
[[fr:PCManFM]]
[[it:PCManFM]]
+
[[id:PCManFM]]
 
[[ja:PCManFM]]
 
[[ja:PCManFM]]
 
[[ko:PCManFM]]
 
[[ko:PCManFM]]
 +
[[pl:PCManFM]]
 +
[[pt:PCManFM]]
 
[[ru:PCManFM]]
 
[[ru:PCManFM]]
 
[[sv:PCManFM]]
 
[[sv:PCManFM]]
 
[[tr:PCManFM]]
 
[[tr:PCManFM]]
[[vi:PCManFM]]
 
 
[[zh:PCManFM]]
 
[[zh:PCManFM]]

Latest revision as of 00:40, 3 September 2018

PCMan File Manager
PCMan File Manager.png
Developer Hong Jen Yee (PCMan)
Latest version 1.3.1 (from 17 Dec. 2018)
Genre File Manager
License GNU General Public License
Website blog.lxde.org

PCMan File Manager (PCManFM) is a file manager application developed by Hong Jen Yee from Taiwan which is meant to be a replacement for Nautilus, Konqueror and Thunar. Released under the GNU General Public License, PCManFM is free software. PCManFM is the standard file manager in LXDE, which is also developed by the same author in conjunction with other developers. Since 2010, PCManFM has undergone a complete rewrite from scratch. So the new PCManFM is totally different from the old 0.5.x series. Build instructions, the ways to setup, and configuration files are different, too.

PCManFM is intended to follow the specifications given by Freedesktop.org for interoperability in free software.

Features

PCManFM's features include:

  • Full gvfs support with seamless access to remote filesystems (Able to handle sftp://, webdav://, smb://, ...etc when related backends of gvfs are installed.)
  • Thumbnails for pictures (default only for local pictures) with optional EXIF support
  • Desktop management - shows wallpaper and desktop icons, highly customisable, with possibility to have different wallpapers on each desktop and on each monitor
  • Bookmarks - saved places. You can see them in the left panel of PCManFM. Visible from other Gtk+ applications.
  • Multilingual (translated in several languages)
  • Can be started in one second on normal machine
  • Tabbed windows (similar to Firefox tabs)
  • Volume management (mount/unmount/eject, requires gvfs) with optional automounting
  • Drag & Drop support
  • Files can be dragged among tabs
  • File association support (e.g. default application to open)
  • Provides icon view, compact view, detailed list view and thumbnail view.
  • Standard compliant (follows the FreeDesktop.org guidelines)
  • Clean and user-friendly interface (GTK+ 2)
  • Trash can support
  • Applications menu virtual folder support
  • Applications system menu full editing is available
  • File system advanced search
  • Optional two-panel view mode
  • Full accessibility support for persons with disabilities
  • A possibility to have different view options for some folders
  • Customizable main window layout
  • Third-party plugins support
  • Extended terminal emulators support
  • File templates support (both GNOME and KDE styles are supported) to simple creation of new files

Get and Compile the Source Code

Please, refer to the complete build and setup guide for PCManFM/libfm.

Setup

Desktop Path

If your desktop displays the files of your /home/ and not the files on your real Desktop path, you probably do not have an established path "Desktop". To fix this please do the following:

  • mkdir ~/Desktop
  • nano ~/.config/user-dirs.dirs
  • change XDG_DESKTOP_DIR="$HOME" to XDG_DESKTOP_DIR="$HOME/Desktop"
  • and restart your LXDE session (log out and log in).

Desktop Icons/links

If you start PCManFM with the option "--desktop", it will allow PCManFM to set wallpapers and enable the use of desktop icons. However desktop links are not totally obvious. Here are some hints.

Create desktop files with the GUI
  1. Open context menu on desktop, and create new empty file with name myapplication.desktop (or choose other name if such file already exists)
  2. Right-click on new file, choose Properties and change name, icon, command, etc. to desired ones.
Manually create desktop icons

Open the files with editor to see how they work:

  • Look at the examples here: /usr/share/applications
  • A typical file name is like this one: leafpad.desktop The file name won't show up on pcmanfm but name stated inside the file instead.
Other Hints
  • Copy files from /usr/share/applications to your ~/Desktop folder.
  • Drag and drop an application from Applications special folder onto your desktop.
  • Make your own desktop files by following the examples above and put them in your ~/Desktop folder.
  • The same *.desktop files can be used for the buttons in the lxpanel, refer to LXPanel documentation for details.
  • Drag and drop a link from browser or mail client onto your desktop to create a shortcut.
  • Create a template in your ~/Templates folder - file name on creation will be new file name template, contents will be used as template in context menu Create New... submenu. Example of template:
[Desktop Entry]
Type=Application
Name=New Application
Icon=exec
Trashcan

If you use PCManFM to manage your desktop, you may want to have an icon for the trashcan, too. Since version 1.2.0 you can simply open desktop properties window and check the appropriate box.

Before version 1.2.0 this didn't work out of the box. To add a working trashcan symbol to your desktop for older PCManFM version, simply follow these steps (credits to ronniew):

  • Right click on a free place on your desktop and create a new file by using the context menu and use "Trash" at it's name
  • Edit the new file with leafpad or any other text editor and enter the following text:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Name=Check Trash
Comment=Browser
Exec=pcmanfm trash:///
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=gnome-stock-trash.svg
Categories=Application;Desktop;Filemanager
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;
StartupWMClass=Pcmanfm
StartupNotify=true
  • Save the newly edited file and close leafpad. That's it.

Note though the trashcan icon in this solution cannot follow the Trash Can state (empty or full). Upgrade PCManFM to newer version to get it working out of the box and eliminate this workaround.

Multiple monitor setup

Since version 1.2.0 all the monitor settings are completely independent for each monitor. Therefore if you want some of old behavior you should do things differently.

Desktop wallpaper
  • If you wish your wallpaper to span over your whole screen composed of multiple monitors then choose option 'Stretch to fill the complete screen' for wallpaper mode in the Desktop Preferences window and then choose the same wallpaper file on each desktop.
Desktop icons
  • If you wish to have the same icons from ~/Desktop folder on each monitor then just set 'Default' as an option for 'Use desktop as a folder (show icons on it) by path:' in the Desktop Preferences.
  • If you wish to have icons only on a single monitor then uncheck the box option 'Use desktop as a folder (show icons on it) by path:' in the Desktop Preferences.
  • If you wish to have different icons on each monitor then use 'Custom:' option for 'Use desktop as a folder (show icons on it) by path:' in the Desktop Preferences.

Add own options to the files context menu

The file managers such as PCManFM support the Desktop file specification extension (DES-EMA) designed specifically for the purpose to extend menus of file managers. Create own desktop entry file with required actions and you will have them added to the context menu instantly. You can do it either manually using any text editor (files should be placed into the directory ~/.local/share/file-manager/actions) or using dedicated application such as nautilus-actions-config-tool.

Create New...

In the folder context menu the very first item is a Create New... submenu. Using this submenu you can create different types of files. Basic types are Folder and Empty File. To add some other types into this submenu you need LibFM at least version 1.2.0. You can have both system-wide templates and your own templates shown in the submenu. To use system-wide templates appropriate setting should be enabled in Preferences. To use your own templates you should have ~/Templates folder (it may have localized name instead, look into ~/.config/user-dirs.dirs file, appropriate setting is XDG_TEMPLATES_DIR) and you can put your own template file into that directory. Both GNOME template style and KDE template style are supported. The GNOME template style means new file name template will be taken as the name of file in the ~/Templates directory, the contents of the template file will be copied into new file. The KDE template style means each template has own Desktop Entry file with Type=Link where new file name template will be set in URL field of the Desktop Entry and if the file mentioned in URL field exists then its contents will be copied into new file.

Note that you have to restart PCManFM if ~/Templates folder didn't exist before and you created it. Otherwise it will be ignored by PCManFM.

How view settings change in one PCManFM window affects other PCManFM windows

Settings that are always the same for new created windows

The setting Initial value
Dual Pane Mode Disabled
Fullscreen Mode Disabled
View Mode Set from Preferences
Files Filter Show all

Settings that affect current and initial setting for each new window created after change was made

  • Side bar mode
  • Path bar mode
  • Sort settings
  • Hidden files visibility

Settings that affect initial setting for each new window created after some window was closed

  • Window size
  • Window maximized state

Settings that affect current as well as any other opened window immediately

  • Toolbar layout
  • Status bar visibility
  • Size of icons
  • Preferences settings except Default View Mode

Tips and Tricks

General usage

  • Next keyboard actions will work on folder in the current tab even if keyboard focus is on Sidebar or Toolbar buttons:
    • Selected File Properties
    • Context menu for selection
  • Next keyboard actions will work depending on keyboard focus:
    • Cut selected into clipboard
    • Copy selected into clipboard
    • Paste clipboard content
    • Delete selected
    • Select all
  • All other keys mentioned in main menu work always on folder in the current tab.
  • Context menu for folder selection can be called by pressing standard context menu keys ('Menu', or 'Shift' + 'F10'). In versions 1.1.x it can be done by pressing 'Shift' + 'Menu' instead.
  • Pressing 'Ctrl' + 'Menu' when folder view is focused calls context menu for folder itself. In versions 1.1.x it can be done by pressing 'Menu' instead.
  • You can select few files by pressing cursor keys while holding 'Shift'.
  • You can toggle selection of focused file by pressing 'Ctrl' + space.
  • A properties window for the selected file can be called by pressing 'Alt' + 'Enter'.
  • When keyboard focus is in the Location Bar, key 'Tab' does completion and never leave the bar.
  • Pressing 'Enter' in the Location Bar will change keyboard focus onto folder in the current active tab.
  • Pressing 'Shift' + 'Tab' in the Location Bar will change keyboard focus onto Sidebar.

  • View mode (icons, list, etc.) for current tab can be changed in main menu. Unlike to other changes, this one does not affect other tabs and not remembered for further usage. To change view mode for all new tabs and windows use the setting in the Preferences window.
  • You can use independent view settings (view mode, sort options, and show hidden option) for some folder by checking an option in main menu.

  • You can disable showing icons on the desktop in the desktop preferences.

Run as root

You can use Desktop file specification extension (DES-EMA) to add support for opening some folder as root. Example of the desktop entry that implements such feature in file and folder context menus:

[Desktop Entry]
Name = Open as Root
Tooltip = Open the folder as root
Icon = terminal
Profiles = on_folder;

[X-Action-Profile on_folder]
Name = Open as Root
MimeTypes = inode/directory;
SelectionCount = 1
Schemes = file;
Exec = gksudo pcmanfm %f

You can replace gksudo above with another application that gives you root privileges in dependence which one do you have in your system, such as gksu (Debian Sqeeze) or beesu (Fedora Core).

You can replace pcmanfm above too, with pcmanfm-qt for example.

That file should be put into the directory ~/.local/share/file-manager/actions to take effect.

PCManFM versions 0.4 thru 1.1 had the option in main menu: "Tools" > "Open Current Folder as Root", but now it is removed due to security considerations.

Ubuntu 18.04 gksudo was removed

pkexec method

This method allow to replace gksudo with bash script and pkexec.

Create xsudo file:

touch xsudo

Make it executable:

chmod +x xsudo

Insert this:

#!/bin/bash
if [ -z $1 ]; then
 echo -e "at least 1 argument required!\n" >> /dev/stderr
 exit 1
fi
COMMAND=$1
shift #shift first arg
for ARG in "$@"
do
 if [ -z "$ARGS" ]; then
  ARGS="$ARG"
 else
  ARGS="$ARGS $ARG"
 fi 
done
ARGS=\'$ARGS\'
eval pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $COMMAND $ARGS
exit 0

Now you can use xsudo script to run application as root. Example:

xsudo geany /etc/shadow

This will open /etc/shadow with geany editor.

admin:// method

This method works good with PCManFM 1.2.5.

Create ~/.local/share/applications/open_as_root.desktop

[Desktop Entry]
Type=Application
Name=Open as root
Exec=pcmanfm admin://%f
Categories=Other;
NoDisplay=true
MimeType=inode/directory
Terminal=false
Icon=file-manager

Edit if exists or create new ~/.config/mimeapps.list

Change as follows:

[Added Associations]
inode/directory=open_as_root.desktop;

Known GTK issues

  • Non-mountable entries in /etc/fstab may cause 100% CPU load on mount attempt. The bug is reported to GNOME. Workaround: disable option 'Mount mountable volumes automatically on program startup' in Preferences or (better) remove those devices from /etc/fstab.
  • Some pictures are big in pixels size while small in file size (for example, 250 Mpix image can easily be 1 MB file) so to avoid memory overload maximum thumbnail file size is checked not only against its size in KB but also against its size in Kpix as well.

Bug reports, patch submissions or feature requests

See also

External Links