PCManFM Mod - User-Definable Commands And More

The dedicated forum for PCMan File Manager - http://wiki.lxde.org/en/PCManFM
PCMan
Posts: 85
Joined: Mon Oct 06, 2008 9:52 am

Re: PCManFM Mod - User-Definable Commands And More

Post by PCMan »

IgnorantGuru wrote:
phillipe wrote:I only made this question, because if we put a .desktop file on desktop, the application name and the icon aren't showed.
Still, I think keeping gvfs more of a modular dependency would be helpful, with more direct FS access always there as a fallback. Just my thoughts - I don't really know all of what he's trying to accomplish with the new version.
How? Please understand the current situation.
The fact is, there is NO reliable way to work with volume management on Linux. Every single solution you can think of just won't work. If it work, I bet it'll soon stop working again unless you never upgrade your Linux.
1. HAL used to be working, but it doesn't work anymore since incompatible changes are now happening in Linux and it will soon be deprecated. Unless you plan to use old Linux versions and never upgrade your distro, there is no reason to stick with it.
2. DecveKit should replace HAL, but it's a work in progress rather than a real solution.
3. Before finished, DeviceKit is already deprecated and now it's replaced by libudev + udisks.
4. Udisks is also a work in progress. It's not stable and its APIs are changed frequently. The most important, it's already used by many new programs but it does not compatible with HAL.
5. The old mount/umount commands don't work with HAL or udisks. Those three solutions for volume management are totally incompatible with each other.
6. HAL and udisks now require PolicyKit and nobody seems to know how to get it configured correctly. Even worse, documentation is lacking, but it's wide-adopted by modern distros.

If you have a better solution, send me a patch. Otherwise let's face it and use gvfs for now. We can write our own only after the future of Linux desktop gets more clear and things get stablized. Please be realistic. If things all work well, there is no need to rewrite anything. But the fact is, soon the old programs will stop working and we need to get prepare for this earlier.
IgnorantGuru
Posts: 30
Joined: Sat Feb 27, 2010 7:35 pm
Contact:

Re: PCManFM Mod - User-Definable Commands And More

Post by IgnorantGuru »

@PCMan

I agree it is difficult to work with these issues right now, but I think even with gvfs you'll create incompatibilities and other issues in pcmanfm. gvfs is an overly busy approach in itself, so you'll bring all those issues into your FM. This is evidenced by the problems myself and others are having just getting the new pcmanfm to run - I haven't even been able to use it yet, which is not good for a FM. The last time I ran it, it just kept popping up a "mount error" over and over, then a segmentation fault. When I tried to start the program again, it wouldn't even start. I'm not trying to mount anything - I just want to see files that are already mounted, so why am I given a mount error? Something seems very wrong in the approach there, and I think gvfs is to blame.

If you think gvfs is the best solution for volume management, then perhaps it is good to use it. But don't make the whole program dependent on it. For example, if gvfs is not installed, or is not working correctly, then have pcmanfm fall back to more direct FS access. And only use gvfs in very limited ways - if I'm not explicitly trying to mount something, I shouldn't get a mount error. For example, I don't do volume management (mounting/unmounting) with my FM, nor do I access remote URLs in it. I just use my FM to browse folders/files which are already mounted via other methods. I don't need or want that support in the FM, and I certainly don't want that gvfs support to cause many problems when I don't need it in the first place. IOW, why should I not be able to browse a local folder just because I don't have gvfs installed or working? That is broken behavior IMO.

Personally, I think it is a mistake for FMs to get into the business of volume management, precisely because you have to deal with different DEs, HAL, etc. that may be running on the system. Remember the linux credo - "write software that does one thing and does it well". I think trying to make a do-it-all tool for file management and volume management is just going to make the software seem buggy and unreliable, through no fault of yours.

So I would suggest a more modular approach. Get a solid FM working first, then add in optional volume management dependencies for those who want them. You could use a plugin-type approach so that the user can decide what to use - HAL, gvfs, etc. Don't limit pcmanfm to one solution or make it dependent on one solution, because as you observed these solutions are currently unstable and unpredictable. Maybe for now you'll only offer the gvfs solution option, but at least make it an option and not required. I for one have no use for gvfs. I just want a lightweight FM for file management, which is why I'm still using 0.5.2.

Especially for LXDE, I think it is important not to get drawn too deeply into Gnome. As with KDE and other highly developed solutions, it is tempting because of the libraries and such available. But for myself, I am specifically trying to get away from KDE and Gnome by using LXDE and Openbox. If there is no reasonable solution for integrated volume management, then I would say don't do it for now, and let the user decide on mounting solutions separate from the FM.
Check out my blog for useful scripts, mods and tips... http://igurublog.wordpress.com
PCMan
Posts: 85
Joined: Mon Oct 06, 2008 9:52 am

Re: PCManFM Mod - User-Definable Commands And More

Post by PCMan »

PCManFM2 can work perfectly well without gvfs. The errors you saw are caused by trying to do auto-mount, for which there is a new option to turn it off now. The design of GIO should allow working with local files without gvfs. If this is not the case, it's a bug. If you turn auto-mount off, it should work without gvfs. The errors you saw are bugs and they should be reported and fixed. GVFS support has always been optional, except for we need it to do volume management, trash:///, and computer:///.
Without gvfs local file operations still work. At least they work for me. If it doesn't work for you, file a bug report please. It's a small bug which is easy to fix rather than a radical design error or an error of the direction of the project.
Volume management in file manager IMHO is a must-have for usability reason. For those who like to use mount/umount, file managers are not for them. GVFS is a temporary solution. When udisks becomes available, we can write a gio module to solve all of this. Then we can do volume management without gvfs.

But even this is achieved, to circumvant permission problems, you still need policykit. Otherwise many operations won't work as HAL and udisks both honor the configurations of policykit. For now, the only available policykit authentication agents are provieded by gnome or kde. So using one of them is still inevitable. Otherwise you'll encounter permission problems all the time even you use HAL or udisks. This is the current situation. If you want to help, write another one. If existing solution still work well, nobody will want to rewrite them. But the problem is they don't.

I have a quite clear roadmap in my mind and things should be done step by step. New features are not generated from feature requests automatically but are generated from coding by the programmers. Wothout help, nothing can be done in short time.
Later you can see an updated roadmap on http://lxde.org/. I'll post them.
IgnorantGuru
Posts: 30
Joined: Sat Feb 27, 2010 7:35 pm
Contact:

Re: PCManFM Mod - User-Definable Commands And More

Post by IgnorantGuru »

@PCMan

Thanks for the info. I use autofs for auto-mounting CD/DVD and USB sticks, and I have HAL running. However, I wasn't entering any auto-mounted folder when I got mount errors - I was just starting the program. At any rate when I have a chance to try it again I will file a bug report. Last I tried it was before your alpha release.

That said, I think there may be a design issue if gvfs is tripping errors and seg faults when no mount operation is in progress, and trash is not being accessed. The problem here is that as gvfs updates roll in they may create these little bugs in pcmanfm into the indefinite future. As you observed, backwards compatibility is a problem. Thus pcmanfm is going to be dragged along with gnome. The better you can isolate pcmanfm from gvfs and other dependencies the better. It doesn't seem to be behaving that way, but I haven't tested it thoroughly enough to say for sure. As LXDE's default FM, you don't want your main FM crippled by a minor volume management issue in gvfs/gnome, as is apparently happening in your current version. You just want the volume management features crippled in the event of a gvfs problem. It doesn't seem well isolated at this point. But I'll give it another test.

I'll certainly consider contributing some features code if I get the new version running reasonably well.
Check out my blog for useful scripts, mods and tips... http://igurublog.wordpress.com
PCMan
Posts: 85
Joined: Mon Oct 06, 2008 9:52 am

Re: PCManFM Mod - User-Definable Commands And More

Post by PCMan »

More info on how to turn off gvfs and current status of the fm.
https://wiki.ubuntu.com/Lubuntu/SubTeam ... fm2Testing
export GIO_USE_VFS="local" can totally turn off gvfs.
Anything that crashes after this are pcmanfm bugs since gvfs is not involved.
Then you can find how to fix them. It shouldn't be too hard, but I'm now focusing on other parts.
So those minor issues are not handled.
If you're willing to help, you can try to turn off gvfs and find out the bugs.
Volume management should partially work without gvfs. Glib/gio will fall back to /etc/fstab without gvfs.
Besides, g_vfs_is_active() can be used to detect if gvfs is available. Turn off gvfs support is possible but need some coding.

Looking forward to your patches. We can have our own volume management after udisks becomes stable.
IgnorantGuru
Posts: 30
Joined: Sat Feb 27, 2010 7:35 pm
Contact:

Re: PCManFM Mod - User-Definable Commands And More

Post by IgnorantGuru »

Thanks that's good to know how to turn of gvfs. I'll look into that.

I just built the git version and tried it - seems to be working somewhat better than my previous attempts. I'll file a bug report, but just to put it here I keep getting an Error popup that says "mount: I could not determine the filesystem type, and none was specified". This error usually comes up when I first start the program, without changing folders, and then it repeats every few seconds by itself (which makes the program unusable).

Output is

Code: Select all

** (pcmanfm2:1552): DEBUG: try automount
** (pcmanfm2:1552): DEBUG: unable to load icon . GThemedIcon application-octet-stream gnome-mime-application-octet-stream application-x-generic
** (pcmanfm2:1552): DEBUG: try automount
If I click on Trash I get a popup "Operation not supported" (which is understandable - I have no DE just Openbox). But that popup is followed with the error popup above as well.
Check out my blog for useful scripts, mods and tips... http://igurublog.wordpress.com
IgnorantGuru
Posts: 30
Joined: Sat Feb 27, 2010 7:35 pm
Contact:

Re: PCManFM Mod - User-Definable Commands And More

Post by IgnorantGuru »

Also disabling the automount features in Preferences seems to avoid this mount error, unlike previous versions I tested, so that's good news.

It looks like you've added some nice things. I miss the folder tree - hope you're planning to add that. (On that, it would be nice to be able to drag files to the folders in the tree, unlike 0.5.2). Let me know if you want me to submit that as a request.
Check out my blog for useful scripts, mods and tips... http://igurublog.wordpress.com
PCMan
Posts: 85
Joined: Mon Oct 06, 2008 9:52 am

Re: PCManFM Mod - User-Definable Commands And More

Post by PCMan »

As I previously said, this is caused by auto-mount. Turn it off in preference dialog can inhibit this. But I agree this should work better. Also, I'm still thinking about how to rework error handling of pcmanfm2/libfm. This area is quite complicated and it's currently a little bit problematic. After this part gets fixed, we should enter feature freeze.
IgnorantGuru
Posts: 30
Joined: Sat Feb 27, 2010 7:35 pm
Contact:

Re: PCManFM Mod - User-Definable Commands And More

Post by IgnorantGuru »

Personally I think ignoring auto-mount errors would be better, unless it is something the user explicitly initiates. But you're right that turning off the volume management options seems to stop the errors.

This is now looking pretty good so I'd like to begin coding some user-definable commands into it, either as a mod or for your consideration to add it to the official version.
Check out my blog for useful scripts, mods and tips... http://igurublog.wordpress.com
PCMan
Posts: 85
Joined: Mon Oct 06, 2008 9:52 am

Re: PCManFM Mod - User-Definable Commands And More

Post by PCMan »

IgnorantGuru wrote:Personally I think ignoring auto-mount errors would be better, unless it is something the user explicitly initiates. But you're right that turning off the volume management options seems to stop the errors.

This is now looking pretty good so I'd like to begin coding some user-definable commands into it, either as a mod or for your consideration to add it to the official version.
People on freedesktop.org are initiating a new spec for those customized actions. The main author of the new spec is the developer of nautilus actions. Although not all issues are fully resolved, the spec is already quite complete. So my plan is to implement this when it's finished. You can join the mailing list to discuss the spec. This spec is promoted by nautilus actions author, and the main developers joining the discussion are kde developer, wine developer, and me. So this is supposed to be supported by major desktops.

If you're going to do this, I'd suggest refer to this spec and try to conform it as best as you can. Otherwise later when the spec is finished we'll have to rewrite many things to fix compatibility issues. This is why I haven't do this part.
Locked