-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add xdg_mime feature for using xdg_mime for mime type autodetection #13
base: master
Are you sure you want to change the base?
Conversation
The second push is just a removal of a debug statement that I had missed when I submitted :) |
Hmm, if |
FYI, upstream wl-clipboard also recognizes MIME types that end with Perhaps wl-clipboard-rs could learn a few similar tricks 😄 |
Also for me
|
@YaLTeR if you run it on the |
At the end of the day, I wouldn't say that An alternative solution would be to just detect when |
Are there any other issues with |
That sounds like a good solution, keep the default as If you're good with that I'll update this PR maybe... tonight when I have some time. |
I still can't get anything different from
Are you sure |
@YaLTeR I'm positive. If you run As a second check, my version of |
I don't like that it calls out to a binary that may or may not be installed on the user's system, especially since there is no fallback to Especially, since there is a rust library implementation of |
This adds a new feature,
xdg_mime
, that will force the use ofxdg-mime
for querying autodetected mime types instead oftree_magic
.Justification
If you use
wl-copy
to copy a shell script,tree_magic
reports its mime type asapplication/x-shellscript
, which is not a text mime type, and therefore you cannot paste that script in to text boxes in say, Firefox, for example.For users that want the same functionality as the upstream
wl-clipboard
utilities, which usesxdg-mime
to autodetect mime types, they may compile with--features xdg_mime
to force the use of xdg-mime instead oftree_magic
.While sticking with the pure-Rust implementation would be preferable, providing this as optional functionality can make these binaries usable for those who need that functionality to work as it would with the other tools.