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

[REQUEST] Allow output of Type=Link files' URL in drun-display-format #1914

Closed
2 tasks done
aarondill opened this issue Oct 31, 2023 · 8 comments
Closed
2 tasks done
Milestone

Comments

@aarondill
Copy link

aarondill commented Oct 31, 2023

Before opening a feature request

  • I checked the next branch to see if the feature has already been implemented
  • I searched existing reports to see if it is already requested.

What is the user problem or growth opportunity you want to see solved?

I would like to display the URL of my desktop files with Type=Link while using drun.

How do you know that this problem exists today? Why is this important?

I've tried the intuitive way of displaying the '{exec}' field, but this is a null field when using URLs. I've also searched the source, hoping for an (undocumented) way to do this, but the code only checks for dr->exec (NULL), thusly this is currently impossible.

rofi/source/modes/drun.c

Lines 1338 to 1341 in 9cea843

char *retv = helper_string_replace_if_exists(
config.drun_display_format, "{generic}", egn, "{name}", en, "{comment}",
ec, "{exec}", dr->exec, "{categories}", cats, "{keywords}", keywords,
(char *)0);

Note: it seems there may be a bug in the current implementation. Shouldn't dr->exec be escaped too (like name, comment, and generic_name)?

Who will benefit from it?

Anyone who wants to know what pressing a button would do (typically the same people that would display the {exec} field)

Rofi version (rofi -v)

Version: 1.7.1 (and HEAD)

Configuration

https://gist.github.com/aarondill/b809c4954f2d1147a2cfeebb83d20c20

Additional information

One of two implementations could be chosen:

  1. Create a new {url} field, null if using Type=Application, like {exec} is for Type=Link
  2. Assign the {exec} field to the URL when using Type=Link (more intuitive IMO)
@DaveDavenport
Copy link
Collaborator

Please test above commit.

@aarondill
Copy link
Author

It works amazingly for me! Glad to finally be able to search for the URLs of my Links! 😄

@DaveDavenport
Copy link
Collaborator

DaveDavenport commented Oct 31, 2023

It works amazingly for me! Glad to finally be able to search for the URLs of my Links! 😄

I don't think that was requested?

@DaveDavenport
Copy link
Collaborator

Should work now.

@aarondill
Copy link
Author

It works amazingly for me! Glad to finally be able to search for the URLs of my Links! 😄

I don't think that was requested?

It wasn't explicitly requested, but by including it in drun-display-format, it became searchable

@DaveDavenport
Copy link
Collaborator

but by including it in drun-display-format, it became searchable

not until the last commit.

@aarondill
Copy link
Author

Oh! You seem to be correct. My mistake. I've set the Comment field in my Links to the same as the URL as a hack for this previously, so I didn't realize it was still matching due to that.

Copy link

github-actions bot commented Dec 2, 2023

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants