You are not logged in.

#1 2021-10-10 12:05:16

sudoku
Member
Registered: 2012-10-31
Posts: 83

[i3wm] native command not working in config

I'm an i3 newbie and I'm setting up my config file.

Can anyone explain why the i3 native

bindsym less move container to output left

does not work in my config file and I have to use

bindsym less exec --no-startup-id i3-msg move container to output left

?

Here's the relevant bit of my config file:

set $mode_hdmi HDMI mode: (o) switch dual/laptop mode, (p) pavucontrol, (<) move container
mode "$mode_hdmi" {
bindsym o           exec --no-startup-id ~/bin/bash/dual-switch.sh
# bindsym less       exec --no-startup-id i3-msg move container to output left
bindsym less       move container to output left
bindsym p           exec --no-startup-id /usr/bin/pavucontrol
## back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+Shift+h mode "$mode_hdmi"

Other bindings work correctly.

Thanks.

Offline

#2 2021-10-13 16:23:57

Stefan Husmann
Member
From: Germany
Registered: 2007-08-07
Posts: 1,207

Re: [i3wm] native command not working in config

Because "move container to output left" isn't a valid Linux command.

Offline

#3 2021-10-13 16:52:24

sudoku
Member
Registered: 2012-10-31
Posts: 83

Re: [i3wm] native command not working in config

Nor is "bindsym". But here we're inside i3's config file, so please familiarize yourself with https://i3wm.org/docs/userguide.html#list_of_commands

Offline

#4 2021-10-13 17:26:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,745
Website

Re: [i3wm] native command not working in config

As a check, do other move commands work in the same binding, e.g.:

bindsym less       move container to workspace number 1

Out of curiosity, what is 'less'?  As it works for the other binding, it's clearly a key ... does that refer to a '<' key or something else?

Last edited by Trilby (2021-10-13 17:26:59)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2021-10-13 19:33:51

sudoku
Member
Registered: 2012-10-31
Posts: 83

Re: [i3wm] native command not working in config

Yes, it is the "<" symbol. It works if I use the "exec i3-msg" workaround, so that's not the issue.

Offline

#6 2021-10-14 00:03:15

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,338

Re: [i3wm] native command not working in config

sudoku wrote:

Yes, it is the "<" symbol. It works if I use the "exec i3-msg" workaround, so that's not the issue.

It may work in i3-msg but it surely won't work with a 'bindsym'
Take the following as an example, suppose you have terminal open on workspace2 you'd like to move to workspace1.
The terminal will just print less '<' as a character to that terminal and not move it to workspace1.
If F.I. you would use your mod key together with less '<' there would be no problem and your terminal would be moved to workspace1

bindsym $mod+less  move container to workspace $space1

edit: I don't want to interfere with what you choose as your bindsyms, but I would suggest a more 'logical' one like:

bindsym $mod+Shift+1 move container to workspace $space1
bindsym $mod+Shift+2 move container to workspace $space2

Last edited by qinohe (2021-10-14 00:09:06)

Offline

#7 2021-10-14 00:46:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,745
Website

Re: [i3wm] native command not working in config

qinohe, the WM grabs the keys before they go to a client program like a terminal - so what you say is not the case.  Further, the OP has said the "less" binding works, just the intended action is failing.  This is why my question about the "less" was under a "out of curiosity" as I was curious, but I knew it wasn't relevant to the present problem.

sudoku, you didn't address whether other move commands work though.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#8 2021-10-14 01:03:24

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,338

Re: [i3wm] native command not working in config

Trilby, just to be sure I tried before I said anything, less is printed to the terminal and the workspace switch wont be executed.
Or I must be missing something, I don't doubt your expertise regarding these kind of subjects, but the above was the result.

Offline

#9 2021-10-14 01:22:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,745
Website

Re: [i3wm] native command not working in config

I just tested under sway (I don't have any of xorg installed anymore) and "bindsym less ..." works fine, but I don't have multiple outputs to test the rest.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2021-10-14 01:24:37

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,338

Re: [i3wm] native command not working in config

Far as I know, besides 'mouse releases' and bindsyms executed in a 'mode' they always made up of at least two keys, '$mod+key'

Offline

#11 2021-10-14 02:46:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 25,745
Website

Re: [i3wm] native command not working in config

Ah, no.  That's definitely not the case.  A majority of users bind media keys as a single key.  But in any case, this *is* in a mode as shown in the first post ... and even if it wasn't, it still works to bind the less key - that has now been well established.  The problem is in the action, not the binding of the key.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2021-10-14 02:59:08

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,338

Re: [i3wm] native command not working in config

Thanks for getting back on it, yes I agree with you the problem is the action.
I also wasn't aware I can create  'single' key bindsyms, I use i3 and besides 'modes' they're all double at least...

Offline

#13 2021-10-14 07:05:49

seth
Member
Registered: 2012-09-03
Posts: 23,994

Re: [i3wm] native command not working in config

bindsym o           exec --no-startup-id ~/bin/bash/dual-switch.sh
# bindsym less       exec --no-startup-id i3-msg move container to output left
bindsym less       move container to output left

dual switch tells me you don't always have two ouptus?
Does the internal command work if you reload the config somewhen at runtime (and certainly after the second output showed up)?

Offline

#14 2021-10-14 07:45:47

sudoku
Member
Registered: 2012-10-31
Posts: 83

Re: [i3wm] native command not working in config

@ Trilby "bindsym less move container to workspace number 1" works: it sends the output to my secondary screen if present, otherwise to a newly created workspace called "1" on my primary.

@qinohe I'm not sure what you mean. If you notice, the whole thing happens inside "mode_hdmi", which is activated with alt+Shift+h

@seth I've tried to reload the config after the second screen is on and still "move container to output left" doesn't work. I still have to go through "i3-msg".

Last edited by sudoku (2021-10-14 07:56:08)

Offline

#15 2021-10-14 14:35:42

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,338

Re: [i3wm] native command not working in config

sudoku wrote:

@qinohe I'm not sure what you mean. If you notice, the whole thing happens inside "mode_hdmi", which is activated with alt+Shift+h

Yeah, sorry about the confusion.
Trilby seems to have tried it and got it to work, but I have tried too and it doesn't work here either.
Well I mostly use 'bindsym $mod+Shift+{l} move left'  and the '{k,l,h}' or the arrows

Offline

Board footer

Powered by FluxBB