davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.06k stars 608 forks source link

Not an issue, but a request to replace the "run:" prompt string #637

Closed k3vob closed 6 years ago

k3vob commented 7 years ago

There is the -p flag to change the prompt when running dmenu mode. Would it be possible to have a similar flag to replace the prompt on other modes? For example, I run rofi -show run, and I would like to replace the "run:" prompt with perhaps ">>> ".

Thank you.

carnager commented 7 years ago

-display-run ">>>" However, this will not get rid of the colon :(

k3vob commented 7 years ago

Perhaps that could be included in the option. I could be wrong, but surely "run:" is just a fixed string that could be replaced with another string of the user's choice?

k3vob commented 7 years ago

@carnager What arguments is the -display-run option supposed to take:

rofi -show -display-run ">>>"
The script command '-display-run' has 1 options, but needs 2: <name>:<script>.
Invalid script switcher: -display-run
The -display-run switcher has not been enabled

What is the <script> part?

sardemff7 commented 7 years ago

The correct use is rofi -show run -display-run ">>>".

-display-run is a totally different argument, not linked to -show. The string you pass to it will be used to identify the run mode in 3 places:

DaveDavenport commented 7 years ago

From the last bug report where this came up:

In short this is a no way to please everybody issue (had ':' removed for a while so it could be set in -display-name, but people complained (validly) that this messed up the sidebar/combi ). That can only be solved by adding X extra options again.

With the new theme format, I might change this as you can fix it in theme. (add a text widget with no left/right margin next to prompt with as text: ':').

But we need to look at this for the 1.5 release.

DaveDavenport commented 6 years ago

As an idea (will put on a separate branch):

In the default theme I have now split the prompt into a hbox (prompt-box) with prompt and prompt-colon as child. The : is now part of the theme.

To disable it, either don't add it. To disable it on commandline (with default theme) -theme-str '#prompt-colon { enabled: false;}'

@carnager what do you think? it will kinda break dmenu scripts as it now has this extra widget by default. With all the hacks in there now, unsure what best solution is.

DaveDavenport commented 6 years ago

Test on branch issue637

4nd3r commented 6 years ago

i would like to disable prompt string entirely :wink:

maybe add option display-*: false or similar?

DaveDavenport commented 6 years ago

@4nd3r That is already possible in the new theme format. rofi -theme-str '#prompt { enabled: false; }' -show

ptMuta commented 6 years ago

Is there any particular reason (besides old themes / scripts needing it added after a change) why the colon can't be part of the prompt text? It's the only thing ticking me in my rofi drun at the moment :(

DaveDavenport commented 6 years ago

@ptMuta See previous remark(s) in this thread.

ptMuta commented 6 years ago

Ah, missed the citation. Sorry. Well the componentiation feels a bit dirty, but I s'pose based on that it's definitely the path of least issues so I'll gladly take it :)

DaveDavenport commented 6 years ago

Fix to sanitize rofi again:

 inputbar {
     children: [ prompt, textbox-prompt-colon, entry, case-indicator ];
 }                                                                     

 textbox-prompt-colon {                                                
     text-color: inherit;                                              
     expand: false;                                                    
     margin: 0 0.3em 0em 0em;                                          
     str: ":";
 }                 
k3vob commented 6 years ago

That is already possible in the new theme format. rofi -theme-str '#prompt { enabled: false; }' -show

In what format can I add this to my Xresources config file when using drun mode?

sardemff7 commented 6 years ago

Xresources is deprecated and will be removed in a quite near future. Please update to ~/.config/rofi/config (or ~/.config/rofi/config.rasi, which is alpha for now) and set your theme to whatever value (or use @import "whatever" in config.rasi) and have ~/.config/rofi/whatever.rasi contain your theme and the prompt thing.

sardemff7 commented 6 years ago

Locking this issue to prevent more unrelated questions.