[Solved] swap ctrl with alt at logon  [Solved]

Message
Author
User avatar
herbie643
Posts: 27
Joined: Tue Nov 08, 2022 7:49 pm

[Solved] swap ctrl with alt at logon

#1 Post 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?
Last edited by herbie643 on Mon May 05, 2025 9:05 pm, edited 1 time in total.

User avatar
j2mcgreg
Global Moderator
Posts: 6803
Joined: Tue Oct 23, 2007 12:04 pm

Re: swap ctrl with alt at logon

#2 Post 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.
HP 15; ryzen 3 5300U APU; 500 Gb SSD; 8GB ram
HP 17; ryzen 3 3200; 500 GB SSD; 12 GB ram
Idea Center 3; 12 gen i5; 256 GB ssd;

In Linux, newer isn't always better. The best solution is the one that works.

Stuart_M
Posts: 692
Joined: Wed Aug 07, 2019 7:10 pm

Re: swap ctrl with alt at logon

#3 Post 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.

User avatar
herbie643
Posts: 27
Joined: Tue Nov 08, 2022 7:49 pm

Re: swap ctrl with alt at logon  [Solved]

#4 Post by herbie643 »

Thank you. That worked perfectly.

Post Reply

Return to “XFCE Desktop Environment”