You are not logged in.
Pages: 1
Ok, I've been trying to figure this out on my own, but a few hours fiddling with xmodmap and XKB hasn't gotten me anywhere, so I'll ask: in an X session, the default keybinds to switch to a tty are Ctrl+Alt+F#. How would I go about changing this keybind to something else, say, Alt+F#, like it is when I'm already focused on a tty?
Last edited by Pavlov (2015-05-22 03:44:03)
Offline
Offline
I looked at that, but it seemed like kind of a hack-y workaround. Also chvt needs elevated privileges when inside of an X session to grab the file descriptor for the console, so it's not quite suitable unless I want to introduce some needless security holes.
I figured out from my keymap table that the functionality for changing to a tty is bound to the XF86Switch_VT_# keysymbols. I'm just not sure how to force something like Alt+F2 to produce the keysymbol XF86Switch_VT_2. None of the keysym columns in the keymap seem to work for that. I've only managed to get plain 'F2' and Shift+F2 to resolve correctly to it.
Edit: Oh, if you meant the third answer to that, then it unfortunately doesn't work for Alt+F# specifically. The Alt+F# rules are already in the console mappings, but it seems like Xorg intercepts them somehow. I would need a way to stop that interception.
Last edited by Pavlov (2015-04-25 02:01:56)
Offline
Ok, I have managed to divine the answer after much head-bashing. The configuration for the X11 virtual terminal switching is in /usr/share/X11/xkb/symbols/srvr_ctrl. There are as series of blocks like this for each VT:
key <FK01> {
type="CTRL+ALT",
symbols[Group1]= [ F1, F1, F1, F1, XF86_Switch_VT_1 ]
};
To have it to use ALT+F1 instead of CTRL+ALT+F1, change it to:
key <FK01> {
type="PC_ALT_LEVEL2",
symbols[Group1]= [ F1, XF86_Switch_VT_1 ]
};
For any other varient, look at the files in /usr/share/X11/xkb/types and find a type that corresponds to what you want, or add one of your own.
Offline
My solution (to change from X to tty2 with Eject instead of Ctrl+Alt+F2) was to
1. Find the keycode and keysym of Eject by xev which are 169 and XF86Eject with my keyboard
2. Replace the line
key <I169> { [ XF86Eject ] };
with
key <I169> { [ XF86_Switch_VT_2 ] };
in /usr/share/X11/xkb/symbols/inet
Offline
Pages: 1