The i3 FAQ has migrated to https://github.com/i3/i3/discussions. All content here is read-only.
Ask Your Question
3

Problem with moving windows between workspaces on us keyboard layout

asked 2013-03-05 14:57:38 +0000

updated 2013-03-12 11:16:15 +0000

EDIT: As the comment of njsg states, the obvious solution are keycodes instead of keysyms. Using 'bindcode $mod+Shift+10,11,12,...' works; xev is your friend for finding the keycodes!

Hello,

I'm pretty new to i3 and I ran into a serious problem with workspace switching. Since i am from Germany, my laptop keyboard has german layout. However, at work I use an external keyboard with us layout since for programming I like that layout better. I have thus written a small script that allows me to switch between german and us layout and I have successfully bound it to my F11 key. The command within the script are

'setxkbmap -layout de' and 'setxkbmap -layout us -variant intl'

So much for the setting, because I don't know if the problem is related to that. My problem is as follows: Having us layout enabled, whenever I press $mod+Shift+num, this does work only for a few numbers, namely 1,4,5,7,9,0 (strangely, the last three key combinations actually move the window to workspace 6,8,9 instead of 7,9,10). For the other numbers, doing it on a terminal gives @,#,^,* (which is Shift+num without the mod key). I have tries this with both mod4 and mod1 as mod key with the result being the same. However, with the german layout everything works well.

So do I have to change the keymap in a different fashion? Switching to us layout WITHOUT specifying -variant intl didn't change anything. I would be very glad for suggestions!

Best, Michael

edit retag flag offensive close merge delete

Comments

1

Check your i3 configuration file, the "issue" is that the "move to workspace" commands aren't specified as mod+shift+num, but as mod+shift+char, where char is what you get with shift+num.

njsg gravatar imagenjsg ( 2013-03-05 15:14:38 +0000 )edit
1

Thanks, I was already writing my reply to MeanEYE when your post arrived!

mschaefer gravatar imagemschaefer ( 2013-03-05 15:34:28 +0000 )edit

As you are switching between layouts, I *think* it is possible to specify keycodes instead of symbols, so that the mappings work for both keyboard layouts.

njsg gravatar imagenjsg ( 2013-03-05 15:48:04 +0000 )edit
1

Sorry njsg, I didn't read your comment, I just went back to this topic to post that I found the exact same solution ;-) Nevertheless, thank you!

mschaefer gravatar imagemschaefer ( 2013-03-12 11:13:36 +0000 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-03-05 15:13:46 +0000

MeanEYE gravatar image

If you are using Shift as a part of modifiers you can't use numbers as they turn into symbols then.

bindsym $mod+1 workspace "1: Chat"
bindsym $mod+2 workspace "2: Web"
bindsym $mod+3 workspace "3: Code"
bindsym $mod+4 workspace "4: Misc"
bindsym $mod+5 workspace "5: FM"
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
bindsym Ctrl+Mod1+Left workspace prev
bindsym Ctrl+Mod1+Right workspace next

bindsym $mod+Shift+exclam move workspace "1: Chat"
bindsym $mod+Shift+at move workspace "2: Web"
bindsym $mod+Shift+numbersign move workspace "3: Code"
bindsym $mod+Shift+dollar move workspace "4: Misc"
bindsym $mod+Shift+percent move workspace "5: FM"
bindsym $mod+Shift+asciicircum move workspace 6
bindsym $mod+Shift+ampersand move workspace 7
bindsym $mod+Shift+asterisk move workspace 8
bindsym $mod+Shift+parenleft move workspace 9
bindsym $mod+Shift+parenright move workspace 10
edit flag offensive delete link more

Comments

the i3 users guide uses shift plus numbers. `bindsym $mod+Shift+1 move container to workspace 1`

dfc gravatar imagedfc ( 2015-07-21 17:17:35 +0000 )edit
2

answered 2013-03-05 15:33:05 +0000

updated 2013-03-05 15:36:36 +0000

First of all, thank you for the fast reply :-) You mention not to use numbers together with Shift. Okay, maybe my post was a bit mistakable. I did not put a "bindsym $mod+Shift+1 ..." into my config file; I just wanted to say that I press these buttons :-)

Nevertheless, you post brings me to the bottom of the problem. Instead of that what you posted, my config file (which comes from i3-config-wizard) has the sequence of characters on a german keyboard (exclam,quotedbl,section,...) which explains the malfunction as well as the strange behaviour on some numbers.

So as I see it my setting can never work with Shift. For the moment I exchanged Shift with CTRL which now works perfectly!

P.S.: Is it possible to mark a question as "solved" or something?

edit flag offensive delete link more

Comments

Glad you solved it. :D

MeanEYE gravatar imageMeanEYE ( 2013-03-05 15:36:20 +0000 )edit

Yup, it is. Click on checked signed near the answer you find satisfying.

MeanEYE gravatar imageMeanEYE ( 2013-03-05 15:38:14 +0000 )edit

Question Tools

Stats

Asked: 2013-03-05 14:57:38 +0000

Seen: 567 times

Last updated: Mar 12 '13