undo caps lock ctrl swap

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
g33zr

undo caps lock ctrl swap

Post by g33zr »

I'm running Mint 19 on a System76 Sable PC. I swapped caps lock and ctrl using the bash script setxkbmap -option ctrl:swapcaps

However after using this setup for a while, I decided to go back the original configuration, but have been unsuccessful. Is there a script to reverse or remove this option?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12240
Joined: Sun Mar 27, 2016 6:58 pm

Re: undo caps lock ctrl swap

Post by rene »

g33zr wrote: Fri Nov 30, 2018 11:49 am I swapped caps lock and ctrl using the bash script setxkbmap -option ctrl:swapcaps
That's not a script (let alone a bash script) but a simple, direct command; moreover one the effects of are gone at logout/reboot. If they are not for you that means you did in fact add that command to some script --- possibly ~/.xprofile or ~/.profile --- and removing it from there will then undo things.

If you just never logout or reboot: setxkbmap -option resets all options to default (I do believe that in order to just undo ctrl:swapcaps you need to do either that or trawl through your actual keyboard layout in order to correctly undo a specific option).
g33zr

Re: undo caps lock ctrl swap

Post by g33zr »

Many thanks, Rene. My bad. I mistakenly thought the command was a bash script because I saw it referred to as a bash script elsewhere and it was in my bash history file after I ran it.

Your solution was a simple one and it worked. Again, thanks. :D
Locked

Return to “Scripts & Bash”