t-8ch / pinentry-bemenu

Pinentry based on bemenu
GNU General Public License v3.0
49 stars 3 forks source link

`BEMENU_OPS` not respected #23

Closed pfr-dev closed 5 months ago

pfr-dev commented 5 months ago

I have the following lines in my /etc/profile

export RBW_MENU_COMMAND="bemenu --fn 'Sarasa Term CL Nerd Font 10.5'"
export BEMENU_OPS="--fn 'Sarasa Term CL Nerd Font 10.5'"

I added the font to the forst variable because the BEMENU_OPS variable wasn't being respected.

Now, when I run a program like rbw through rbw-menu where I've set the pinentry program to pinentry-bemenu it does not respect the font setting and uses the default font. However, the rbw-menu prompt itself, which uses the variable defined by RBW_MENU_COMMAND does use respect this variable and uses the Sarasa font arg.

Strangely, when I simply run bemenu-run without arguments from the command line is again defaults back to the default font. I assume because bemenu-run is a separate command, just like pinentry-bemenu.

Is there something I'm doing wrong or a way to set the ENV for all bemenu related commands?

richiesuper commented 5 months ago

I also experienced the same issue.

bemenu and bemenu-run respects the BEMENU_OPTS but not pinentry-bemenu.

t-8ch commented 5 months ago

@pfr-dev The variable is named BEMENU_OPTS, can you doublecheck that you are writing it correctly?

@richiesuper Which options are you setting? Make sure to only use ones that are supported.

px86 commented 5 months ago

I was facing the same issue with BEMENU_OPTS. Adding the following line in my window manager's autostart script fixed it for me.

systemctl --user import-environment BEMENU_OPTS

OS: Arch Linux WM: qtile (wayland)

pfr-dev commented 5 months ago

@pfr-dev The variable is named BEMENU_OPTS, can you doublecheck that you are writing it correctly?

Oh my goodness, that will surely be the reason! I do love it when the solution is simple. I will test this out within the next 8 hours or so and will close this issue once resolved.

pfr-dev commented 5 months ago

Ok so I can confirm that BEMENU_OPTS does work, but as @richiesuper mentioned, it doesn't completely work with pinentry-bemenu

THis is what I have in my /etc/profile

export BEMENU_OPTS="-b -H 20 --hp 10 --fn 'Sarasa Term CL Nerd Font 10.5'"
export RBW_MENU_COMMAND="bemenu -p 'Bitwarden:'"

And the following in my river/init

# Super+B to launch bemenu
riverctl map normal Super B spawn "bemenu-run -p 'Run:'"

These variables are used when running bemenu or bemenu-run, however it looks like pinenty-bemenu doesn't like the --hp flag or anything after it.

[dave] ~ % pinentry-bemenu
pinentry-bemenu --hp: unknown option
OK pinentry-bemenu 0.13.1

I dont necessarily need this flag for bemenu-pinentry but it's useful for the other menu's so I'd like to keep it. Also, when I remove this flag my font is still not used.

Any ideas?

t-8ch commented 5 months ago

Unfortunately bemenu-pinentry does not support all options of normal bemenu. Currently all options need to be re-implemented manually, which is annoying. At some point somebody hopefully implements reusable option parsing within bemenu.

Also, when I remove this flag my font is still not used.

I don't now. It works for me.

pfr-dev commented 5 months ago

Currently all options need to be re-implemented manually, which is annoying.

How so? I'll do it manually, I just don't know how.

It works for me.

Could you please share your BEMENU_OPTS for comparison

t-8ch commented 5 months ago

How so?

After every bemenu release all the new options need to be essentially duplicated.

I'll do it manually, I just don't know how.

Look at https://github.com/t-8ch/pinentry-bemenu/blob/main/options.c

Could you please share your BEMENU_OPTS for comparison

For testing I used BEMENU_OPTS="--fn 'Noto Serif 9'"

pfr-dev commented 5 months ago

Adding the font flag first seemed to fix it. Thanks