Change/Disable F4 hotkey for terminal access
-
Hi guys,
I don't want the terminal to be accessible with the keyboard (pressing F4).
Is it possible to disable this, so it's only accessible via SSH?Or change the key combination to something more complicated?
Retropie version 4.4.2
Thanks!
-
Hi Guys,
I found a workaround after days off searching
Found a guide online how to create a shutdown script called by a trigger.-
thd --dump /dev/input/* --> Find out the event name of your click/tap/keypress
-
sudo nano /etc/trigger.sh --> create script file:
#!/bin/bash
sudo /sbin/shutdown now
-
sudo chmod +x /etc/trigger.sh --> make the script executable
-
sudo nano /etc/triggerhappy/triggers.d/enterkey-shutdown.conf --> create a file for each trigger you want:
KEY_ENTER 1 /etc/trigger.sh
#(replace KEY_ENTER with the code you get from thd --dump /dev/input/* when pressed)
-
sudo systemctl restart triggerhappy.service --> restart the service
-
sudo visudo --> add the line below to the end, user nobody needs root previlages to power off the pi
nobody ALL =NOPASSWD: /sbin/shutdown*
- All done, just create extra triggers in the /etc/triggerhappy/triggers.d/ folder for al the keys you want
I know it's not clean, but it works.
Created .conf files in the triggers.d/ folder for each letter in the alphabet and both the enter keysThe F4 trigger did not work, guess this only works when the terminal is already open.
But with conf files for all the letters, when someone wants to start typing, it goes in shutdownAnd SSH still works because the keyboard isn't attached to the Pi then :)
-
-
Thanks for sharing your workaround for others.
-
@de_jean125 You can edit the ES source code and compile. The line you're looking for is this one. You can either change the SDL key in that line or remove lines 241 to 247 if you wish to disable F4.
This does mean that you would have to go through this process of editing the source code every time you wish to update ES.
-
@de_jean125 Wouldn't it be easier to just edit the
autostart.sh
file that starts Emulationstation and just add ashutdown
command after that ? If ES exits, then the next command will be the shutdown. -
Wow, thank you !!!
I adjusted to autostart.sh with the following:
echo " ...some warnings..."
sync
sleep 10
emulationstationecho "...some warnings..."
sleep 10
sync && sudo rebootThe first time someone tries, he'll get a warning and emulationstation starts again after 10 sec.
Second time it will reboot.Removed the F4 trigger, but left all the other ones.
So if you press a key, it will still reboot. -
@de_jean125 said in Change/Disable F4 hotkey for terminal access:
The first time someone tries, he'll get a warning and emulationstation starts again after 10 sec.
Second time it will reboot.Nice idea. :)
A pimped version would be to display a appropriately explicit picture instead of text. 😈 Alas, I don't know a command that would do that.
-
@de_jean125 Why do you need this ?
-
@de_jean125 Do you want to sell something?
-
No, i'm building one for my dad, but he thinks he's an expert.
Don't want to troubleshoot it every week xD -
@de_jean125 said in Change/Disable F4 hotkey for terminal access:
No, i'm building one for my dad, but he thinks he's an expert.
Oh, come on, you're not letting him tinker with the Raspberry Pi. Better get a 2nd sdcard with a backup system, so he can experiment.
-
@de_jean125 @mitu If my dad once would tell me about ...
"Son, there is a hidden terminal in ES if you press F4."
Then I would answer: "Dad... you are a nerd" -
you don't know my dad :p
-
Or just press Alt+2, Alt+3, etc.
-
That's why i also use the triggers.
Made config files for all the letters in the alphabet, when he wants to start typing a command, the pi performs a shutdown.Pi is only accessible with one ip, using host.allow config and ssh.
Gave it also a static ip in the 10.x.x.x range. -
-
@de_jean125 Something like that, yes. :)
My first guess was that it was for your kid(s), by the way.
You could even let it get nastier … "Stop or I'll hack into your bank account and send all of your money to homes for retired game programmers!"
-
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.