You are not logged in.
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
Because "move container to output left" isn't a valid Linux command.
Offline
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
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
Online
Yes, it is the "<" symbol. It works if I use the "exec i3-msg" workaround, so that's not the issue.
Offline
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
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
Online
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
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
Online
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
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
Online
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
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
@ 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
@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
Hello all,
I realized during reading this thread that I necessarily pressed a shift key to send "<" [less] or ">" [greater], and so thought to add "Shift" to the bindsym:
...
bindsym $mod+Shift+less exec dunstctl history-pop
bindsym $mod+Shift+greater move container to workspace 3
...
These are both successful on my end.
-TK ☦️
-tk ☦
"For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life." (John 3:16 KJV)
"Jesus saith unto him, I am the way, the truth, and the life: no man cometh unto the Father, but by me." (John 14:6 KJV)
https://discord.gg/orthodoxchristian
Offline