Announcement

Collapse
No announcement yet.

Touch Action in Dolphin

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

    Touch Action in Dolphin

    Touch Dolphin action:
    Why touch anything - if it works?

    As you know, the touch command makes a file/directory get the current timestamp.
    So, why would one want to do that?
    Many possible reasons, for example if you sort things by date, it moves it to the top... etc.

    Why would you want a "touch" action in Dolphin?
    Well, maybe you use it often, and the file/directory name is 123 characters long, it's got spaces in it... you know.

    So I made a .desktop.
    Save it as touch.desktop (or whatever.desktop) in ~/.local/share/kservices5/ServiceMenus/ (or wherever you keep them).
    Code:
    [Desktop Entry]
    Type=Service
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin
    MimeType=text/plain;inode/directory;
    Actions=touch;
    Encoding=UTF-8
    Icon=application-x-cd-image
    
    [Desktop Action touch]
    Name=Touch
    Icon=edit-redo
    Exec=touch %f; kdialog  --title="Touch" --passivepopup="Touched";fi
    I also made a sudo touch one, for touching things in protected places.
    I know what you dirty-minded ones are thinking , but I mainly use it for touching kernels in /boot, as some kernel updates confuse rEFInd.

    sudotouch.desktop :
    Code:
    [Desktop Entry]
    Type=Service
    X-KDE-ServiceTypes=KonqPopupMenu/Plugin
    MimeType=text/plain;inode/directory;
    Actions=stouch;
    Encoding=UTF-8
    Icon=application-x-cd-image
    
    [Desktop Action stouch]
    Name=Sudo touch
    Icon=edit-redo
    Exec=pkexec touch %f; kdialog --title="Touch" --passivepopup="Touched";fi
    Only problem with it, I haven't found a way to make the password popup "persistent" (like sudo in a terminal), but it's probably still better than Shift-Ctrl-C-ing and V-ing...
    Last edited by Don B. Cilly; Sep 04, 2019, 12:37 AM.

    #2
    As a comment running KDE Neon 5.16 when i searched for KDE service menu in Synaptic all it returned was a service menu for dealing with .isos and was not installed.

    searching service menues it returned Deepin menu, the above and telepathy indicator.

    A KDE service search returned a LOT of items

    On Kubu Disco the above KDE service menu returned the same.

    KDE service returned the iso item, "mail transport" and "cli tools" as being installed.

    woodsmoke

    Comment


      #3
      As far as I'm aware, you don't have to install anything.
      Just save the first code box as ~/.local/share/kservices5/ServiceMenus/whatever.desktop, and restart Dolphin.
      You'll find a "Touch" under Actions when right-clicking on a file - or directory. Simple as that.

      Comment


        #4
        @woodsmoke: https://store.kde.org/browse/cat/102/order/latest/. Some are pretty old and may not be relevant to newer systems.
        Kubuntu 20.04

        Comment


          #5
          Originally posted by Don B. Cilly View Post
          Only problem with it, I haven't found a way to make the password popup "persistent" (like sudo in a terminal), but it's probably still better than Shift-Ctrl-C-ing and V-ing...
          Well, if you want to be naughty, assuming you have ~/bin and it's in your $PATH,
          Code:
          cp /bin/touch ~/bin/supertouch
          sudo chown root:root ~/bin/supertouch
          sudo chmod +s ~/bin/supertouch
          Now your service menu can run supertouch on whatever it wants to.
          Regards, John Little

          Comment


            #6
            Originally posted by chimak111 View Post
            @woodsmoke: https://store.kde.org/browse/cat/102/order/latest/. Some are pretty old and may not be relevant to newer systems.
            thankee | since i am older than dirt.. old is good|

            I would wager a hearty slap on the virtual back that few know what i reference by saying : " Sawfish". lol

            woodreaalyISOLDsmoke

            Comment


              #7
              Originally posted by jlittle View Post
              Well, if you want to be naughty, assuming you have ~/bin and it's in your $PATH, ...

              Now your service menu can run supertouch on whatever it wants to.
              Cool
              I don't have ~/bin, but I have ~/local/bin which serves the same purpose.

              Now, what is not cool is, my Dolphin seems to have gone gaga.
              In the sense that if I right-click on an empty space, I don't get any menus, like "Create New", "Paste one file", etc. It does nothing.
              I have to go through the File and Edit menus in the bar to do it.
              If I right-click on an a file or directory, I do get them. Which is wrong, though.

              Now, I made that service menu with MimeType=all/all;
              Because I figured, one might want to touch anything.
              So I thought, hmm, maybe it's a bad-eyed deer.
              So I changed it to MimeType=text/plain;inode/directory; (and edited my post accordingly).
              Which should be good enough.
              No luck. My Dolphin is still "broken".
              I tried removing (move somewhere else the service menu. Nope.
              I tried removing all of them. No good.

              I've spent more than half an hour googling, and -as you can imagine - no luck there either.
              So...
              a) don't use that menu until I've solved it.
              b) if anyone has any ideas...

              Comment


                #8
                Well, as reported in the Beached Dolphin thread, it really looks like it wasn't due to the service menu at all, simply an Unstable update.
                So feel free to use it it

                Comment

                Working...
                X