p0deje / Maccy

Lightweight clipboard manager for macOS
https://maccy.app
MIT License
13.05k stars 550 forks source link

[Feature Request] Support images #44

Closed tenitski closed 4 years ago

tenitski commented 5 years ago

Support coping, viewing and pasting images eg as ClipMenu does:

image
afeblot commented 5 years ago

and if not supporting images, at least fix the following bug: Currently, each time I copy an image, the latest item is removed from the clipboard history.

georgesnow commented 5 years ago

yes this would be awesome!

HugoDF commented 4 years ago

@p0deje any idea how one would go about implementing this?

p0deje commented 4 years ago

First of all, Maccy currently listens for plain text copies, so it needs to start supporting images in NSPasteboard. Next, it needs to implement some storage mechanism for images (I assume UserDefaults support that). Lastly, it needs to present the copied image using NSMenuItem image methods.

@HugoDF Are you willing to submit PR for that?

HugoDF commented 4 years ago

@p0deje I'll have a go and let you know if I hit any issues

chaucerbao commented 4 years ago

I really like Maccy's focused, no-nonsense approach. However, I do find myself wishing I could refer back to older screenshots quite often. So I'm looking forward to this enhancement!

dreness commented 4 years ago

First of all, Maccy currently listens for plain text copies, so it needs to start supporting images in NSPasteboard. Next, it needs to implement some storage mechanism for images (I assume UserDefaults support that).

Consider avoiding use of UserDefaults for storing user data other than preferences. The preferences system doesn't have any hard size limits (except on tvOS), but even so it isn't really intended for potentially large amounts of data. CoreData is likely a better choice for this use case (and probably for text storage as well).

p0deje commented 4 years ago
Screen Shot 2020-03-14 at 14 57 32

How does that look? Are the images too big or too small?

afeblot commented 4 years ago

Ohh, awesome :-) I would rather have them smaller. Like 1,5 times smaller. Just my own personal taste. You may want to provide an option for the size :-)

FernandoMiguel commented 4 years ago

i love this. agree it should be smaller

p0deje commented 4 years ago
Screen Shot 2020-03-14 at 15 28 32

@afeblot @FernandoMiguel Like this?

afeblot commented 4 years ago

yeah, that could be it. Or even a bit smaller.

alexjousse commented 4 years ago

It looks great!!

FernandoMiguel commented 4 years ago

looks better. guess i'll have to see it on my screen to have a better perception.

can this be customised? a env var to set the number of pixels?

HugoDF commented 4 years ago

Never got round to, this looks awesome

p0deje commented 4 years ago

This will be customizable like

$ defaults write org.p0deje.Maccy imageMaxHeight 15

Default is 40

p0deje commented 4 years ago

Added in 0.9.0

HugoDF commented 4 years ago

Amazing

mambusskruj commented 4 years ago

Hi! How can I disable image support? I want to see list of text items only.

p0deje commented 4 years ago

@mambusskruj You can't at the moment. Feel free to submit a feature request. Also, you can set the max height so that images look like other text items:

defaults write org.p0deje.Maccy imageMaxHeight 16