Announcement

Collapse
No announcement yet.

different behavior for the dolphin actions

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

    different behavior for the dolphin actions

    Hi,

    I'm using Kubuntu 8.10

    I have just created a couple of actions to be used with Dolphin and noticed a strange behavior.

    When I run Dolphin from the Kmenu my action is available (right clicking on a directory) as desired. However, I also have a Desktop folder in the "plasmoid dashboard" with a link to the most used directories. When I left clik on one of these directories Dolphin runs but I do not see one of my actions.

    I have created two .desktop files (below) and put them in

    /home/user/.kde/share/kde4/services/ServiceMenus

    In detail:

    a) SendWithTB.desktop is always working

    b) OpenTerminal.desktop works only if I run Dolphin by Kmenu. In addition, I would like to have it available on a right click also when pointing to a file and it does not do it

    any help is appreciated.

    best,
    g.

    OpenTerminal.desktop

    Code:
    [Desktop Entry]
    Actions=OpenTerminal;
    ServiceTypes=all/allfiles,inode/directory
    
    [Desktop Action OpenTerminal]
    Name=Open Terminal here
    Exec=konsole
    Icon=konsole
    SendWithTB.desktop

    Code:
    [Desktop Entry]
    Actions=SendWithTB;
    Encoding=UTF-8
    ServiceTypes=all/allfiles,KonqPopupMenu/Plugin
    ExcludeServiceTypes=application/x-iso,kdedevice/*,inode/directory
    Type=Service
    
    [Desktop Action SendWithTB]
    Name=Send File with Thunderbird
    Exec=thunderbird -remote "xfeDoCommand(composeMessage,attachment='file://%U')"
    Icon=attach
    ---------------<br />Linux kernel 2.6.28-15-generic<br />Kubuntu 9.04 64bit KDE 4.2.2<br />Dell Precision M2400 Intel Dual Core 2<br />Nvidia Quadro FX 370M (Driver Nvidia 180.44)<br />HDA Intel (STAC92xx Analog)<br />---------------

    #2
    Re: different behavior for the dolphin actions

    Hmm - there is konsolehere.desktop. It is part of package konsole.

    /usr/share/kde4/services/ServiceMenus/konsolehere.desktop (sniping a bit)
    [Desktop Entry]
    Type=Service
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin,inode/directory
    Actions=openTerminalHere;
    X-KDE-AuthorizeAction=shell_access

    [Desktop Action openTerminalHere]
    Icon=utilities-terminal
    Exec=konsole --workdir %f
    X-Ubuntu-Gettext-Domain=desktop_kdebase
    It is working with the directories. Also the dolphin has terminal option > Topic: Dolphin Terminal - WAY COOL!


    konsole --help tells:
    Usage: konsole [Qt-options] [KDE-options] [options] [args]

    Options:
    ...
    --workdir <dir> Set the initial working directory of the new tab or window to 'dir'
    ...
    Making a new service menu (konsolethere.desktop)
    [Desktop Entry]
    Type=Service
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
    Actions=openTerminalThere;
    X-KDE-AuthorizeAction=shell_access

    [Desktop Action openTerminalThere]
    Name=Open Terminal There
    Icon=utilities-terminal
    Exec=f=%f && konsole --workdir ${f%/*}
    X-Ubuntu-Gettext-Domain=desktop_kdebase
    When right clicking a file it will open a konsole to the file directory.


    Link > Bash/File name manipulation
    Before you edit, BACKUP !

    Why there are dead links ?
    1. Thread: Please explain how to access old kubuntu forum posts
    2. Thread: Lost Information

    Comment


      #3
      Re: different behavior for the dolphin actions

      thanks a lot for your reply. however...

      a) why the konsolehere.desktop file already present in my harddisk (I verified...) does not show up in Dolphin?

      b) I still do not understand why opening Dolphin from the icon of the Desktop folder of the Plasmoid dashboard does not see one of my .desktop files (but it sees the other). maybe a settings somewhere inside the .desktop file? I have also created your .desktop and its behavior is similar to mine, it works if I run Dolphin from the Kmenu but it is not seen if I open via Plasmoid

      best
      g.


      ---------------<br />Linux kernel 2.6.28-15-generic<br />Kubuntu 9.04 64bit KDE 4.2.2<br />Dell Precision M2400 Intel Dual Core 2<br />Nvidia Quadro FX 370M (Driver Nvidia 180.44)<br />HDA Intel (STAC92xx Analog)<br />---------------

      Comment


        #4
        Re: different behavior for the dolphin actions

        sorry for the additional question.

        your .desktop file does work, it open a konsole in the correct directory by right clicking on a file. However, Dolphin always returns an error message:

        Could not find the program '&&'

        I tried to play with the exec line but just messed up all and googleing for this sentence does not give coherent replies.

        What could it be?

        Thanks,
        g.
        ---------------<br />Linux kernel 2.6.28-15-generic<br />Kubuntu 9.04 64bit KDE 4.2.2<br />Dell Precision M2400 Intel Dual Core 2<br />Nvidia Quadro FX 370M (Driver Nvidia 180.44)<br />HDA Intel (STAC92xx Analog)<br />---------------

        Comment


          #5
          Re: different behavior for the dolphin actions

          b) I still do not understand why opening Dolphin from the icon of the Desktop folder of the Plasmoid dashboard does not see one of my .desktop files (but it sees the other). maybe a settings somewhere inside the .desktop file? I have also created your .desktop and its behavior is similar to mine, it works if I run Dolphin from the Kmenu but it is not seen if I open via Plasmoid


          Do you mean plasmoid "Folder view" ?


          Here with the KDE 4.2.

          The "Folder View" is pointing to the /home/rog/Notes, so when i right click > Actions > Open Terminal There... The Konsole will tell:
          rog@ammu2500L:~/Notes$

          your .desktop file does work, it open a konsole in the correct directory by right clicking on a file. However, Dolphin always returns an error message:

          Could not find the program '&&'

          I tried to play with the exec line but just messed up all and googleing for this sentence does not give coherent replies.
          Hmm #1

          That "&&" is (http://www.arachnoid.com/linux/shell_programming.html)
          Here's another scheme commonly seen in shell script programming and interactive sessions:

          $ command1 && command2 && command3 && command4

          This line of code will not run the next command in the sequence unless the prior command has returned "true", meaning no errors. It is a way to avoid running a command if a required prior outcome is not present.

          Hmm #2

          That line:
          Code:
          Exec=f=%f && konsole --workdir ${f%/*}
          should/could be
          Code:
          Exec=f="%f" && konsole --workdir ${f%/*}

          Cli example:

          a) making a text file with spaces at the name (a a.txt)

          b) trying to use
          Code:
          f=/home/rogi/tmp/a a.txt && konsole --workdir ${f%/*}
          => error
          bash: a.txt: command not found
          c) with quatation marks
          Code:
          f="/home/rog/tmp/a a.txt" && konsole --workdir ${f%/*}
          => no problems
          konsole(4065): Attempt to use QAction "change-profile" with KXMLGUIFactory!
          and a konsole pops up:
          rog@ammu2500L:~/tmp$
          Before you edit, BACKUP !

          Why there are dead links ?
          1. Thread: Please explain how to access old kubuntu forum posts
          2. Thread: Lost Information

          Comment


            #6
            Re: different behavior for the dolphin actions

            thanks for your reply, the link you gave for bash commands was quite useful.

            still, if I write from the konsole the command:

            Code:
            x="/home/gianluca/dati/g.ics" && konsole --workdir ${x%/*}
            it works perfectly (it is just an existing file in my hard-disk) but wihtin the .desktop file the command

            Code:
            Exec=x=%f && konsole --workdir ${x%/*}
            still works even if Dolphin pop up an error window concerning the '&&' command.

            it is not crucial, however.

            best,
            g.


            ---------------<br />Linux kernel 2.6.28-15-generic<br />Kubuntu 9.04 64bit KDE 4.2.2<br />Dell Precision M2400 Intel Dual Core 2<br />Nvidia Quadro FX 370M (Driver Nvidia 180.44)<br />HDA Intel (STAC92xx Analog)<br />---------------

            Comment


              #7
              Re: different behavior for the dolphin actions

              ...Dolphin pop up an error window concerning the '&&' command.
              Strange ??


              How about:
              Code:
              [Desktop Entry]
              Type=Service
              X-KDE-ServiceTypes=KonqPopupMenu/Plugin,all/allfiles
              Actions=openTerminalThere;
              X-KDE-AuthorizeAction=shell_access
              
              [Desktop Action openTerminalThere]
              Name=Open Terminal There
              Icon=utilities-terminal
              Exec=konsole --workdir "$(dirname "%f")"
              X-Ubuntu-Gettext-Domain=desktop_kdebase

              man dirname
              NAME
              dirname - strip non-directory suffix from file name

              SYNOPSIS
              dirname NAME
              dirname OPTION

              DESCRIPTION
              Print NAME with its trailing /component removed; if NAME contains no /’s, output ‘.’ (meaning the current directory).

              That - "$(dirname "%f")" - is there to solve spaces in directory names.
              Before you edit, BACKUP !

              Why there are dead links ?
              1. Thread: Please explain how to access old kubuntu forum posts
              2. Thread: Lost Information

              Comment

              Working...
              X