Support selections, manipulations, and/or clipboard actions on the input field #2245
jpodolski
started this conversation in
Ideas/Feature Requests
Replies: 1 comment 1 reply
-
|
The copy works fine under X11 for me (just tested).. @lbonn does copy/paste work in wayland? I think there is a simple work around for your issue.. cat ~/.config/rofi/scripts/logger.sh (make it executable) #!/usr/bin/env bash
echo "$@" >> ~/mylog.txt(you might want to make the script smarter then this, to avoid undesired entries) the run rofi like: rofi -show combi -combi-modes "logger,drun" |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I would personally love if there were a way to allow the user to do "standard" text UI operations that involve highlighting, editing, and copying the query, similar to the behavior of a native text input field.
Use case:
I often launch rofi as a reflex to the thought: "I need to type/do something", and decide how to handle the input after I'm done typing, either combi matching or manually selecting a custom script mode/option. However, I often also jot down things like phone numbers, addresses, or notes into the field, which wouldn't match a list item. On macOS and Windows, I usually just copy the text out of my preferred omnibar with Ctrl+A > Ctrl+C (and I might also use Ctrl+Shift+Left/Right etc., to select, cut, and rearrange words) because I personally find this to be the quickest way to snag my text from the input field and move it somewhere more appropriate.
I do not currently have a good solution to use rofi in this way, and I can't seem to be able to make a good custom mode or script for my use case. I understand that making changes to something like input handling may be prohibitively difficult, and that this is a niche feature request. I'm willing to accept a lot of compromise to try and get this to work, as this has been a difficult habit for me to break.
What I have tried:
Just use Ctrl+c?
I have tried to use
-kb-secondary-copy, and I see in the comments for fc07619 that it specifically requires a clipboard manager to be functional. I have tried running a clipboard manager while using this, but it does not seem to work. If you can direct me to documentation for this feature, such as a known-supported clipboard manager or configuration, I can try to see what I might be doing wrong here.Pipe unmatched text into a script:
This does not seem possible from what I have read, and is only supported by
-dmenumode. There doesn't seem to be a way to define a fallback action in a script or other mode.Then just use dmenu mode:
If returning the query on no-match is only for dmenu mode, I could just try using dmenu, but it requires me to hop into dmenu mode to handle my input. However, I can't see any way for me to launch dmenu mode when I'm currently sitting in rofi with text I need to copy, without losing that text as soon as I launch dmenu.
Use custom keybinds:
I also see that the
-kb-custom-nkeybinds can be used to do different things with the selection by returning some extra value. However, this cannot be used with input text that does not match an entry, so still can't handle my input regardless, even if my script gets some "copy this to the clipboard" flag.Custom accept action:
Perhaps using kb-accept-custom I could define an alternate shortcut for handling my action, but according to the documentation, this only works for the ssh/run modes, so I cannot integrate it into a combi or custom script mode. I was also having trouble finding documentation that describes how to configure the difference between [kb-accept-custom] and [kb-accept-custom-alt]; does this imply you can set a multiple ways to handle unmatched queries when in ssh or run mode? I am willing to navigate to run mode to copy text if I don't also lose my default "execute this command" fallback in this mode as well.
Pipe the text into a command:
This is my current process and the only thing I have found that works. I just take my query of
this is some unmatched textand turn it intoecho "this is some unmatched text" | xsel -ib. While this does "work", I feel that it's a painfully inelegant and slow solution to my issue.I know this is a particular ask, but it is a very ingrained muscle-memory of mine that keeps being reinforced by my other operating systems, and I keep accidentally getting stuck in rofi while my text is being held hostage. If you can help me find a good way to use rofi for this purpose, or if you might consider working on this feature request, I would greatly appreciate it. Regardless, thank you for your development of a very useful tool!
Beta Was this translation helpful? Give feedback.
All reactions