The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

[SOLVED] How to disable all default keybinding?

asked 2014-09-18 10:51:58 +0000

osp gravatar image

updated 2014-09-30 09:32:37 +0000

I am building web kiosk with chrome in kiosk mode and decide for i3 from my own post on (google how-to-force-xscreensaver-to-stay-on-top)

My problem is the key binding - I need the kiosk to be foolproof. In previous wm (matchbox) xmodmap was great, but with i3 it seems it is completely ignored (for example disabling F11 in xmodmap was unachievable - loaded from .xinitrc). But disabling with bindcode and bindsym could work.

Can I use exhausting bindcode/bindsym configuration where I effectively disable all i3 stuff? Is there a list or command to list all active keybindings? Can I just do something like: bindsym $mod exec /bin/true

or something similar and be done with it?

I need to make F1-12 keys and their combinations to do nothing and also some other shortcuts (ctrl+n, and combination with mod key). Plus I want to eliminate all i3 special keybinding. With another wm (matchbox) I used xmodmap to render F11 useless (toggle fullscreen) and other F-keys too.


So, xmodmap I didn't make to work with i3, so at least I understood a little bit how i3 config file works (I think), but one last problem remains. I need to disable WinKey+F1-12 and when I try bindsym Mod4+F1 exec --no-startup-id /bin/true it does not work, for disabling F11 key this does work bindsym F11 exec --no-startup-id /bin/true so I guess syntax is ok.


After a while I returned to this Kiosk problem and finally solved it!

I managed to disable all F-keys, combinations with Win-key (Super_L) and also succeed in disabling Menu key and Right-Click button!

I cannot post files so just snippets - I needed to have this in my i3 config: bindcode 67 --no-startup-id /bin/true . . .

but it didn't work alone (and not without it also...), but I added this MAGIC: exec_always --no-startup-id /usr/bin/xmodmap /home/live/.Xmodmap and in .Xmodmap is: keycode 67 = NoSymbol . . . keycode 133= NoSymbol <<< THIS IS WIN-KEY and added also this for menu key and right-click: keycode 135= NoSymbol <<< I have czech layout (xev is your friend) pointer = 1 2 32 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 thanks to this guy (google up: xmodmap disable right click) - first link

P.S. sorry for formatting, but not my fault - no pre tag...

edit retag flag offensive close merge delete


i3 only uses keybindings that you define in the config file; so if you do not define any, there won't be any. eliminating default keybindings is therefore achieved by just leaving them out. you should be able to use xmodmap to "disable" keys in general, e.g. for f1 `keycode 67 = NoSymbol`.

vandannen gravatar imagevandannen ( 2014-09-18 20:47:30 +0000 )edit

I made ~/.Xmodmap file with these lines `keycode 67 = NoSymbol` from keycode 67-76 and 95-96 and I am loading it in .xinitrc: `xmodmap ~/.Xmodmap` but still not working - when I hit F11 browser switches between fullscreen and normal mode.

osp gravatar imageosp ( 2014-09-19 06:57:39 +0000 )edit

The only thing what works is disabling opening of new window with this in i3 config file: `bindsym ctrl+n exec --no-startup-id /bin/true` but also I need badly to disable those F1-12 keys

osp gravatar imageosp ( 2014-09-19 07:03:27 +0000 )edit

Kinda surprised no one bothered to mention that if you're running only one X application, you don't even need a window manager. 'xinit /path/to/application $* -- :1' will start the specified application in X, and nothing else. Only the application's keybindings will take effect.

ANOKNUSA gravatar imageANOKNUSA ( 2014-10-01 19:16:04 +0000 )edit

to ANOKNUSA: yeah, I know about that option, funny I didn't think of it, but maybe there would be another problems like how to force the window to be "maximized" etc. - anyway, with how the setup is now, I am kinda happy.

osp gravatar imageosp ( 2014-10-02 09:19:15 +0000 )edit

3 answers

Sort by » oldest newest most voted

answered 2015-06-01 04:44:37 +0000

kousu gravatar image

updated 2015-06-01 04:49:46 +0000

I recently stumbled into the same mission, and I came up with a script. This question prompted me to clean it up and publish it: xkiosk.

For posterity, the trick to disabling all of i3 are in these lines (this works as of i3 4.10.2. it seems that the config file is still in flux):

# disable keybindings
# (by not writing any)

# disable titlebars
# there isn't any way to totally disable them afaik
# but we can make them reallllly smalllllll (because it's .ttf)
font pango:monospace 0
bindsym button2 nop  # disable clicks on titlebars

# in new windows do happen, make them tabbed
# but by disabling clicks on titlebars they cannot be switched between
workspace_layout tabbed

## disable borders around windows
new_window none
new_float none

# hide the status bar
# XXX a very recent change to i3 changed from workspace_bar no -> bar { mode invisible } being the way to hide the bar.
bar { mode invisible }

I hadn't published it before because I think kiosks cover a much wider range of use cases than I am picturing. There's a lot not covered in xkiosk, like disabling the Firefox debugger or turning on xidle to kick the user out after a time, but I'd appreciate feedback to drag it towards something covering most cases.

edit flag offensive delete link more


That change you are referring to in the bottom is not really recent… ;)

Airblader gravatar imageAirblader ( 2015-06-01 05:15:50 +0000 )edit

answered 2014-09-18 11:49:19 +0000

osp gravatar image

updated 2014-09-19 07:37:03 +0000

I was able to make this ugly hackish config file to cripple the F-keys, but still don't understand why this doesn't work: bindsym $mod+F1 exec --no-startup-id /bin/true when I set $mod to Mod4 (win key):, I was unable to make sane formatting here, also I cannot use attachments and post links :)

edit flag offensive delete link more


I am not sure what you want to achieve right now. Maybe edit the question and explain in more detail what the goal is here.

vandannen gravatar imagevandannen ( 2014-09-18 17:32:03 +0000 )edit

I edited it, I just need to make the F1-12 unusable and possibly other key combinations - don't know how to better describe it.

osp gravatar imageosp ( 2014-09-18 17:42:13 +0000 )edit

Just don’t define this as a mode, but make the contents of your mode the contents of the i3 config file.

Michael gravatar imageMichael ( 2014-09-19 06:02:41 +0000 )edit

answered 2014-09-18 10:56:24 +0000

vandannen gravatar image

updated 2014-09-18 10:56:44 +0000

you could use modes to toggle default i3 keybindings on and off. See for a pass-through mode, which would effectively disable all keybindings except the ones you define in the mode itself: pass-through mode

edit flag offensive delete link more


wow, that was fast :)

osp gravatar imageosp ( 2014-09-18 11:00:26 +0000 )edit

That pass-through thing seems to be the way to go - I have one question: Could I have i3 config file like this: `mode "kiosk" { }` So there would be no way to get default mode?

osp gravatar imageosp ( 2014-09-18 11:02:47 +0000 )edit

sure, you could do that, but then you would have no keybinding to switch back to "default" mode, where all your keybindings are defined. "default" mode actually conforms to keybindings that are defined outside of any mode in the config file.

vandannen gravatar imagevandannen ( 2014-09-18 11:11:40 +0000 )edit

Hm, I am still unsuccessfull to achieve of disabling F1-12 keys and - can you help me with that config file? I have to make a new answer - it has more then 200 characters or so.

osp gravatar imageosp ( 2014-09-18 11:38:56 +0000 )edit

Question Tools

1 follower


Asked: 2014-09-18 10:51:58 +0000

Seen: 1,175 times

Last updated: Jun 01