Announcement

Collapse
No announcement yet.

context menu desktop entry set working directory to that of file

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    context menu desktop entry set working directory to that of file

    In dolphin, if you double click a file name, or right click and select Open with ... something, the "desktop entry" .desktop file is used to start whatever programme is needed. If you right click the file, select Properties, click File Type Options, you can edit the desktop entry and on the Application tab specify the "Work Path" for the action.

    I can't find a simple way to use the directory of the file being opened. With this blank my home directory is used.

    This is governed by Desktop Entry Specification, but KDE have extended that a little, at least in that the .desktop file can have "Path[$e]=" instead of just "Path=", to cause environment variables to be expanded for the entry. I can find no specs for these KDE extensions; googling for "desktop entry path kde" does not tell me, there's too many tangents possible with those search terms. Does anyone know where the KDE extensions might be documented?

    Now one can change the command to
    Code:
    cd %d;[I]whatever[/I] %F
    and that works, but %d is deprecated and undocumented, and
    Code:
    x="%f";cd "${x%/*}";[I]whatever[/I] %F
    works too, but the spec says one should have only one of %f, %F, %u or %U appearing in the command, and that only once. I could also use a wrapper shell script to achieve the same.

    But it should be simple, and is expected by those moving from Windows and OS X.

    Regards, John Little
    Regards, John Little

    #2
    See Desktop Entry Specification
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Snowhog, if you'd read my post more closely, you would have seen that I gave exactly that link in it.

      Regards, John Little
      Regards, John Little

      Comment


        #4
        Dang!

        Well, at least we are of like mind in this issue.
        Using Kubuntu Linux since March 23, 2007
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment

        Working...
        X