swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.64k stars 1.11k forks source link

dmenu won't open #5112

Open fuzunspm opened 4 years ago

fuzunspm commented 4 years ago

dmenu won't open on system startup. If i wait for 5 minutes or open any xwayland app(emacs, brave..) then it opens as long as xwayland app stays open. It produces this error when executed from terminal

╰─$ dmenu_path | dmenu | xargs swaymsg exec --
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  1 (X_CreateWindow)
  Value in failed request:  0x0
  Serial number of failed request:  91
  Current serial number in output stream:  94
Error: Invalid exec command (expected at least 1 argument, got 0)

sway version 1.4

sway log

whtv commented 4 years ago

Not a solution but bemenu is native wayland and can be configured to look/behave pretty much exactly like dmenu.

mobuchowski commented 3 years ago

I have the same issue.

primeos commented 3 years ago

Using dmenu (like in the default configuration) obviously also breaks with xwayland disable. (But that's only a minor inconvenience, I've simply switched to bemenu since then.)

Maybe it's time to reconsider whether to use dmenu in the default configuration?

https://github.com/swaywm/sway/blob/f9a5c18c93c4c72fdefbecb34d30464fa6276b41/config.in#L21

Alternatives are listed here (I'd say we should pick one that supports Wayland natively):

Not sure though if there would be a consensus, if something like set $menu bemenu-run --no-exec | xargs swaymsg exec -- could be considered compatible enough / a drop-in replacement, and if changing the default would be worth it (downstream packagers would have to adapt the default dependencies, it could temporarily break user setups, and we'd have to find an alternative that is stable and well maintained).


dmenu won't open on system startup. If i wait for 5 minutes or open any xwayland app(emacs, brave..) then it opens as long as xwayland app stays open.

I haven't tested it but adding xwayland force to ones Sway configuration might be a workaround. From man 5 sway:

Enables or disables Xwayland support, which allows X11 applications to be used. enable will lazily load Xwayland so Xwayland will not be launched until the first client attempts to connect. In some cases, such as slower machines, it may be desirable to have Xwayland started immediately by using force instead of enable.

emersion commented 3 years ago

I don't personally like bemenu, because its codebase is kind of a mess and it has dynamically loadable backends which make everything more complicated.

primeos commented 3 years ago

@emersion ok, that makes sense, thanks for the reply. I assume you don't like the other ones either (AFAIK you use https://git.sr.ht/~emersion/dotfiles/tree/master/item/bin/menu)? I briefly looked at the rest of the alternatives from the two lists above and it looks like they all have some issues (look too different, too complex, too many dependencies, etc. - https://github.com/nyyManni/dmenu-wayland might have potential but I guess a dependency on glib-2.0 and gobject-2.0 is also not ideal(?)).

Maybe it's time to reconsider whether to use dmenu in the default configuration?

So I guess it's best to stick with dmenu (at least for now)?

emersion commented 3 years ago

Yeah, I'm personally using a terminal + fzf as my menu. Probably not something most users will want.

fuzzel looks like it could be a good alternative, but is focused on the launcher aspect (with things like .desktop file parsing, icons and such) and has (IMHO) an ugly default style (that could maybe be improved).

ear7h commented 1 year ago

I ran into this today, ended up fixing it by specifying a monitor to dmenu like:

... | dmenu -m 0 | ...