PCManFM build and setup guide

From LXDE.org

Jump to: navigation, search

Contents

[edit] Introduction

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. Here are complete build instructions and a setup guide.

Packages on different distros have totally different naming, so only the generic names are listed here. Regarding to how those packages are named in your distro, it's distro-dependent and please refer to your own distros.

[edit] Build Prerequisite

[edit] Build time Dependencies

  • GTK+ 2 >= version 2.16
  • Glib >= version 2.18
  • menu-cache >= version 0.3.2 (This is a small lib from LXDE project. Used for application menu integration)
  • Libtool
  • Pkg-config

[edit] Additional Dependencies

If you're building source code from git repository rather than released tarballs, you'll need these:

  • Automake >= 1.10
  • Autoconf >= 2.63
  • Intltool >= 0.40

[edit] Get the Source Code

[edit] Released tarballs

[edit] The latest source code in development from git

  • menu-cache: git://lxde.git.sourceforge.net/gitroot/lxde/menu-cache
  • libfm: git://pcmanfm.git.sourceforge.net/gitroot/pcmanfm/libfm
  • pcmanfm: git://pcmanfm.git.sourceforge.net/gitroot/pcmanfm/pcmanfm

To get source code from git repository, use this command:

git clone <repository URL>

[edit] Subversion repositories

Since 2010, we switched to git. Old source code in svn repos was still kept, but things in svn repos are no longer maintained and are out of date. Please avoid using them.

[edit] Compile the Source Code

After installing the prerequisite, compiling should be smooth.

[edit] Additional step for git

configure script is only provided in tarballs. For source code downloaded from git repo, you need to generated them manually with autogen.sh.

./autogen.sh

[edit] Compile and Install

By deffault, programs will be installed to /usr/local. If you want to change the location, for example /usr, pass --prefix=<the dir you want> to "configure".

  • menu-cache:
./configure && make
sudo make install-strip
  • libfm
./configure --sysconfdir=/etc && make
sudo make install-strip
  • pcmanfm
./configure --sysconfdir=/etc && make
sudo make install-strip

Please note that --sysconfdir=/etc is needed. Otherwise default config files will be installed to wrong places.

[edit] Setup Runtime Environment Correctly

[edit] Runtime Dependencies

  • GTK+ >= version 2.16
  • Glib >= version 2.18
  • menu-cache >= version 0.3.2
  • lxmenu-data (data files for application menu integration)
  • gvfs and its dependencies (optional, but highly recommended)
    • dbus and dbus-glib (required by gvfs)
    • policykit-gnome (required for authentication for volume management)
    • Other dependencies of gvfs are all optional. That depends what configure options are turned on when compiling gvfs. If packager of your distro includes all options and didn't try to split the packages (Ubuntu, for example), you'll get a lot of dependencies. However those dependencies are not mandatory. If you carefully choose configure options or splitting the package in a more sensible way, those dependencies are all optional and can be make minimal. Bug report to your distro if you find there are a lot of unwanted dependencies caused by gvfs since they should have been optional.

[edit] Other requirements

If you want to make use of gvfs support, here are some requirements.

  • Dbus should be launched correctly
    • If you're using Gnome, XFCE, or LXDE, you don't need to touch this.
    • Try 'env | grep DBUS', if you see nothing from the output, your dbus is not running and you need to launch it.
    • man dbus-launch to see how to use it. The most easy way is adding this to your .xinitrc or whatever startup script your WM uses.
## test for an existing bus daemon, just to be safe
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
    ## if not found, launch a new one
    eval 'dbus-launch --sh-syntax --exit-with-session'
    echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
fi
  • Policykit authentication agent needs to be running (policykit-gnome)
    • If you want to launch it in your startup script:
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
    • If you're using LXDE or something that supports freedesktop.org autostart spec:
mkdir -p ~/.config/autostart
cp /etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop ~/.config/autostart

Then, edit ~/.config/autostart/polkit-gnome-authentication-agent-1.desktop and remove this line:

OnlyShowIn=GNOME;XFCE;

Actually this program is not Gnome only, but this line disable it deliberately in desktops other than Gnome or XFCE.

Without those two, gvfs won't work correctly.

[edit] To turn off GVFS support

  • Remove gvfs (This should always work)
  • Or, here is a more elegant way. This works even if you have gvfs installed
export GIO_USE_VFS="local"
export GIO_USE_VOLUME_MONITOR="unix"

[edit] Command line options

Usage:

 pcmanfm [OPTION...] [FILE1, FILE2,...] 

Help Options:

 -h, --help                           Show help options
 --help-all                           Show all help options
 --help-gtk                           Show GTK+ Options

GTK+ Options

 --class=CLASS                        Program class as used by the window manager
 --name=NAME                          Program name as used by the window manager
 --screen=SCREEN                      X screen to use
 --sync                               Make X calls synchronous
 --gtk-module=MODULES                 Load additional GTK+ modules
 --g-fatal-warnings                   Make all warnings fatal

Application Options:

 -p, --profile=<profile name>         Name of configuration profile
 --desktop                            Launch desktop manager
 --desktop-off                        Turn off desktop manager if it's running
 -d, --daemon-mode                    Run PCManFM as a daemon
 --desktop-pref                       Open desktop preference dialog
 -w, --set-wallpaper=<image file>     Set desktop wallpaper
 --wallpaper-mode=<mode>              Set mode of desktop wallpaper. <mode>=(color|stretch|fit|center|tile)
 --show-pref=n                        Open preference dialog. 'n' is number of the page you want to show (1, 2, 3...).
 --no-desktop                         No function. Just to be compatible with nautilus
 --display=DISPLAY                    X display to use

[edit] Bug Reporting and How to Help Debug PCManFM

We really need your help to make it better. If you find crashes, here are the instructions how you can help us track it down.

Notice:

  • Turning on debugging options with --enable-debug will make pcmanfm slightly slower, but this helps debugging a lot. For production use, don't turn this on.

Here are the steps to help debug pcmanfm:

  • Install gdb
  • Compile libfm and pcmanfm with debugging support
./configure --enable-debug --sysconfdir=/etc
make install (install-strip will strip debug-info which we need)
  • Kill all running instance of pcmanfm
 killall pcmanfm
  • Run pcmanfm with gdb
gdb pcmanfm 
  • Then, in gdb, type 'run'
(gdb) run
  • When you get a crash, type 'bt' in gdb to get backtrace.
(gdb) bt
  • Send the backtrace along with your bug report to us. Nice backtrace can greatly help us track down the bugs. Without gdb backtrace, a bug report reads 'pcmanfm crashes sometimes.' only doesn't help at all and will be ignored by us since it contains no useful information.
  • What a good useful bug report should contains
    • Your distro
    • How to reproduce the bug
    • The gdb backtrace
  • Send the bug report to bug tracker rather then mail it to the authors directly.

[edit] Additional Info for Packagers

You can customize the default configuration of libfm and pcmanfm. The default config files are installed to /etc/xdg/libfm and /etc/xdg/pcmanfm. Do your customization to /etc/xdg/libfm/libfm.conf and /etc/xdg/pcmanfm/pcmanfm.conf. If you don't know what options are supported, use ~/.config/pcmanfm/pcmanfm.conf as a template. Besides, pcmanfm supports using different profile. pcmanfm --profile=lxde for example let you use lxde.conf instead of pcmanfm.conf. So, you can do pcmanfm --profile <your_custom_config_file> in your startup script and then there is no need to patch the package itself.

Personal tools