Code Monkey home page Code Monkey logo

Comments (23)

dmig avatar dmig commented on May 25, 2024 2

I decided to choose following logic for unsynced buffers:

  1. selection buffer is only monitored, not changed
  2. selection buffer value is always on top of history, always unselected
  3. clipboard buffer value is second (if differs from selection buffer) or first, always selected
  4. selecting history item changes clipboard buffer only

So menu will look like:

  selection text
* current clipboard text
  previous selection text
  some other text
  very old selection text
  one more text
  ...
-----
  Private mode

Right now I'm implementing this feature. Have to refactor big piece of code, otherwise seems impossible to me.

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024 1

Thank you for your feedback! :)

I think the icons are a great idea! But maybe keyboard/mouse icons.
And maybe these could be clickable buttons, so you'll be able to set the selection/primary clipboard to what ever you like, no matter which clipboard it belonged to originally.

Here's what I'm thinking about:
clipboard-indicator-idea1

The mouse/keyboard icons are clickable, and determine the clipboard to which the entry belongs. So, in the example above, the 3rd entry (from the top) is currently set in the "selection clipboard" and the 4th entry is set in the "primary clipboard".

What do you think?

from gnome-shell-extension-clipboard-indicator.

jhaar avatar jhaar commented on May 25, 2024 1

I must say this is all too subtle for me. I just want anything I select to be available in the drop-menu. I don't understand why you need to bother distinguishing them? Frankly all I know is that when I left-click my mouse and drag over text, that's called the primary selection and if I am in a GUI and click Ctrl-C, that's the clipboard selection. They are both "selected" in my mind - and my thinking goes no further than that :-)

So of the two options up there, I certainly wouldn't like the two selection types showing up as different "areas" - I typically run with a 100 line history - so 200 lines would be madness. But the little icons are inoffensive enough.

Oooh - an idea. How about if you have a "sync primary and clipboard selections" option, then you can just merge them and skip the icons - ie only have the icons if that isn't synced? (ie I'd prefer synced ;-)

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024 1

In the case of a merged list without buttons, how would we handle the following scenario:

  1. User selects text and ctrl+c it
  2. User selects text without ctrl+c
  3. User presses ctrl+v
  4. What should be pasted?

Do we just merge them so at any moment you have the same entry selected for both selections? I believe it is not very intuitive, as it completely alters the default behavior.

One advantage of your idea, is that it helps with handling the shortcuts. In case we maintain two registries, I can only think that we would need to duplicate the shortcuts - one set of shortcuts for each registry. If we merge the lists, we will not need to modify anything there.

Personally, I feel like these are two different selections that should remain separated, but it creates some difficulties.. Maybe we can add an opt-in feature for merging the two lists as a start..

from gnome-shell-extension-clipboard-indicator.

jhaar avatar jhaar commented on May 25, 2024 1

Parcellite has the following comments to do with their "Synchronize clipboards" feature, does this help?

"If checked, will keep both clipboards with the same content. If primary is pasted, then copy will have the same data"

from gnome-shell-extension-clipboard-indicator.

dmig avatar dmig commented on May 25, 2024 1

What actually prevents from implementing this feature? Is there lack of APIs?

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024 1

@dmig mostly, my lack of free time 😁
I believe the API for this exists, but it's quite a bit of work - need to add option in settings, implement the functionality, make sure it doesn't break the existing functionality...

from gnome-shell-extension-clipboard-indicator.

dmig avatar dmig commented on May 25, 2024 1

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024 1

Also, we will need to add it as an option to the settings - I personally don't want my clipboards to be synced and I believe there are other people who feel the same.

from gnome-shell-extension-clipboard-indicator.

dmig avatar dmig commented on May 25, 2024 1

I personally don't want my clipboards to be synced and I believe there are other people who feel the same.

Agree. Most times I have 'sync clipboards' disabled.

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024 1

@dmig - But your current suggestion does not answer the need raised here. The feature here discusses merging the selection and the clipboard, in a way that selecting text will basically behave like ctrl+c.

from gnome-shell-extension-clipboard-indicator.

dmig avatar dmig commented on May 25, 2024 1

@Tudmotu merging is simple -- that's often called 'sync selection with clipboard'. I'll make an option for that.

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024 1

@dmig and @freeroot are you both working on implementing this? Please coordinate between you, maybe you can join forces :)

from gnome-shell-extension-clipboard-indicator.

yagilm avatar yagilm commented on May 25, 2024 1

Functionality like parcellite would be nice (different buffers, ability to sync them).
Until then, and if you want synced buffers, I can suggest autocutsel (Keep the X clipboard and the cutbuffer in sync) in combination with this clipboard indicator.

# this works for me:
autocutsel &
autocutsel -s PRIMARY &

from gnome-shell-extension-clipboard-indicator.

cactux avatar cactux commented on May 25, 2024 1

For the feasibility study, you can also have a look at glipper who does that (taking the text selected with the mouse). https://launchpad.net/glipper

from gnome-shell-extension-clipboard-indicator.

danielquinn avatar danielquinn commented on May 25, 2024

In terms of how to get the mouse-selected value, Parcellite manages to do this, so it should be possible.

As for how to show the difference, you could follow Parcellite's style and just opt for italics = mouse, bold = keyboard, but that's hard for some people to see.

Perhaps a partitioned menu, much how you've separated the settings from the clipboard data, so you could have something like:

keyboard
keyboard
keyboard
---
mouse
mouse
mouse
---
Clear History
Settings

This can be a problem for smaller screens, though given that you've already got a "history size" option in the settings, I'm not convinced that this would be an issue.

Then again, GNOME's menu system seems pretty happy with iconography for stuff like this (take a look at the world clock for example). It might be best to go for something simple: an icon to the left or right: a square for keyboard, a triangle for mouse.

Honestly, any of these would work for me. I'm just happy someone has spent the time to write this because I don't really like how Parcellite is implemented -- as an afterthought, stuffed into the system tray. I much prefer this project's use of the extensions framework.

from gnome-shell-extension-clipboard-indicator.

danielquinn avatar danielquinn commented on May 25, 2024

Oooh, I like this a lot! Good call on the icons too.

I'm not sure about the colour though, since generally the top menu doesn't make use of colours at all, and forcing users to go with red might clash with whatever theme they're using. I'd recommend a grey of some kind, or better yet, make that colour customisable in the settings?

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024

Another option is no color at all:
clipboard-indicator-idea2

But in any case, this can be configurable as you suggested. :)

from gnome-shell-extension-clipboard-indicator.

danielquinn avatar danielquinn commented on May 25, 2024

Less pretty, but more portable. I like either :-)

from gnome-shell-extension-clipboard-indicator.

Tudmotu avatar Tudmotu commented on May 25, 2024

@dmig - You can start following the code from the init() method.
The place where the extension reads from the clipboard is in the refreshIndicator() method.
You can see the CLIPBOARD_TYPE variable is set to CLIPBOARD. Basically we need to read not only the CLIPBOARD clipboard but also the PRIMARY clipboard. We need to add the values in both these clipboards to the history list. If they are different, we need to set the clipboard to the value of the PRIMARY clipboard.

If you need anymore help, let me know and I will try to help with it. :)

from gnome-shell-extension-clipboard-indicator.

 avatar commented on May 25, 2024

Hello,

I try to implement a version of Primary selection but I'm stuck at the beginning.

I don't know why if you only add those lines ( https://github.com/freeroot/gnome-shell-extension-clipboard-indicator/commit/4e0fec6b2af7747b172f41bc9db0b415dc93449e ), "Clipboard.get_text(CLIPBOARD_TYPE, ..." is called (line 352) because I have now a notification and one more entry at each selection : Why CLIPBOARD_TYPE and PRIMARY_TYPE looks like mixed ?

ps: I'm on Xorg for now.

from gnome-shell-extension-clipboard-indicator.

LordChaos73 avatar LordChaos73 commented on May 25, 2024

Any update on this feature? Or is it not worked on at all?

from gnome-shell-extension-clipboard-indicator.

SUPERCILEX avatar SUPERCILEX commented on May 25, 2024

Implemented in SUPERCILEX/gnome-clipboard-history#38

from gnome-shell-extension-clipboard-indicator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.