Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to change the ctrl+alt+Fkey VT switching
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Fri Nov 06, 2015 9:38 am    Post subject: How to change the ctrl+alt+Fkey VT switching Reply with quote

So basically ctrl+alt+F1 switches to VT1 etc by default in Gentoo. I know this can be changed some-how because I have done so in the past but how eludes me.

Basically, I want this to be mod4+F1, as I recall, this happens on such a low level that you have to give keycodes instead of keysyms (or even scancodes) but that's fine.
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Fri Nov 06, 2015 1:36 pm    Post subject: Re: How to change the ctrl+alt+Fkey VT switching Reply with quote

mi_unixbird wrote:
So basically ctrl+alt+F1 switches to VT1 etc by default in Gentoo. I know this can be changed some-how because I have done so in the past but how eludes me.

Basically, I want this to be mod4+F1, as I recall, this happens on such a low level that you have to give keycodes instead of keysyms (or even scancodes) but that's fine.


Quote:
http://www.tldp.org/LDP/intro-linux/html/sect_04_02.html


Quote:
Then init continues to read the /etc/inittab file, which describes how the system should be set up in each run level and sets the default run level. A run level is a configuration of processes. All UNIX-like systems can be run in different process configurations, such as the single user mode, which is referred to as run level 1 or run level S (or s). In this mode, only the system administrator can connect to the system. It is used to perform maintenance tasks without risks of damaging the system or user data. Naturally, in this configuration we don't need to offer user services, so they will all be disabled. Another run level is the reboot run level, or run level 6, which shuts down all running services according to the appropriate procedures and then restarts the system.


I know that inittab is partly responsible for that. Maybe it is inittab related or init related on to exchange the keycombos.

You may check on the init implementation of your box, if there is a configuration parameter for it.

Maybe it is possible to define something in inittab too

--

it may be realted to

https://en.wikipedia.org/wiki/Magic_SysRq_key
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Fri Nov 06, 2015 3:13 pm    Post subject: Reply with quote

I don't have a precise answer, but write to point out that your question is ambiguous, or might be ambiguous.

Ctl-Alt-F1 works from most "X" environments, but all that is required to get from one console to another (once out of "X"), is Alt-Fx.

So, from your question, I think you are asking about key reassignment from whatever environment you have running under "X", maybe KDE, or Gnome, or XFCE, or something else. If my supposition is correct, then you'll need to tell what you are running, under "X," because the various window managers and desk managers have different means of binding keystrokes to functions.

I likely can't be any more help than that, without research, because I am not familiar with the "Mod4" keystroke modifier.
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Fri Nov 06, 2015 3:53 pm    Post subject: Reply with quote

cboldt wrote:
I don't have a precise answer, but write to point out that your question is ambiguous, or might be ambiguous.

Ctl-Alt-F1 works from most "X" environments, but all that is required to get from one console to another (once out of "X"), is Alt-Fx.

So, from your question, I think you are asking about key reassignment from whatever environment you have running under "X", maybe KDE, or Gnome, or XFCE, or something else. If my supposition is correct, then you'll need to tell what you are running, under "X," because the various window managers and desk managers have different means of binding keystrokes to functions.

I likely can't be any more help than that, without research, because I am not familiar with the "Mod4" keystroke modifier.
Yes, you seem to be quite right about that, Just alt+Fx works outside of X. I always assumed that ctrl+alt+x was actually needed.

In that case I'm pretty sure I can make a setuid binary which just calls chvt to get it done and disable the functionality of X altogether.
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Fri Nov 06, 2015 5:57 pm    Post subject: Reply with quote

You don't have to make a binary, all you have to do is bind Mod4-F1 to "chvt 1", using whatever mechanism your X-environment provides for binding keystrokes.

If you want to use Ctl-Alt-F1 for something else, or to be "nothing," you make that assignment too.
Back to top
View user's profile Send private message
mi_unixbird
Tux's lil' helper
Tux's lil' helper


Joined: 24 Jul 2015
Posts: 102

PostPosted: Sat Nov 07, 2015 4:08 pm    Post subject: Reply with quote

cboldt wrote:
You don't have to make a binary, all you have to do is bind Mod4-F1 to "chvt 1", using whatever mechanism your X-environment provides for binding keystrokes.

If you want to use Ctl-Alt-F1 for something else, or to be "nothing," you make that assignment too.
It has to be a setuid binary because only root can chvt. If you assign a keystroke it won't work because of that, those will run as user.
_________________
execctl --path exec filectl --current-directory list
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Sat Nov 07, 2015 7:15 pm    Post subject: Reply with quote

So, "sudo chvt 1" Works for me from the command line.

On my system (I'm the only user) /etc/sudoers is setup to allow users in group "wheel" to run anything without giving password. Obviously, more narrow possibilities exist.

Simpler than making a suid script.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum