You are not logged in.

#26 2010-03-12 21:22:39

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

Re: PCManFM Mod - User-Definable Functions

IgnorantGuru wrote:
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.

Thanks Guru, I switched to roxterm not long after making that post. For the past couple of weeks your pcmanfm mod has been working like a charm.

big_smile

Offline

#27 2010-04-03 20:28:21

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

Re: PCManFM Mod - User-Definable Functions

Just wanted to note that pcmanfm-mod is currently affected by the GTK bug referenced here, here, and here, which apparently showed up in the April 1 upgrades.  As described, double-clicks won't work correctly in detailed list view.  So until this is corrected you may want to avoid upgrading to gtk 2-2.20.

Offline

#28 2010-04-21 01:13:58

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

Re: PCManFM Mod - User-Definable Functions

PCManFM-Mod 0.9.6 is available.  This includes a workaround for the GTK 2.20 bug, so double-clicking should work normally in the mod.  This solution should work in general, but if you do still encounter a problem let me know.  I will also be submitting some info in the GTK bug reports which will hopefully allow them to locate the problem.

Also, an LXDE user informed me that pcmanfm-mod caused icons (.desktop files) on the LXDE desktop to display their filenames rather than the app name, if I understood him correctly.  So this update makes a change to this behavior:  if a .desktop file is located in the user's Desktop folder, then it will display the app name rather than the filename (like the unmodded version does).  If the .desktop file is in any other folder, it will display the filename.

Other minor changes:  The About dialog now shows the mod version number; I removed an error message from the installmod script that was confusing some people trying to build it on other distros; I corrected "// MOD" to "//MOD" comments in a few places for consistency in searching for mods in the source.

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

Last edited by IgnorantGuru (2010-04-21 01:14:27)

Offline

#29 2010-04-21 01:23:45

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 997
Website

Re: PCManFM Mod - User-Definable Functions

Quick question, is pcmanfm-mod based on pcmanfm2 (latest git 0.9.4) which uses udisks/gvfs or is it a fork of an "old" one which uses HAL?

Offline

#30 2010-04-21 01:36:44

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

Re: PCManFM Mod - User-Definable Functions

It is a fork of the old one (0.5.2).

Offline

#31 2010-04-24 14:49:16

tri1976
Member
Registered: 2009-09-07
Posts: 152

Re: PCManFM Mod - User-Definable Functions

I'm using version 0.9.6 and it doesn't seem to respect home_folder setting in config file.  Below is the content of my ~/.config/pcmanfm/main file but when I click home it always go to /media.  Is this a bug or am I missing something?  Thanks.

[General]
view_mode=1
terminal=urxvtc
home_folder=/home/tri
no_execute=1

[Window]
width=677
height=835
splitter_pos=160
maximized=0

[Desktop]
[Interface]

Last edited by tri1976 (2010-04-24 14:58:46)

Offline

#32 2010-04-24 15:24:14

xamaco
Member
From: Corsica, France
Registered: 2010-04-05
Posts: 87

Re: PCManFM Mod - User-Definable Functions

Great job. I've adopted it. Thanks.

Offline

#33 2010-04-24 15:30:43

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

Re: PCManFM Mod - User-Definable Functions

tri1976 wrote:

I'm using version 0.9.6 and it doesn't seem to respect home_folder setting in config file.  Below is the content of my ~/.config/pcmanfm/main file but when I click home it always go to /media.  Is this a bug or am I missing something?  Thanks

I can't explain that behavior - your config file looks okay.  FYI, only the menu item Go|Home (Escape key shortcut), and the home icon in the toolbar are affected by the home_folder setting.  For other purposes, pcmanfm-mod (like pcmanfm) uses whatever it determines to be your home folder.  Its failsafe is to use /media.

These may sound too simple, but sometimes it's good to verify the simple things first.  First, make sure you are actually running the modded version (check Help|About).  Second, make sure home_folder is still in your 'main' file - if you run the unmodded version of pcmanfm, it will remove that line because it doesn't recognize it.  And you also have to close all running instances of pcmanfm-mod, then edit the 'main' file, then start it.  Otherwise the entry may be ignored and removed.

For testing, if you set home_folder to an invalid folder, you should get an invalid directory error pop-up message when you use Go|Home.  Also, does the no_execute=1 setting seem to be working?  If you click on executables are they executed?

The home_folder part of the code isn't very complex so I don't see what could be causing a problem aside from the issues above.

Offline

#34 2010-04-24 20:57:28

tri1976
Member
Registered: 2009-09-07
Posts: 152

Re: PCManFM Mod - User-Definable Functions

home_folder issue solved.
I think after I reboot the computer or logout, it works.  I think the problem was I ran pcmanfm -d on startup, so the change didn't go into effect until pcmanfm daemon restart.
Great mod.  I would just like to ask for the next release, please consider adding keybinding for open terminal and the ability to hide unused custom user commands.

Offline

#35 2010-04-24 23:09:37

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

Re: PCManFM Mod - User-Definable Functions

Earlier in this thread there was some discussion of integrating this mod's features into the newer version of pcmanfm2, so I thought I would bring everyone up to date on what's being done there, and also clarify some of the various versions of PCManFM that are available.

Versions:
The original pcmanfm (version 0.5.2, which is currently "pcmanfm" in Arch's extra repo) is frozen and is no longer being maintained by the original author.  This version uses HAL for mounting.

My pcmanfm-mod is a fork of the original pcmanfm 0.5.2.  It is available in the AUR as pcmanfm-mod (installs from the AUR as /usr/bin/pcmanfm).  The current version of pcmanfm-mod is 0.9.6.

Third, the original author (Hon Jen Yee aka PCMan) is in the process of rewriting the program, which is currently in alpha testing I believe.  This rewrite is sometimes referred to as "pcmanfm2", although its current version number is 0.9.4.  The current git test version of it is available as pcmanfm-git (installs as /usr/bin/pcmanfm2).  This version uses GVFS for mounting and volume management.

When testing, note that all of the above programs use ~/.config/pcmanfm as their config folder, so you may want to backup that folder before testing different versions.


Regarding custom user commands, PCMan has said that he does intend to add this to the new version.  He is or was waiting for standards on this to be solidified by the author of Nautilus.

Below is a list of current changes and fixes incorporated into pcmanfm-mod:

MODIFICATIONS (PCMANFM-MOD 0.9.6):

1)  Adds five user-definable commands to the right-click and Tools
    menus (and keys F4, F6-F9).  The menu names and commands are
    derived from .desktop files.  When run, all selected
    files are passed to the command.  (see NOTES below)

2)  An example opener script is included as the default F4
    user command, which opens all selected files. (see NOTES below)

3)  A "Run Command..." (Ctrl-R) has been added to the Tools and
    right-click menus.  This allows the user to run an
    arbitrary command line, include %U to insert all selected
    files into the command, and optionally run the command
    in a terminal to see the output.

4)  When a single symlink is selected, its target and target's
    size are displayed in the status bar

5)  A "Paste as Link" command has been added to the edit menu and
    Ctrl-Shift-V to paste links to files on the clipboard

6)  The default home folder can be set in the main config file
    (see NOTES below)

7)  "no_execute" can be set in the main config file to prevent
    launching of executables (see NOTES below)

8)  A different program icon is used when in super user mode

9)  The Go|Home key is changed from Alt-Home to Escape

10) The default button on the delete dialog is changed to Yes

11) When enter is pressed in the Rename/Overwrite dialog, rename is
    assumed

12) Ctrl-F is assigned to Create New Folder instead of search
    (pressing any normal key still initiates a search)

13) The F5 Refresh function has been improved

14) .desktop files display their actual filenames rather than name,
    except in the user's Desktop folder

15) File list is given focus when a dir is entered or a new tab added

16) Copying and pasting a single folder into its own parent now
    asks for a new name rather than attempting to copy the folder into
    itself.  Pasting a folder into a selected folder no longer works.

17) Bugfix: Right-clicking on a dangling sym-link now displays menu

18) Bugfix: A bug which prevented opening multiple folders on the
    pcmanfm command line has been corrected

19) Bugfix: Fixed error message on create new folder cancel

20) Bugfix: Fixed syntax errors in ca.po to prevent make error

21) Bug Workaround: A bug in GTK 2.20 which prevented double-clicking
    should not affect pcmanfm-mod 0.9.6 and later

The Run Command (#3 above) has been partially implemented in pcmanfm2, as shown in this screenshot.  This is provided off of the Open With... menu item.  The command line entered can be permantently associated with a file type.  However, in testing it I could not get the "Execute in terminal emulator" to open a terminal - perhaps this is still in devel.  Also, unlike pcmanfm-mod, there is no keyboard shortcut for this (Ctrl-R).

While there are no custom user commands per se, the above "Command line to execute" can be used to associate a program or command with a file type, and it will appear on the right-click menu.  This is one way that people used to add custom commands to pcmanfm, so that has been automated a bit.  Disadvantages are that there is no way to associate keyboard shortcuts with the custom command, and the custom command must be associated with file types.  I believe the author intends to implement a more robust means of adding custom commands, but this is a start.

#10, #11, #16, #17, #18, #19, #20, and #21 have now been implemented in pcmanfm2.  (The current git version today did not suffer from the GTK bug (#21) in my tests, so I believe it has been patched to workaround the problem.)

While #4 has not been implemented in pcmanfm2 thus far, you can now see the link target in the Properties window, providing you make the window wide enough.

He refused to implement #14, so he prefers it the way it is.

Other features of pcmanfm-mod have not been implemented, but some of the feature requests I submitted on them are still open.

Aside from the current lack of custom user commands, other drawbacks for me include the fact that there is no Directory Tree side pane implemented.  I don't know whether this is still in progress or whether he plans to omit it from this version, but I have seen others request it.  Also, there is no Refresh function at all, which I find is still needed in some cases.  Perhaps that too is in progress.  I also had some problems with the auto-mounting features, but disabling them in Preferences avoided them - I don't really use the mount features anyway.

If you have feature requests for pcmanfm2, I suggest submitting them  or commenting on existing requests while the program is still in its early stages.

For now, I am still using and maintaining pcmanfm-mod.  Once pcmanfm2 is stable, I may mod it with a few things, but first I'll wait to see what the author includes, and how he implements custom commands.

Offline

#36 2010-05-04 03:11:08

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

Re: PCManFM Mod - User-Definable Functions

Another user-definable command option for pcmanfm-mod:
http://igurublog.wordpress.com/downloads/script-permz/

Offline

#37 2010-05-05 18:39:54

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

Re: PCManFM Mod - User-Definable Functions

pcmanfm-mod v1.0.0 is available, with the following changes:

* permissions now show the sticky bit

* added keyboard shortcut Ctrl-S for Open Terminal

* unassigned user commands not shown in menus

* Refresh function now reloads even if busy

* the AUR package will now not install pcmanfm-mod.desktop (since the AUR pkg installs it as pcmanfm)

A note on unassigned user commands:  For example, to prevent the F6 user command from showing on the Tools and right-click menus, delete both /usr/share/applications/pcmanfm-user-f6.desktop and ~/.local/share/applications/pcmanfm-user-f6.desktop (if you created it).  The right-click menu will update immediately, but for changes to appear in the Tools menu, you need to restart all instances of pcmanfm(-mod).

Also, pcmanfm-mod is now hosted at Sourceforge: pcmanfm-mod, although the instructions and download links are still on my blog.

Offline

#38 2010-05-14 21:48:56

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

Re: PCManFM Mod - User-Definable Functions

I was asked how to add "Send As Email" to the right-click menu in PCManFM-Mod, so I thought I would reply here in case others want to know.

First, for resizing and emailing jpeg files in one step I recommend the repic method.

For other files, edit one of the user commands, such as /usr/share/applications/pcmanfm-user-f8.desktop so it runs your email client in attachment mode.  For example for Claws-mail:

[Desktop Entry]
Name=Send As Email
Exec=claws-mail --attach
StartupNotify=false
Terminal=false
NoDisplay=true

OR for KMail:

[Desktop Entry]
Name=Send As Email
Exec=kmail --composer --attach
StartupNotify=false
Terminal=false
NoDisplay=true

Other email clients should have a similar feature - check their man page.  For Claws, the above will work for single as well as multiple files.  For kmail, if you want to be able to email more than one selected file at a time, each file spec must be preceded by "--attach", so you will need to have your user command run a custom script such as:

#!/bin/bash
while [ "$1" != "" ]; do
    attaches="$attaches --attach \"$1\""
    shift
done
eval kmail --composer $attaches &

Offline

#39 2010-05-14 22:05:18

bruno321
Member
Registered: 2010-03-05
Posts: 89

Re: PCManFM Mod - User-Definable Functions

Thank you! I use Claws-Mail and that worked flawlessly.

Offline

#40 2010-05-18 00:46:10

bruno321
Member
Registered: 2010-03-05
Posts: 89

Re: PCManFM Mod - User-Definable Functions

There's another thing I would like to see in the right-click menu:

Currently, the "extract" option for packed files is available at least for zip and tar. But I also frequently use .rar and .7z files, and the "extract" option isn't shown for those file types. Couldn't it be implemented?

Thank you

Offline

#41 2010-05-18 01:06:22

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

Re: PCManFM Mod - User-Definable Functions

bruno321 wrote:

There's another thing I would like to see in the right-click menu:

Currently, the "extract" option for packed files is available at least for zip and tar. But I also frequently use .rar and .7z files, and the "extract" option isn't shown for those file types. Couldn't it be implemented?

Thank you

I'm glad you mentioned it because I did write a script called xtract for my own use which does just this, but I wasn't sure if anyone would have a use for it.  When I get home later this month I will look at adding it to my site.  I probably won't add it to the mod's internals, but it can be configured as a user command on the right-click menu.

Offline

#42 2010-05-18 01:15:33

bruno321
Member
Registered: 2010-03-05
Posts: 89

Re: PCManFM Mod - User-Definable Functions

Thank you! I'll wait for that script then.

Another thing: I'm trying to use mediainfo on the right-click menu, but I have a little problem. I use:

[Desktop Entry]
Name=MediaInfo
Exec=xterm -e mediainfo
StartupNotify=false
Terminal=true
TerminalOptions=


but since mediainfo is an app which just "displays" things (it does not wait for an input), xterm closes as soon as it opens. How can I get it to stand by? I can't read the information as it is...

Thanks again.

Offline

#43 2010-05-18 01:44:58

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

Re: PCManFM Mod - User-Definable Functions

bruno321 wrote:

Another thing: I'm trying to use mediainfo on the right-click menu, but I have a little problem. I use

I think you'll need to run a script to do that.  eg

#!/bin/bash

eval xterm -e \'mediainfo \"$1\" \&\& echo Press enter... \&\& read s\'

Save that script as /opt/scripts/mymediainfo, for example, then set the desktop file's Exec=/opt/scripts/mymediainfo

Offline

#44 2010-05-19 21:43:14

bruno321
Member
Registered: 2010-03-05
Posts: 89

Re: PCManFM Mod - User-Definable Functions

That worked fine, thank you! As a comment for anyone who's interested: the script you create has to be made executable (I hadn't at first and the option would do nothing).

Offline

#45 2010-05-20 01:50:22

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: PCManFM Mod - User-Definable Functions

IgnorantGuru wrote:
bruno321 wrote:

Another thing: I'm trying to use mediainfo on the right-click menu, but I have a little problem. I use

I think you'll need to run a script to do that.  eg

[snip]

Use "output-only-command |xmessage -file -" (with xorg-apps installed).  You may also want to install and learn to use the gxmessage package, which provides a GTk-based equivalent of xmessage.

Offline

#46 2010-05-20 15:37:10

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

Re: PCManFM Mod - User-Definable Functions

Use "output-only-command |xmessage -file -" (with xorg-apps installed).  You may also want to install and learn to use the gxmessage package, which provides a GTk-based equivalent of xmessage.

That's another way of doing it in the script, or you could use zenity --info, but I don't believe that will work on the Exec= line directly because the filespec needs to be inserted into the "output-only-command" portion before the redirection.  That was why I suggested the script approach.  Maybe redirecting stdin would work but I don't know if Exec= handles redirection at all.

Also, thanks for your AUR comments - I'll get to that within a week or so.

Offline

#47 2010-05-20 16:32:03

rransom
Member
Registered: 2010-04-26
Posts: 92

Re: PCManFM Mod - User-Definable Functions

IgnorantGuru wrote:

Use "output-only-command |xmessage -file -" (with xorg-apps installed).  You may also want to install and learn to use the gxmessage package, which provides a GTk-based equivalent of xmessage.

That's another way of doing it in the script, or you could use zenity --info, but I don't believe that will work on the Exec= line directly because the filespec needs to be inserted into the "output-only-command" portion before the redirection.  That was why I suggested the script approach.  Maybe redirecting stdin would work but I don't know if Exec= handles redirection at all.

If mediainfo can only handle one file at a time, use the following:

TryExec=mediainfo
Exec=mediainfo %f |gxmessage -file -

(I've read the gxmessage man page now, and it uses the same -file option as xmessage does.)

If mediainfo can handle multiple files at a time, use "%F" instead of "%f".

For the list of all available %X codes, install freedesktop-docs and read the following: file:///usr/share/doc/freedesktop.org/d … -variables

Offline

#48 2010-05-20 17:48:34

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

Re: PCManFM Mod - User-Definable Functions

I don't believe %f and so forth will work because of the non-standard way that pcmanfm-mod uses the user command desktop files.  I'm not sure though - I don't have the source handy at the moment but it won't hurt to try in any case.

Last edited by IgnorantGuru (2010-05-20 17:49:26)

Offline

#49 2010-05-30 18:25:28

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

Re: PCManFM Mod - User-Definable Functions

bruno321 wrote:

Currently, the "extract" option for packed files is available at least for zip and tar. But I also frequently use .rar and .7z files, and the "extract" option isn't shown for those file types. Couldn't it be implemented?

I have now added my xtract script to my site.  This can be set as a user command in PCManFM-Mod or simply set as the default application for archives.  By default, an archive is extracted into a subfolder of the same name. Or, Xtract can prompt you for the destination or destination parent.

xtract version 1.0.0
Decompresses and extracts archives.  Designed for file manager integration.
Requires:    zenity
Recommended: gzip xz-utils unzip bzip2 p7zip unrar
Recognized filetypes: .gz .bz2 .7z .xz .txz .tgz .zip .ZIP .rar .RAR
                      .iso .ISO .tar .tar.gz .tar.xz .tar.bz2 .tar.7z
Usage: xtract [OPTIONS] ARCHIVE ...
OPTIONS:
--inter         use interactive dialog for destination folder - all
                  archives are extracted to this one folder
--inter-name    use interactive dialog for destination parent but
                  still use auto-named subfolders.  Default if current
                  user has no write permission.
--write         after extraction make ALL files in destination folder(s)
                  user writable ( chmod -R u+rwX )
                  This option is ignored if running user is root

http://igurublog.wordpress.com/downloads/script-xtract/
http://aur.archlinux.org/packages.php?ID=37686

Offline

#50 2010-05-31 00:47:58

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

Re: PCManFM Mod - User-Definable Functions

I have also updated the example chooser script so that it can now create three kinds of archives as well as a few other functions...

screenshot-chooser.png

Offline

Board footer

Powered by FluxBB