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

How to use Mod4 with xdotool and i3wm?

asked 2013-04-04 19:45:20 +0000

Hibou57 gravatar image

Note: I don't know if my issue is finally with i3wm or with xdotool. If ever my question is wrong here, just tell and suggest another place to ask for it.

Sample case

I have a console opened in workspace #1. I have an application opened in workplace #2. If while in workspace #1, from the keyboard I do $mod+2 and $mod for me is the Win‑key, I'm switching to workplace #2, as expected.

If while in workplace #1, from the console I do xdotool key Super+2, instead of switching to workplace #2, the current window is moved to workplace #2 and I stay in workplace #1, like if I did shit+$mod+2 instead of $mod+2.

I tried with Meta instead of Super, but it does not work neither, and displays an (arg: 2): on the terminal, which I don't know what it is. I tried Mod4, but xdotool complains it does not know what it is. I don't know any other name except Super or Meta or Mod4, for the Win‑key.

My question

Is this an issue with i3wm or an issue with xdotool? How do I properly use xdotool to send keystrokes involving the $mod key which i3wm properly recognizes or properly receives?

edit retag flag offensive close merge delete

Comments

1

What would you like to achieve? Very well possible that there is a better way...

joepd gravatar imagejoepd ( 2013-04-04 19:51:06 +0000 )edit
1

Hi Joepd. I wanted to setup a Demu as an alternative and/or remainder of keystrokes used within i3wm.

Hibou57 gravatar imageHibou57 ( 2013-04-04 20:00:19 +0000 )edit
2

Just an hypothesis: to input “2” on my keyboard, I have to press Shit; perhaps that the reason why `xdotool Super+2` is interpreted as `xdotool Super+Shift+2`. Now, I don't know if it's due to i3wm keyboard input interpretation of if it's due to xdotool.

Hibou57 gravatar imageHibou57 ( 2013-04-04 21:29:24 +0000 )edit
1

Maybe you are right. I tried "xdotool key Super+2" and for me it is working, meaning it switches to workspace 2 and does not move the active window. But why do you have to press Shift to get a "2", anyway?

mschaefer gravatar imagemschaefer ( 2013-04-05 09:15:34 +0000 )edit
2

That's my keyboard which is like this (French layout on a laptop). I'v made some other tests, and if I do `xdotool key Super+Eacute`, I go to workplace #2, because “é” is the letter I get if I press the “2” key without pressing Shift. P.S. I posted something on the xdotool-users groups, and will report any useful answer here.

Hibou57 gravatar imageHibou57 ( 2013-04-05 09:19:41 +0000 )edit

1 answer

Sort by » oldest newest most voted
2

answered 2013-04-05 09:29:56 +0000

Hibou57 gravatar image

updated 2013-04-05 09:31:23 +0000

I may answer my own question partly now.

A possible solution would be to be able to ask xdotool to send key‑code instead of key‑symbols, but I don't know how to do this. However, after some testing, I was able to switch to workplace #2 running xdotool key "Super+Eacute" instead of xdotool key "Super+2", this is dependant on my keyboard layout.

I will update this answer as soon as I get a better (keyboard layout independent) method.

Note this apply with other things too: xdotool key "Super+J" do the same as xdotool key "Shit+Super+J", and xdotool key "Super+j" with a lower‑case “j” has to be used to go to left.

My custom menu is on a good way now.

edit flag offensive delete link more

Comments

1

I am not sure what exactly you want to achieve, but instead of sending the corresponding keys to initiate some action, you could just send the desired commands to i3, like: i3-msg workspace 2

vandannen gravatar imagevandannen ( 2013-04-05 11:00:31 +0000 )edit
2

That's what I looking about in the doc now. I missed it and became aware of it only after I wanted to reply to a question opened by someone else (I'm new to i3wm, and still discovering it). Anyway, I will update the answer if I see fits.

Hibou57 gravatar imageHibou57 ( 2013-04-05 11:05:46 +0000 )edit

Question Tools

Stats

Asked: 2013-04-04 19:45:20 +0000

Seen: 752 times

Last updated: Apr 05 '13