inclement / vivarium

A dynamic tiling Wayland compositor using wlroots
GNU General Public License v3.0
361 stars 13 forks source link

keybindings #80

Open plum opened 3 years ago

plum commented 3 years ago

Hello, and thnak you for a nice piece of kit. Vivarium has more or less all I wish it to do and little else, so of course I'm delighted.

I have been working on Vivarium for a couple of days solid, comparing to other available, and wish to settle for Vivarium, so I decided to contact you on this puzzle concerning the working of keybinds.

I have scripts to run from keybinds, just as I have always used with Xorg and dwm, which work in the alacritty shell in Vivarium when called, with or without 'exec' command.

But I cannot get them to Here are two example's I wrote into Vivarium's config.toml which do not work in Vivarium, and I cannot figure out why that is so.

[[keybind]]
modifer = ["meta"]
keysym = "b"
action = "do_shell"
command= "exec ~/scripts/buku_run"

[[keybind]]
modifiers = ["meta"]
keysym = "n"
action = "do_shell"
command = "exec ~/scripts/rofi_notes.sh"

Hereis an example of a keybind I wrote into config.toml that does work:

[[keybind]]
modifers = ["meta"]
keysym = "p"
action = "do_exec"
executable = "/usr/bin/rofi-pass"

With these results so far, I'm tempted to conclude that the keybound shell commands invoking scripts work insofar as to pass the command to shell. If that's true, then beyond that I do not know why the scripts do not execute.

However, I also noticed that when I used as modifier 'logo' or 'super' the same key press Alt-p would work to call the rofi-pass script into action. When I used pressed 'super+n' it would not (i.e 'Super-L+n'). Having read the config notes, I see I mustn't expect it to , because it is not mapped to mod3, but to mod4. But unexpectedly getting the executuve 'rofi' to run with either ["logo"] or ["'super"] modifier entered in the config when pressing "meta+n" That makes me suspect a bug. Could it be a bug?

Your pointers on getting keybinding with scripts to run in Vivarium would be most welcome (BTW i am new to Wayland and Alacritty also).

One little thing in addition, can you confirm that 'logo' in Vivarium is a keyname for the key signified by various logos like 'Apple' or 'Windows'?

NOTE: I am running Vivarium under latest arch linux-lts kernal. Starting a Wayland Session with TTY command: $ vivarium

inclement commented 3 years ago

But I cannot get them to Here are two example's I wrote into Vivarium's config.toml which do not work in Vivarium, and I cannot figure out why that is so.

I don't see anything wrong with these definitions except that the first has a typo modifier = instead of modifiers = - but I think that's probably a copy and paste mistake only?

Just to check, "meta" refers to the meta-key you set in your config, the meta-key field in the global-config section. Am I right to understand that you have this set to "alt", but that alt+b and alt+n aren't working to call your scripts?

I wondered if the exec part of the shell command is interfering - it isn't necessary but I think it shouldn't matter that you include it, and since you report successfully running your commands in other contexts it probably isn't that.

When I used pressed 'super+n' it would not (i.e 'Super-L+n'). Having read the config notes, I see I mustn't expect it to , because it is not mapped to mod3, but to mod4. But unexpectedly getting the executuve 'rofi' to run with either ["logo"] or ["'super"] modifier entered in the config when pressing "meta+n" That makes me suspect a bug. Could it be a bug?

This does sound like a bug.

Are you restarting Vivarium after these config changes, or using the reload-config functionality? The config reload probably does have some issues, but probably not what you're seeing I think.

Would you be able to post a full config that doesn't do what you expect? Hopefully that will let me reproduce the issue and resolve if/how it's a bug. No need to also provide the scripts you try to call, I can fill them in.

inclement commented 3 years ago

Thanks also for the general comments. I'll try to improve some of the config.toml documentation to make these things clearer, including:

One little thing in addition, can you confirm that 'logo' in Vivarium is a keyname for the key signified by various logos like 'Apple' or 'Windows'?

That's correct, it really refers to the keycode that the key with the windows logo (on most keyboards/laptops) returns, or equivalently this is the same keycode provided by the command (⌘) key on apple keyboards. I'll document this better.

plum commented 3 years ago

Thanks for considerate reply.

Are you restarting Vivarium after these config changes, or using the reload-config functionality? The config reload probably does have some issues, but probably not what you're seeing I think.

Yes, I am restarting. Just to check, "meta" refers to the meta-key you set in your config, the meta-key field in the global-config section. Am I right to understand that you have this set to "alt", but that alt+b and alt+n aren't working to call your scripts

Yes, it's set to "alt"

wondered if the exec part of the shell command is interfering

I tried it with and without exec

modifier = instead of modifiers = - but I think that's probably a copy and paste mistake only?

yes that was a copy and paste mistake.

I'm attaching the full config with '.TXT' tilde (in order to upload it ) as requested, below.

NOTE 1: You'll see my keybind customisations in a section toward the end '### EXECUTE SOME SCRIPTS'

NOTE 2: I have a custom [xkb-config] entry

config(1).TXT

Kind regards, John

inclement commented 3 years ago

I'm a bit perplexed here, what you have seems reasonable and I wasn't able to get any incorrect behaviour while testing it (albeit so far only tested within another vivarium session, although that shouldn't matter).

I was able to confirm that your target executables and shell commands were being called correctly as far as I can tell, and with alt as the modifier key as expected for this config.

I did notice that your example config reuses the "b" keysym. In this case vivarium only runs the first binding, this is something that I need to either change or present a clearer failure for. However, I don't think that explains your weird behaviour unless perhaps you had other now-removed keysym collisions.

Do you have any suggestion for a specific set of steps to reproduce a bad result?

plum commented 3 years ago

AH, re-use of the "b" keysym occurred in re-wrinting entries only after several trials, when upon experiencing failure I switched mappings around in further testing. You're correct it doesn't explain the failure.

I cant think of any suggestions for specific steps, no.

I must thank you for your help; Because you confirm the targets and commands are called correctly, that there is no bug here, I have the confidence to proceed.

inclement commented 3 years ago

Because you confirm the targets and commands are called correctly, that there is no bug here

There might still be a bug that I just wasn't able to reproduce. I'll keep an eye out for issues when taking another look at the keybindings - I need to do some work on this anyway.