Page 1 of 1

[Solved] swap ctrl with alt at logon

Posted: Mon May 05, 2025 12:49 pm
by herbie643
I have a script that does that but it isn't working. I had this problem before and the solution was a sleep command but I have that info.
It was something to do with set xkeyboard or something like that.
Any ideas or does anyone remember this?

Re: swap ctrl with alt at logon

Posted: Mon May 05, 2025 12:52 pm
by j2mcgreg
herbie643 wrote: Mon May 05, 2025 12:49 pm I have a script that does that but it isn't working. I had this problem before and the solution was a sleep command but I have that info.
It was something to do with set xkeyboard or something like that.
Any ideas or does anyone remember this?
QSI please.

Re: swap ctrl with alt at logon

Posted: Mon May 05, 2025 4:08 pm
by Stuart_M
The solution is simple. I don't know which MX Linux version you're using but I just tested it on MX-23.5 Xfce and it works fine. This is how:
  1. Go to /etc/default/keyboard
  2. In the keyboard file, on the line that begins with "XKBOPTIONS" (Line 8), add ctrl:swap_lalt_lctl to it, keeping it in the quotes. For me the line then looked like this:

    Code: Select all

    XKBOPTIONS="grp_led:scroll,terminate:ctrl_alt_bksp,ctrl:swap_lalt_lctl"
  3. Log out/in to take effect.
That change will swap the Left Ctrl and Left Alt keyboard keys and yes, it will survive a reboot. There is no need for adding anything in "Session and Startup" and no sleep command with this solution.

If you no longer want that change then simply remove the ctrl:swap_lalt_lctl portion from that line > log out/in to take effect.



The above comes from this no-longer-available-thread https://forum.mxlinux.org/viewtopic.php ... 97#p617397 titled "Swap left CTRL and left ALT keys" that was made on 8 January 2021. MX Linux has since deleted it so it's forever gone. (Good thing I keep some information in my notes so it won't be deleted.)

Anyway, Post #10 of that no-longer-available-link was made by BitJam and is the source of the above information for me.

Re: swap ctrl with alt at logon  [Solved]

Posted: Mon May 05, 2025 9:03 pm
by herbie643
Thank you. That worked perfectly.