First a few comments. I don't use desktop icons. I don't even really like desktop icons. But I do like solving problems, and this one comes up often enough that I thought I'd write down the steps. We already have a good wiki entry for adding desktop icons using xfdesktop, but I could not find a recent topic on using pcmanfm.
There are many ways to manage desktop icons; I mentioned the wiki entry on using xfdesktop. You can also just install Xfce, or LXDE, and be done with it -- both DEs have desktop icons and they do all the configuration work for you. But if you're dead set on doing it yourself with pcmanfm, read on.
I assume you already have pcmanfm installed. If you read the man page you will see that pcmanfm can manage the desktop and set wallpaper (why this should be the job of a file manager I don't really understand, but there it is). You tell pcmanfm to manage the desktop with this command:
If you do this, you will see desktop icons, but you will see icons for all the folders and files in your /home folder. You will need to create a "desktop" folder and point pcmanfm at the folder by modifying ~/.config/user-dirs.dirs:
mkdir ~/desktop nano ~/config/user-dirs.dirs
(I use nano, but you can of course use a different editor) Now find this line in user-dirs.dirs:
and change it to
Save the file. Now pcmanfm will only display files and folders in your desktop folder.
You also need to change a few more things in a standard #! install. #! usually uses nitrogen to manage the desktop wallpaper, but because pcmanfm is now managing your desktop, you also have to use it to change the wallpaper. Back in the man page, you will see several wallpaper-related options. Edit the openbox autostart file (~/.config/openbox/autostart); remove all references to nitrogen, and add this code:
pcmanfm --desktop & sleep 1s pcmanfm --set-wallpaper=/home/user/images/wallpaper/nicepic.jpg
Now after you log out and log back in, you should have icons and a nice desktop. If you are using conky and it's not visible, make sure you have
in your .conkyrc.
If you want shortcuts for applications on your desktop, you need to copy .desktop files from /usr/share/applications into your desktop folder. This code puts a shortcut for Terminator on the desktop:
cp /usr/share/applications/terminator.desktop ~/desktop
You will probably still find your openbox menu available from a right click on the desktop. If it is not, you can get it back using the pcmanfm desktop menu, on the "Advanced" tab, select "Show menus provided by window managers when desktop is clicked"
You can change the wallpaper using "pcmanfm --set-wallpaper=" in a terminal or by using the pcmanfm desktop menu. If this menu is not available when you right-click the desktop, you can start it with
If you always want this menu from a right click, unselect the "Show menus provided by window managers..." on the Advanced tab of the menu.
Last edited by pidsley (2012-05-26 19:37:36)
great work pidsley!
explain one thing to me: you just entered these forums seemingly out of nowhere and started helping people out (and doing a great job at it too). are you set on staying semi-mysterious, and not allow us the pleasure of giving you a proper welcome to the community? in other words: Y U NO MAKE INTRO-THREAD!?
Pidsley, as promised I added the post to the wiki page: http://crunchbanglinux.org/wiki/howto/add_desktop_icons (even though John already linked to it, hehe)
Thanks for your contribution!