Disabling Shutdown Shortcut on Debian Installed Mac Mini (Late 2014)
If you're working with an old Mac Mini (Late 2014) running a fairly basic Debian Bookworm installation without an X server or fbcon, and you're constantly hopping between terminals, you might find the shutdown shortcut (Control + Eject) inconvenient.
Understanding the Shutdown Shortcut
The shutdown shortcut is a feature that allows you to quickly shut down your Mac by pressing Control + Eject. However, this shortcut can be problematic if you're using a Debian installation without an X server or fbcon. In such cases, you might accidentally trigger the shutdown process while switching between terminals.
Disabling the Shutdown Shortcut
To disable the shutdown shortcut, you can modify the keyboard layout file. Here's how to do it:
1. Open the keyboard layout file for editing:
sudo nano /usr/share/X11/xkb/symbols/mac
2. Locate the following section of the file:
partial alphanumeric_keys
xkb_symbols "macintosh" {
...
key { [ dead_grave, dead_acute, dead_circumflex, dead_tilde ] };
key { [ 1, exclam, 1, exclamdown ] };
key { [ 2, at, twosuperior, section ] };
key { [ 3, numbersign, threesuperior, masculine ] };
key { [ 4, dollar, onequarter, onehalf ] };
key { [ 5, percent, threequarters, superior ] };
key { [ 6, asciicircum, dead_diaeresis, dead_abovering ] };
key { [ 7, ampersand, braceleft, deadabovedot ] };
key { [ 8, asterisk, braceright, dead_doubleacute ] };
key { [ 9, parenleft, less, dead_cedilla ] };
key { [ 0, parenright, greater, dead_ogonek ] };
key { [ minus, underscore, dead_belowdot, dead_macron ] };
key { [ equal, plus, dead_abovedot, dead_doublegrave ] };
key { [ q, Q, at, dead_doubleacute ] };
key { [ w, W, numbersign, dead_caron ] };
key { [ e, E, eacute, EuroSign ] };
key { [ r, R, asciitilde, dead_breve ] };
key { [ t, T, apostrophe, dead_abovering ] };
key { [ y, Y, yen, superior ] };
key { [ u, U, udiaeresis, Udiaeresis ] };
key { [ i, I, idiaeresis, dead_doubleacute ] };
key { [ o, O, ograve, dead_circumflex ] };
key <AD10> { [ p, P, dead_abovedot, dead_cedilla ] };
key <AD11> { [ bracketleft, braceleft, dead_belowdot, dead_doublegrave ] };
key <AD12> { [ bracketright, braceright, dead_macron, dead_abovedot ] };
...
};
3. Comment out the following lines by adding a hash (#) at the beginning of each line:
key <AD11> { [ bracketleft, braceleft, dead_belowdot, dead_doublegrave ] };
key <AD12> { [ bracketright, braceright, dead_macron, dead_abovedot ] };
4. Save the file and exit the editor.
5. Update the keyboard mapping:
setxkbmap mac
Disabling the shutdown shortcut on a Debian-installed Mac Mini (Late 2014) can be done by modifying the keyboard layout file. By commenting out the lines responsible for the Control + Eject shortcut, you can prevent accidental shutdowns while switching between terminals.
References
- Debian Bookworm:
- X Keyboard Extension:
- Mac Keyboard Layout: