Announcement

Collapse
No announcement yet.

Clipboard manager on KDE and regex

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

    Clipboard manager on KDE and regex

    Hi. I'm a new user of Kubuntu. I was looking around the features and I noticed that Kubuntu includes a clipboard manager. I also noticed that I can set actions according to a previously matched regex. I would like to know if it is posible to configure the clipboard to ignore an entry that matches a predefined regex so it does not appear or be kept in the clipboard.

    Thanks.

    #2
    I looked at this and thought, there'll be a dbus message you could invoke. I found
    Code:
    qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardContents
    but it doesn't work, nothing happens.
    Code:
    qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory
    works, but it hits all the clipboard entries. Several other dbus messages do work. Maybe if you want to muck about with scripting:
    • extract all the clipboard with qdbus org.kde.klipper /klipper org.kde.klipper.klipper.getClipboardHistoryMenu
    • clear it
    • then load it back up without the first, one at a time, with qdbus org.kde.klipper /klipper org.kde.klipper.klipper.setClipboardContents
    Regards, John Little

    Comment


      #3
      GREAT POSTS!!

      so...could "kubuntu developers" ... put a GUI on top of this and have it be something to separate Kubuntu from other distros and KDE per se?

      if it was possible...

      I would send the OP a gift card to Amazon through paypal.

      thanks to the OP and thanks to jlittle.

      woodsmoke

      Comment


        #4
        Originally posted by woodsmoke View Post
        so...could "kubuntu developers" ... put a GUI on top of this and have it be something to separate Kubuntu from other distros and KDE per se?
        It would surely be simpler to make the org.kde.klipper.klipper.clearClipboardContents work.
        Regards, John Little

        Comment


          #5
          jlittle

          I am just an old hardware kinda guy ... you are the smart one... so...yeah...

          woodkindastupidsmoke

          Comment


            #6
            Thank you @jlittle . I will try that approach. What I basically want to do is keep using the default clipboard manager (now I know is called Klipper) but I don't like, as an example, passwords copied from KeePass to appear and get stored on the clipboard manager. That is why I use this regex on clipboard managers:

            ^(?=(?:\w*\W+)+\w*$)(?=(?:\S*?[A-Z]){2,}\S*?$)(?=(?:\S*?[a-z])+\S*?$)(?!.*?\.\w{2,5}$).{25,90}$

            That ensures that it will ignore strings from 25 to 90 characters with at least 1 lower case, 2 upper case, one or more symbols, does not include spaces, does not end on .com or .net or .whatever and it's not an URL or a PATH like home/User/Whatever. That regex includes like 95% of my passwords. For example on Clipit I just add that regex to the exclude list and that's it. That's what I was trying to do on Kubuntu.
            Last edited by eera5607; May 03, 2018, 08:35 AM. Reason: correction

            Comment

            Working...
            X