Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #243157

Re: xmodmap settings lost when (usb) keyboard reattached.

From John Crawley <john@bunsenlabs.org>
Newsgroups linux.debian.user
Subject Re: xmodmap settings lost when (usb) keyboard reattached.
Date 2021-12-16 03:30 +0100
Message-ID <DuOGR-6x6-1@gated-at.bofh.it> (permalink)
References <DuFNi-18I-15@gated-at.bofh.it>
Organization BunsenLabs

Show all headers | View raw


On 16/12/2021 01:53, Tim Woodall wrote:
> I run the following command to switch my caps-lock to escape:
> xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
> 
> However, if I disconnect and reconnect my keyboard (I have a KVM switch
> box so this happens quite a lot) the setting is lost.
> 
> Before I start writing udev rules to auto reapply this setting when the
> keyboard is (re)attached, is there some other, better, way to make this
> setting stick?

I don't know if it's better, but there's a simple thing you can try first:

I used to run

setxkbmap -option compose:caps

in my startup script to map the Capslock key to a Compose key. But this would unpredictably drop out.

Now, in /etc/default/keyboard

XKBOPTIONS="compose:caps"

keeps the mapping reliably applied. Maybe there's a similar setting you could try?

-- 
John

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

xmodmap settings lost when (usb) keyboard reattached. Tim Woodall <debianuser@woodall.me.uk> - 2021-12-15 18:00 +0100
  Re: xmodmap settings lost when (usb) keyboard reattached. Vincent Lefevre <vincent@vinc17.net> - 2021-12-15 18:10 +0100
    Re: xmodmap settings lost when (usb) keyboard reattached. Anssi Saari <as@sci.fi> - 2021-12-17 11:40 +0100
  Re: xmodmap settings lost when (usb) keyboard reattached. John Crawley <john@bunsenlabs.org> - 2021-12-16 03:30 +0100
  Re: xmodmap settings lost when (usb) keyboard reattached. David Wright <deblis@lionunicorn.co.uk> - 2021-12-17 18:00 +0100

csiph-web