DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have "Raspberry Pi 3, model B" using a straight Raspbian (recommended) install and I want to disable all CTRL ALT switching to make vt1 vt2 vt3 vt4 vt5 vt6 inaccessible -- specifically, to force the display to remain in the single GUI environment. Is that possible and if so, how?
Please keep in mind, I'm a newbie to Raspberry. I've searched here, on the Raspberry site and googled it to death. Deleting the getty-static.service file didn't work. Also to no avail I tried editing ACTIVE_CONSOLES="/dev/tty[1-6]". Any solution to this?
Thanks pan64. Yes and I found one reference pointing me to:
~/.config/openbox/lxde-rc.xml for the Pi 2
which eventually led me to this file for the Pi 3:
~/.config/openbox/lxde-pi-rc.xml
I don't know what I am doing there though. I tried deleting things in there that looked like something I wanted to disable but that didn't pan out too well. I think this is the block that controls the ATL F4:
Deleting that "A-F4" block did nothing but strangely deleting the block for "A-C-Delete" was effective. I restored the file and I was going to try as you and others suggested to "remap those key bindings to something else". Not sure what the "something else" would be that I can map to safely. I do feel like I am getting closer, finding lots of stuff about "bindings".
There are two ways (at least I think): 1. remove those mappings, so Ctrl-Alt-Fx will do nothing. 2 remap to do something else, like beep or whatever you like.
Hi, and thanks again pan64. When I removed mapping for any other hotkey combo it was affective. That ALT F4 just does not want to lay down and die though. I removed it from all 3 files so I'm beginning to think its hard coded into the kernel or something. I'll play with it some more, put the block of code back in there and see if I can make it beep. Do you know off hand would the action be "beep" or "0x07"? I guess it won't hurt to try either one.
Hello hydrurga and thanks for the post. The xmodmap command seems to work if I execute manually in a terminal window but I can't seem to figure out how to attach it to the kiosk window when I boot into Chrome. I tried putting the xmodmap lines in a cron using @reboot and tried creating a conf script inside /etc/init but no joy there. Also tried putting lines in the /etc/rc.local
According to this - https://www.raspberrypi.org/forums/v...?f=63&t=169935 - "xmodmap won't run until X windows is running, so you should start it in the autostart list not in /etc/rc.local (which runs too early)."
It suggests placing the command in an autostart directory (/home/pi/.config/lxsession/LXDE-pi/autostart) - I'm sure this won't be the exact directory you use as it refers to the LXDE desktop. Which desktop environment are you using?
This is crazy. I thought I was using the LXDE desktop because /home/pi/.config/lxsession/LXDE-pi/autostart is where I auto-launch the browser. If not, how can I tell? I got the start of my config using tips from this site: http://www.pricelessgeek.com/2013/08...web-kiosk.html
Afterwhich my autostart file looks like this and all seems to be working:
@xset s off
@xset -dpms
@xset s noblank
@/usr/bin/chromium-browser --kiosk --disable-restore-session-state http://yoursitehere
@xmodmap -e "pointer = 1 10 9 8 7 6 5 4 3 2"
@pcmanfm --desktop --profile LXDE-pi
Seeing there is already an xmodmap line from the pricelessgeek tip I thought your suggestion looked promising so I tried appending these lines after the browser kiosk call but didn't work so I moved them in front of the browser kiosk call and still did not work:
Very confusing becasue I also have a line in in my rc.local file to disable the VT1 login and that seems to work fine too so it makes no sense to me that neither location works for those xmodmap lines:
I forget where I found that tip and cannot find the reference again now, but I recall them saying that you cannot disable all vt screens, that you need to leave at least one. Their solution was to apply separate systemctl lines for each vt screen. I didn't like that solution because it still allows switching to all the vt screens -- you just can't do anything because the login prompt is not there. I prefer that the CTRL ALT Fx keys just do nothing at all. I can live with CTRL ALT F1 going to a useless screen if thats how it has to be.
Ah, my apologies, you *are* using LXDE then. I didn't realise that this was a popular Raspi option.
My only further suggestion would be to create your own custom keymap using xmodmap -pke > ~/.Xmodmap, edit it according to your needs, and then use xmodmap ~/.Xmodmap to load that map in the autostart file.
I used the NOOBS installation manager, first option at the top:
Code:
Raspbian (RECOMMENDED)
A port of Debian jessie for the Raspberry Pi (full desktop version)
It came with a Chrome browser which offers the kiosk mode so that seemed like a good starting point. Very disappointed with their interpretation of kiosk.
I am guessing this "xmodmap -pke > ~/.Xmodmap" would create a third config file (of a sort) in addition to the rc.local and autostart files I am already using? When I add this new "xmodmap ~/.Xmodmap" to my autostart, does it get added into my existing list of commands with the @ prefix?
Reason I ask, the above autostart did not work after the browser loaded up, but those same xmodmap -pke lines did work in a terminal window when I executed the lines manually (without the @ prefix).
It's the fact that the xmodmap commands don't appear to be running in the autostart file, but that they work when you run them in terminal, that's encouraging me to try to find another way to run the commands (as late in the boot process as possible).
You could even set up a batch file, to be called in autostart in the same way that Chrome is, which carries out the xmodmap commands.
By the way, I don't know exactly how the autostart file works, but personally I would place the call to launch Chrome as the last thing in the file, after any xmodmaps.
Quote:
I am guessing this "xmodmap -pke > ~/.Xmodmap" would create a third config file (of a sort) in addition to the rc.local and autostart files I am already using? When I add this new "xmodmap ~/.Xmodmap" to my autostart, does it get added into my existing list of commands with the @ prefix?
No. Xmodmap allows you to edit the keyboard modifier map and keymap table. It's not a way of carrying out startup commands like e.g. autostart. xmodmap -pke > ~/.Xmodmap creates a xmodmap command file in your profile that gives you more control - you can edit that file as you see fit, and then run xmodmap ~/.Xmodmap at any point to run those xmodmap commands and test if it works as intended. Once you have determined that it works then you can try introducing that latter command into various stages of your startup process to see what works. It's just an alternative approach to the problem. If you're uncomfortable with it then don't worry about using it.
[SOLVED]
Too many days spent scouring over threads for the answer and finally it turns out the solution has nothing to do with the 'xmodmap' command. Found it here:
Originally Posted by zombifier25
NOTE: Be very careful
As root, in the folder /usr/share/X11/xorg.conf.d, create a new file named 50-novtswitch.conf, with its content being:
Of course, like others have said, it may be the only way to recover your system when X fails, so consider yourself before doing.
Thank you zombifier25 (from ubuntuforums)!!
NOTE: The above works on Raspberry PI3 running the LXDE on Devian Jessie ... Very Nicely!!
BTW: zombifier25's warning is moot because you can still ssh into the Raspberry for maintenance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.