LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   replacing pcmanfm with Nautilus in Openbox/lxde (https://www.linuxquestions.org/questions/linux-software-2/replacing-pcmanfm-with-nautilus-in-openbox-lxde-886585/)

nokangaroo 06-15-2011 03:42 PM

replacing pcmanfm with Nautilus in Openbox/lxde
 
Edit: Changed the title to fit the solution I found (which is to replace pcmanfm), and added some stuff. This was originally about mailcap, which is an exotic thingummy to change preferred applications, but did not work.

Edit: Will not work in Oneiric, at least not with nautilus handling the desktop (worked for a while, but Nautilus no longer handles desktop fonts differently from window fonts, and if I change desktop fonts from black to white all fonts go white).

nokangaroo 06-19-2011 01:12 PM

Solved - installed nautilus, which works very well in openbox with the --no-desktop option (no perceptible speed disadvantage, and video still works without fractures. Edit: Speed is anyway perceptibly faster than in GNOME). Replaced pcmanfm in my desktop launchers with nautilus --no-desktop and unchecked "mount removable media automatically" in pcmanfm to get rid of a DBus error message. I just hope that nautilus will still be available after the demise of Gnome2. (Edit: I suppose lxde will switch to GTK 3 in time).

Edit: In the above solution the desktop is still drawn by pcmanfm. But it is possible to get by without pcmanfm entirely. As an experiment I let Nautilus draw my desktop, and it works perfectly (and Nautilus with the Sodio window border theme and Mist widget theme looks really cool, and the font rendering is excellent, better than in KDE). I installed lxde to get all the files, and then I manually deleted pcmanfm, leafpad and lxterminal (for which there are better alternatives: gedit, kate, gnome-terminal, konsole, all of which work perfectly well in openbox/lxde). What remains to be done is to get rid of the Nautilus desktop context menu (which is not much use without installing the whole GNOME kit & kaboodle, which of course I want to avoid). A wallpaper can be set with the nautilus-wallpaper extension. Adding launchers to the desktop from the menu works, also creating new launchers with lxshortcut, except you have to manually mark them as executable. Also, mounted USB volumes are shown on the desktop, which I am used to from GNOME.

So it seems that Nautilus needs only very few modifications to be a file manager of choice in Openbox. Of course you don't have to uninstall pcmanfm. I just wanted to see if it was really a dependency, which apparently it isn't.


Here are my config files:

/etc/xdg/lxsession/LXDE/autostart:
@/usr/bin/xkbcomp /usr/local/etc/xkb.dump.modified $DISPLAY #either here or in $HOME/.config/lxsession/LXDE/autostart
@xscreensaver -no-splash
@lxpanel --profile LXDE
@/usr/bin/nautilus -n
@/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
#xkb.dump.modified is my customized keyboard map with the Ctrl and Win keys swapped

/etc/lxdm/lxdm.conf:
[base]
# autologin=<username>
session=/usr/bin/startlxde
# numlock=0
greeter=/usr/lib/lxdm/lxdm-greeter-gtk

[server]
# arg=/usr/bin/X -nr vt1

[display]
#gtk_theme=Mist
#bg=/usr/share/backgrounds/default.png
bottom_pane=1
lang=1
#theme=Sodio

[input]

[userlist]
disable=0
white=
black=

Also, I commented out the lines in /usr/bin/startlxde after "Ensure the existance [sic] of openbox config file".


Edit: Created a shortcut to show the root-menu (Win+Space, as Alt+Space was already assigned to the client menu). Right-clicking on the desktop shows the Nautilus menu as before, from which I have removed the nonfunctional entries "Add Launcher" and "Change Desktop Background" by editing /usr/share/nautilus/ui/nautilus-desktop-icon-view-ui.xml (removing lines 7 and 12) to look like this:

<ui>
<popup name="background">
<placeholder name="Before Zoom Items">
<placeholder name="New Window Items">
</placeholder>
<placeholder name="New Object Items">
</placeholder>
</placeholder>
<placeholder name="After Zoom Items">
<placeholder name="Background Items">
</placeholder>
</placeholder>
</popup>
<popup name="selection">
<placeholder name="Empty Trash Holder">
<menuitem name="Empty Trash" action="Empty Trash Conditional"/>
</placeholder>
</popup>
</ui>


As the instructions I found to configure the root menu were unclear, here is an example menu.xml that will work (replace nautilus with pcmanfm and konsole with lxterminal or xterm if necessary):

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="apps-menu" label="Applications">
<item label="Nautilus">
<action name="Execute">
<startupnotify>
<enabled>
yes
</enabled>
<icon/>
</startupnotify>
<command>
nautilus /
</command>
</action>
</item>
<item label="Terminal">
<action name="Execute">
<command>
konsole
</command>
</action>
</item>
<item label="Firefox">
<action name="Execute">
<command>
firefox
</command>
</action>
</item>
</menu>
<menu id="multimedia-menu" label="Multimedia">
<item label="VLC">
<action name="Execute">
<execute>
qvlc
</execute>
</action>
</item>
<item label="VLC (drive 0)">
<action name="Execute">
<execute>
vlc /dev/sr0
</execute>
</action>
</item>
<item label="VLC (drive 1)">
<action name="Execute">
<execute>
vlc /dev/sr1
</execute>
</action>
</item>
</menu>
<menu id="root-menu" label="LXDE">
<separator label="LXDE"/>
<menu id="apps-menu"/>
<separator/>
<menu id="multimedia-menu"/>
<separator/>
<item label="Openbox Configuration Manager">
<action name="Execute">
<startupnotify>
<enabled>
yes
</enabled>
<icon>
openbox
</icon>
</startupnotify>
<command>
obconf
</command>
</action>
</item>
<item label="Customize Look and Feel">
<action name="Execute">
<startupnotify>
<enabled>
yes
</enabled>
<icon>
openbox
</icon>
</startupnotify>
<command>
lxappearance
</command>
</action>
</item>
<item label="Reload Config Files">
<action name="Reconfigure"/>
</item>
<separator/>
<item label="Restart">
<action name="Restart"/>
</item>
<separator/>
<item label="Exit">
<action name="Execute">
<command>
lxsession-logout
</command>
</action>
</item>
</menu>
</openbox_menu>


All times are GMT -5. The time now is 03:01 PM.