You are not logged in.

#1 2021-09-12 10:13:45

xabdax
Member
Registered: 2021-09-12
Posts: 4

Swapping Ctrl and Alt keys for only one program

Coming from MacOs, one thing that I am really missing is the fact that I could copy-paste using Cmd_L+c/v (first key on the left of the spacebar) for every program there is, i.e. in the terminal and in any other program. Now with Arch, I can use Alt_L+c/v in my Suckless Terminal (ST), which is nice since that is what I am used to. Unfortunately, in every other program I need to use Ctrl_L+c/v. I would like to change that and I was thinking about doing the following:

Step 1: Swap Ctrl_L and Alt_L for ST only.

Step 2: Swap Ctrl_L and Alt_L for every program (including ST). This can be easliy accomplished by saving a file called .Xmodmap which looks like

remove control = Control_L
remove mod1 = Alt_L
keysym Control_L = Alt_L
keysym Alt_L = Control_L
add control = Control_L
add mod1 = Alt_L

and simply calling it with "xmodmap .Xmodmap" everytime my computer boots.


So effectively, I will swap the Ctrl_L and Alt_L keys twice for ST so that nothing changes there. After all, ST is working the way I'm used to. On the other hand, every other program (browser, coding environments, etc.) should now allow me to use Alt_L+c/v  instead of Ctrl_L+c/v. Can anyone help me accomplish the first step or suggest an alternative approach to solve this?

Offline

#2 2021-09-12 12:36:21

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,285

Re: Swapping Ctrl and Alt keys for only one program

Swap alt / ctrl (there's an xkboption, "ctrl:swap_lalt_lctl", map ctrl+c to the copy action in st (any of your TEs) and map it away from generating SIGINT

https://wiki.archlinux.org/title/Xorg/K … _setxkbmap
https://superuser.com/questions/160388/ … -as-ctrl-c

Offline

Board footer

Powered by FluxBB