Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wayland surface to copy pano layout. #31

Closed
wants to merge 7 commits into from

Conversation

leb-kuchen
Copy link
Contributor

@leb-kuchen leb-kuchen commented Apr 15, 2024

I did some prototyping for creating a wayland surface, which works like the wayland surface in the power applet.
Todo:

  • Link ( probably involves doing a HEAD Request, for now just a regex)
  • Files needs clipboard mime type?
  • Image / needs clipboard mime type?
  • Code / needs clipboard mime type or regex?
  • Color
  • Emoji
  • Cleanup code

@leb-kuchen leb-kuchen marked this pull request as draft April 15, 2024 16:19
@wiiznokes
Copy link
Owner

Are you going to implement all this in one PR ? It seems unrelated enough to be splitted into multiple PR.

Link ( probably involves doing a HEAD Request, for now just a regex)

My though were just providing a button to open the link in the browser (probably using the dropdown or with middle click). Idt there is need for regex here since it should automatically detected as a link with his mime type.

Image / needs clipboard mime type?

Yes, i think there is a mime type for image. For storing into the database, i think we just need to store a path on the file system where we have copied the image. (Btw, we should change the /tmp storage folder the db to the proper cache folder, but that is another issue)

Code / needs clipboard mime type or regex?

Not sure what this is

Emoji

It may be out of scope, i think i kinda unrelated to a clipboard manager. My main concern is how we expose this to user, i don't like having to much button like KDE does.

That's it, otherwise I'm excited to see what the pano layout and Color (not sure what is this) will look like!

Chears

@leb-kuchen
Copy link
Contributor Author

leb-kuchen commented Apr 16, 2024

Emojis are the easiest, just a text widget with advanced font rendering and noto color emoji, and if not, it does not have color, so it is not really a problem. Emojis crate does provide constant time lookup.

For colors I am not sure, if the hashtag should be required, since every u32 number with a radix of 16 would be detected.

For images I do not know, about just storing the path, since it could be just copied and not have a path, and the path could also be deleted, maybe it could be an option for users, who which to preserve space.

For code, I think pano does a regex, maybe we'll find it.

For links, the db could cache the images, probably a meta tag and the title and description.

For the mime types, which are there and which of them does this clipboard manager already implement?

@leb-kuchen
Copy link
Contributor Author

leb-kuchen commented Apr 16, 2024

I do not know, which I will implement it this offer, emoji will be next, and then find the code regex pano uses, and then it depends on the mime types that are supported. I made a Clipboard Indicator buttton for dev, so you can already see the layout.

@leb-kuchen
Copy link
Contributor Author

leb-kuchen commented Apr 16, 2024

For the background colors of each section, i will just take panos color now, but we might want to use cosmic them colors, or derive them from cosmic theme colors.

@wiiznokes
Copy link
Owner

wiiznokes commented Apr 16, 2024

Emojis are the easiest, just a text widget with advanced font rendering and noto color emoji, and if not, it does not have color, so it is not really a problem. Emojis crate does provide constant time lookup.

Mb, i though you were making an emoji selector like windows does. But still, i do have emoji rendered correctly right now so not sure what your code actually provide. Emojis are just text in the end.

For images I do not know, about just storing the path, since it could be just copied and not have a path, and the path could also be deleted, maybe it could be an option for users, who which to preserve space.

I will personally like if my image was saved. Let say you copy one without a path, from google doc for example, the process will look like this:

  • copy the image into, for example /cache/clipboard/image-UUID.png.
  • add this path into the database

This will have the benefit of not have one type of data that can be extremelly big in the database, while also don't load every image, only the one visible on screen (when the list widget will be available, so soon from the iced roadmap). We can also cache them with memoization.

Data that are to old should get deleted automatically
It could have a limit when file are to big, to not copy them in order to save some sdd lifetime (let say 40mb).

For file/folder on the filesystem, i'm not sure if it's a good idea to store them into the database. Maybe small file could be saved, but that should be an option. But in that case, maybe just store the real path, and if we see that the path point to nothing, we delete it. This will save some space. Maybe we can do this for image (but actually, we need to check the mime type to know this, i will make some test when i have time, to see what type get offered when we copy an image.)

For code, I think pano does a regex, maybe we'll find it.

What type of integration are you planning for source code ?

For links, the db could cache the images, probably a meta tag and the title and description.

Are you thinking of link integration like Discord ? It seems difficult to be done.
If we done caching for this, it will not be stored in the db but in a separate folder i think. Db is just for entries that you can copy.

For the mime types, which are there and which of them does this clipboard manager already implement?

Just text rn.

@wiiznokes wiiznokes mentioned this pull request Aug 29, 2024
8 tasks
@wiiznokes
Copy link
Owner

impl in #75

@wiiznokes wiiznokes closed this Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants