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

rofi-rbw hangs when action is copy and the output is assigned to a bash variable #92

Closed
jonboh opened this issue Mar 24, 2024 · 3 comments

Comments

@jonboh
Copy link

jonboh commented Mar 24, 2024

I wanted to send the output from rofi-rbw to a window to display a password and keep the copy actions, however rofi-rbw hangs in this case.

PASSWORD=$(rofi-rbw)
echo "$PASSWORD" # this won't execute if you exit rofi with Alt+c

If instead you exit with Enter, the output is properly displayed.
I would have expected to just display an empty string.

@fdw
Copy link
Owner

fdw commented Mar 24, 2024

A couple of questions:

  • What's your rofi-rbw version?
  • Do you have defined a --action or are you using the default?
  • Have you set --clear-after?
  • Have you checked whether the process is still running?

@jonboh
Copy link
Author

jonboh commented Mar 24, 2024

Ah, forgot to report the version:

$ rofi-rbw --version
rofi-rbw 1.3.0

In the script I actually use, I do define --action and --clear-after:

PASSWORD=$(
      rofi-rbw \
        --clear-after 15 \
        --action print \
        --keybindings "Alt+p:type:password,Alt+P:print:password,Alt+c:copy:password,Alt+u:copy:username,Alt+s:sync"
)

However, this isn't necessary to reproduce the issue, with all the defaults the problem still appears when rofi-rbw is closed with a copy action (instead of Enter or Ctrl+C)

Edit: To clarify, the clipboard and clear-after functionality work correctly. The only problem is that rofi-rbw won't exit and let scripts continue running if you use the clipboard actions.

@fdw
Copy link
Owner

fdw commented Mar 24, 2024

I can reproduce this, but I can also see that the rofi-rbw process stops. The problem seems to be that the clipboarder keeps running in the background, which required for it to work (at least on X, I haven't checked Wayland). So, there is nothing I can change and things are actually working as designed 😉

If you want to use rofi-rbw in a script, I recommend to use the print action and do whatever else you need in your script.

@fdw fdw closed this as completed Mar 27, 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

No branches or pull requests

2 participants