You are not logged in.

#1 2010-02-18 01:56:56

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

PCManFM Mod - User-Definable Functions

After dropping KDE completely I've been shopping for a good file manager.  I decided to use PCManFM, but it has no custom user actions.  It does now.  smile  Works pretty well and is very flexible.
http://igurublog.wordpress.com/downloads/mod-pcmanfm/

Offline

#2 2010-02-18 03:20:01

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: PCManFM Mod - User-Definable Functions

I loved nautilus-actions during my time in Gnome/Ubuntu, so this seems pretty cool. From the readme it doesn't look like you can add arbitrary commands to the right-click menu, do you think you could add this feature? Also, are you going to support pcmanfm2, and are you talking to upstream?

Offline

#3 2010-02-18 13:40:46

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

aeosynth wrote:

I loved nautilus-actions during my time in Gnome/Ubuntu, so this seems pretty cool. From the readme it doesn't look like you can add arbitrary commands to the right-click menu, do you think you could add this feature? Also, are you going to support pcmanfm2, and are you talking to upstream?

I may add the same F4-F9 commands to the right-click menu... I'll look at how involved that is.  Everything I do with this code ends up taking me much longer than I expect.

I looked at v2 but it seemed too wet behind the ears yet.  The Prefs dialog was incomplete and I had some other functional issues, so I decided to stick with 0.5.2 for now.  It's also easier to mod a static version.  But I'll keep an eye on v2 and plan to eventually port these changes.  I may drop the author a line and let him know my preferences, and also address a few race conditions I encountered in the 0.5.2 code that still seem to exist in 2, but from what he said on his webpage he may not want user commands.  He probably would have added them by now if he did.  But I'll make an argument for them.  You could drop him a line too and let him know.  He wants to keep it basic but I think just a few user commands improves it quite a bit.  It's really a nice FM with a lot of functionality while still being clean and uncluttered.

On mine, F4 opens given MIME types with the programs I set in the script, and F6 now opens them as root (except media files which it opens as user.  I didn't include that in the example script but it's not much to add.  I'm really pleased with this FM now.

Offline

#4 2010-02-18 21:40:19

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: PCManFM Mod - User-Definable Functions

Is your blog down?

Offline

#5 2010-02-18 21:55:29

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

kaptenen wrote:

Is your blog down?

It would seem it is - in fact all of wordpress seems to be.

I'm working on some significant improvements at the moment, so check back in a day or so.

Last edited by IgnorantGuru (2010-03-13 03:48:31)

Offline

#6 2010-02-18 23:22:54

aeosynth
Member
From: California
Registered: 2010-02-06
Posts: 115
Website

Re: PCManFM Mod - User-Definable Functions

Don't you think that it would be easier to get your changes accepted while the next-gen pcmanfm is under active development?

PCMan wrote:
Last but not the least, developers are wanted! Please join us if you like LXDE and you know gtk+ and gio programming in C language.

Maybe you could figure out a generic way of adding extensions to pcfm, and then package your mod as an extensions.

Last edited by aeosynth (2010-02-18 23:24:14)

Offline

#7 2010-02-18 23:49:14

jorpheus
Member
Registered: 2008-11-07
Posts: 98

Re: PCManFM Mod - User-Definable Functions

I hope this gets accepted upstream.

Offline

#8 2010-02-19 03:33:27

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

My plan is to make a few mods to 0.5.2 so I can use it as my main FM - which I am already.  I did a lot on it today and am just about done - fixed a few bugs and added some more functionality.  Once I get done what I want then at some point I plan to take a look at the git v2 and see what I want to do.

I also spoke to the author and he was very receptive and welcomed contributions.  He's finishing up his rewrite.  I may ask him to take a look at the 0.5.2 mod at some point so he can see the features in action, and then see what he'd like.  Or, I may just patch the git version so he can see it that way. 

Today I...
    fixed syntax errors in ca.po to prevent make error
    changed default button on delete dialog to Yes
    fixed error message on create new folder cancel
    improved F5 Refresh function
    added user commands to right-click menu
    renamed F4 command from "Open Files" to "User Open Files" in Tools menu
    fixed multiple instance -t opening of tabs
    added uninstall instructions to README
    added enter callback signal on rename/overwrite dialog
    changed Ctrl-f to Create New Folder

And I just finished adding "Run Command" (Ctrl-r) to allow running an arbitrary command, with the option to run it in a terminal, and with the ability to include %U to insert all selected files into the command.  I just need to sort out one issue there and add it to the menus.  Then I want the rewrite the User Commands function so it probably won't use the opener script anymore - I now see a better way to do it.  That's about all I plan to do with 0.5.2.

None of the above is available yet but I'll make an announcement shortly when I get it finished.

Last edited by IgnorantGuru (2010-02-19 03:36:41)

Offline

#9 2010-02-19 21:07:20

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

Okay I have posted the update and also put it on the AUR.  Please let me know if there are any problems with either install method.  The AUR version currently conflicts with the normal pcmanfm  - I wasn't able to resolve that immediately, and may not.  If you want to install it as /usr/bin/pcmanfm-mod so it can co-exist with /usr/bin/pcmanfm, I recommend using the installmod method in the README - that is how it installs it by default.

The only known issue I'm aware of is that the Run Command may have some difficulty with odd characters.  In fact none of the commands will work on a file that has a double "\\" in the file name.  This is unavoidable the way it's currently done.  If you encounter any other characters that give it trouble let me know and I'll see if I can do anything about it.  If you are running a command with regexes you may just want to run bash in a terminal and do it from there.  But for most purposes the Run Command should be handy.

That's about all I plan to do with this mod of 0.5.2 (unless I change my mind), but if anything doesn't work correctly please let me know.  I'm using this regularly now as my main FM, so I should encounter most of the problems.  smile

http://igurublog.wordpress.com/downloads/mod-pcmanfm/

Offline

#10 2010-02-20 13:47:02

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: PCManFM Mod - User-Definable Functions

Nice work, but I don't like how nothing is focused by default when entering a new directory. Horrible for keyboard navigation. You should fix that.

Offline

#11 2010-02-20 14:10:04

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

JohannesSM64 wrote:

Nice work, but I don't like how nothing is focused by default when entering a new directory. Horrible for keyboard navigation. You should fix that.

AFAIK I didn't change anything related to that, so that's probably inherited from 0.5.2.  On my system, when I run pcmanfm-mod, nothing appears to have focus, but if I press down arrow then the selection moves down the file list - no problem navigating with KB.  If I open more than one folder on the command line (pcmanfm-mod /tmp /var) then the first file in /var will have focus.  IOW adding an additional tab gives the first file in the new tab focus.  So you could alternately start it and press Ctrl-T.

I'm using Openbox so maybe the behavior varies with WM.  Anyway I made a note and next time I'm in the code I'll take a quick look.

Offline

#12 2010-02-20 15:03:35

JohannesSM64
Member
From: Norway
Registered: 2009-10-11
Posts: 623
Website

Re: PCManFM Mod - User-Definable Functions

My point is that if I want to select the first entry, enter it, and repeat 2 times, I have to press down return down return down return instead of return return return. I know this isn't related to your changes to the app but since you're already modding it you should change this

Last edited by JohannesSM64 (2010-02-20 15:04:26)

Offline

#13 2010-02-23 03:20:18

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

Version 0.9.2 of this mod is available.  I took another look at the current git version of pcmanfm(2) - the rewrite.  I had a lot of problems with it - kept giving me a mount error, then seg faulted and wouldn't run again.  That is under very heavy dev right now so I've decided to stick with my mod of 0.5.2 stable.  But I will keep an eye on how the git is progressing.

I've fixed a few issues I encountered over the last few days, JohannesSM64's focus issue, and a few other minor rearrangements.  For one, in 0.5.2 when you copy a single folder to the clipboard, then attempt to paste it into the same parent, it complains that source and dest are the same because there was a little code in there that tries to paste it into the selected folder instead of the current folder.  As this is contrary to how file managers generally handle this, I disabled that code so that instead you are prompted for a new name for the folder.  If anyone wants this the way it was, let me know and I'll tell you where that code is so you can re-enable it.  Personally, I found it highly annoying.

Also I changed the Go|Home key from Alt-Home to Escape.  If you want to change it back let me know - it's a quick change in the source.

And I made the Run In Terminal command leave an interactive shell at the end, which I think is handier than the "Press Enter to close" I had in the prior mods.  You can then just close the terminal window or type exit.

I also restored Tools|Open In Terminal - I know the code better now and there was no reason to hijack that function so I moved my code elsewhere.

And a few other things as detailed below.

0.9.2:
    modified About dialog to indicate it is a modified version

    .desktop files display their actual filenames instead of name

    focus in file list after change directory and new tab

    Go|Home now Escape key instead of Alt-Home

    right-click on dangling symlink now displays popup menu

    copy/paste folder prompts for new name; no paste to selected

    rewrote str_replace used by Run Command without static buffer

    Run and Run In Terminal now have alt shortcut keys R & T

    Run In Terminal now terminates with open bash shell

    restored Open In Terminal to Tools and right-click menus

    installmod script now won't overwrite existing .desktop files
      or /usr/bin/pcmanfm-opener

http://igurublog.wordpress.com/downloads/mod-pcmanfm/
http://aur.archlinux.org/packages.php?ID=34819

Offline

#14 2010-02-24 17:01:30

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

It turns out I introduced a bug in the 0.9.2 mod...  I left in a diagnostic return I had added which caused a function to terminate prematurely, which is why the right-click "Open With..." submenu and "Open with <app>" wasn't displayed.  I have corrected that so please update to 0.9.3.

http://igurublog.wordpress.com/downloads/mod-pcmanfm/
http://aur.archlinux.org/packages.php?ID=34819

Offline

#15 2010-02-25 02:00:45

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

I have added two examples to the instruction page for PCManFM-Mod.  The first shows how to use my recently re-written repic script to add a command in PCManFM to resize all selected pics.  The script asks what size to resize them to, and can also put them into a Claws or KMail email message, as well as other options.

The second example uses a chooser script to ask the user what is to be done with the selected files (via a Zenity dialog). The example chooser script can create a tar.gz archive containing all the selected files and folders, or can simply open all the items with xdg-open. This chooser script is intended to be customized with any additional functions you want to add. By using a chooser script, you can extend the five user-definable commands which PCManFM-Mod includes to perform an unlimited number of functions.

Example: Resize Selected Pics
Example: Multi-Function Chooser And Archiver

Offline

#16 2010-02-25 02:22:59

SoleSoul
Member
From: Israel
Registered: 2009-06-29
Posts: 319

Re: PCManFM Mod - User-Definable Functions

I just wanted to say that we are interested in your work even though we don't post.
Thank you very much for your work and for the info you get from PCMan about the next version of the FM.

Offline

#17 2010-02-25 02:30:42

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

My pleasure - thanks for the ping.  smile

Offline

#18 2010-02-26 21:17:18

miau
Member
Registered: 2009-05-06
Posts: 202

Re: PCManFM Mod - User-Definable Functions

Thanks for your mod. Could you modify PCManFM that it doesn't move to the first entry of a file list when a folder is renamed?

Offline

#19 2010-02-27 01:08:33

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

miau wrote:

Thanks for your mod. Could you modify PCManFM that it doesn't move to the first entry of a file list when a folder is renamed?

Although this sounds like a simple thing it's actually probably quite involved.  I probably won't get into this, but if I do work on that part of the code at some point, I'll keep it in mind.  You're right, that's how it should work.

Offline

#20 2010-02-27 19:32:02

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

PCManFM Mod has been updated to version 0.9.4.  One fix and several new features:

The last two versions had a pop-up error when changing to a folder via the Bookmarks menu.  This was a diagnostic pop-up I forgot to remove.

I have added a "Paste as Link" command to the Edit menu (Ctrl-Shift-V).  This pastes links to the files on the clipboard rather than the files themselves.  (Same as dragging and dropping files while holding down Ctrl and Shift.)

If only a single file is selected, and that file is a symlink, the status bar will now show the link's target and the target's size.  This is a much needed ability in PCManFM since even the Properties dialog does not provide this info.

The default home folder (only as used by the Go|Home command or toolbar Home button) can now be set manually by editing the config file.  In the [General] section of ~/.config/pcmanfm/main, add home_folder=FOLDER   If there are other functions in the program that you think should use this setting for home folder, you can let me know what they are (please be as specific as possible). 

Execution of executables can now be disabled by adding no_execute=1 to the [General] section of ~/.config/pcmanfm/main   With this in place, double-clicking on an executable will no longer launch it (but will open it with an associated application).

For the above two items, be sure to edit ~/.config/pcmanfm/main while PCManFM is not running (or the changes will be overwritten).  Also, if you run the normal version of PCManFM, it will remove these entries from your config file.

The program icon for PCManFM will now be an orange "last-saved-search" folder icon when run in super user mode.  I added this because sometimes I have both a regular and an SU PCManFM running, and its handy to be able to tell which is which in the taskbar.  The choices for icons was very limited (PCManFM uses gnome icons).  The orange search folder was bright and reasonably appropriate.  If you feel this is a bad choice and have a better suggestion, let me know.  Just limit your choices to common gnome icons (since we don't know what theme the user might be using).  If you feel this icon should not be changed you can tell me that too and I'll consider removing it from the mod.  Also, if you want to change the icon yourself, in main-window.c search for "//MOD icon root user" and you'll see where to set it before you make.

That's all the changes in this update.

http://igurublog.wordpress.com/downloads/mod-pcmanfm/
http://aur.archlinux.org/packages.php?ID=34819

Offline

#21 2010-02-27 22:20:08

kaptenen
Member
Registered: 2009-12-06
Posts: 287
Website

Re: PCManFM Mod - User-Definable Functions

Awesome work!

Offline

#22 2010-02-28 13:25:49

Nixie
Member
Registered: 2008-09-24
Posts: 51

Re: PCManFM Mod - User-Definable Functions

I decided to try out pcmanfm-mod yesterday and think I've found a bug (or it could just be me)

When I use the Run Command... for something like lxsplit it will not Run In Terminal if I have lxterminal selected in the preferences (it will still split or join files from the Run Command if I just run it not in terminal)

If I switch to xterm in pcmanfm's preferences then lxsplit does run in a terminal. Same goes for other commands I tried like htop.

Offline

#23 2010-03-03 00:34:59

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

Nixie wrote:

I decided to try out pcmanfm-mod yesterday and think I've found a bug (or it could just be me)

When I use the Run Command... for something like lxsplit it will not Run In Terminal if I have lxterminal selected in the preferences (it will still split or join files from the Run Command if I just run it not in terminal)

If I switch to xterm in pcmanfm's preferences then lxsplit does run in a terminal. Same goes for other commands I tried like htop.

I'll have a look - thanks.  I didn't test it with lxterminal so maybe there's a compatibility issue.  I'm currently using roxterm.

Offline

#24 2010-03-03 00:49:45

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

@Nixie
The problem appears to be that lxterminal requires its -e argument to be quoted, which isn't going to work with the way the mod calls it, since it needs to quote the bash command.  For example, xterm and roxterm accept this:

roxterm -e bash -c "ls ; bash"

Everything following the -e is considered part of the command, and bash requires the command to be quoted.  lxterminal breaks with tradition in requiring the -e argument quoted, which is very limiting.

Not sure there's much I can do about this, at least with the current way the mod calls the terminal.  But I'll make a note on the website that lxterminal won't work for now.  Thanks for pointing it out.

Offline

#25 2010-03-03 14:33:48

IgnorantGuru
Member
Registered: 2009-11-09
Posts: 640
Website

Re: PCManFM Mod - User-Definable Functions

Update 0.9.5 mostly fixes the problem with lxterminal in the Run In Terminal command.  When using lxterminal or gnome-terminal (both of which require their -e argument to be quoted) you can't use single quotation marks (') in the command, or it probably won't work.

These terminals should work okay with Run In Terminal: roxterm, aterm, konsole, xterm, Eterm.

xfce4-terminal and other terminals that don't support -e probably won't work at all.  (I didn't try xfce4-terminal but its man page online didn't list -e.)

Offline

Board footer

Powered by FluxBB