unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Ian Eure <ian@retrospec.tv>
To: 69182@debbugs.gnu.org
Subject: bug#69182: home-xmodmap-service-type requires restart to work
Date: Sat, 17 Feb 2024 11:38:54 -0800	[thread overview]
Message-ID: <87r0hakgv0.fsf@retrospec.tv> (raw)

I recently set up home-xmodmap-service-type so I could change the 
PrtSc key on my ThinkPad into a Hyper modifier.  This is my 
configuration:

   (service home-xmodmap-service-type
            (home-xmodmap-configuration
             (key-map '("clear mod3"
                        ("remove mod4" . "Hyper_L")
                        ("keycode 107" . "Hyper_R")
                        ("add mod3" . "Hyper_L Hyper_R")))))

However, after logging into an EXWM session, the PrtSc key is a 
Super modifier, not Hyper.  The service appears to be starting 
successfully:

    l0p!ieure~$ herd status xmodmap
    Status of xmodmap:
      It is running since 11:20:59 AM (35 seconds ago).
      Running value is #t.
      It is enabled.
      Provides (xmodmap).
      Requires ().
      Will be respawned.

The output of `xmodmap -pm' reports:

    xmodmap:  up to 4 keys per modifier, (keycodes in 
    parentheses):

    shift       Shift_L (0x32),  Shift_R (0x3e)
    lock
    control     Control_L (0x25),  Control_L (0x42),  Control_R 
    (0x69)
    mod1        Alt_L (0x40),  Alt_R (0x6c),  Alt_L (0xcc), 
    Meta_L (0xcd)
    mod2        Num_Lock (0x4d)
    mod3        ISO_Level5_Shift (0xcb)
    mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce), 
    Hyper_L (0xcf)
    mod5        ISO_Level3_Shift (0x5c)

Some of my configuration is applied, while other parts are not:

- "clear mod3" isn’t working; mod3 is ISO_Level5_Shift, which is 
  the default.
- "remove mod4 = Hyper_L" isn’t working.  Hyper_L is still on mod4 
  (which is the super modifier), which is the default.
- "add mod3 = Hyper_L Hyper_R" isn’t working.
- The "keycode 107 = Hyper_R" config *is* working, which is what 
  makes PrtSc a super modifier.

If I restart the service, the modifiers work as expected:

    l0p!ieure~$ herd restart xmodmap
    Service xmodmap has been started.
    l0p!ieure~$ guix shell xmodmap -- xmodmap -pm
    xmodmap:  up to 4 keys per modifier, (keycodes in 
    parentheses):

    shift       Shift_L (0x32),  Shift_R (0x3e)
    lock
    control     Control_L (0x25),  Control_L (0x42),  Control_R 
    (0x69)
    mod1        Alt_L (0x40),  Alt_R (0x6c),  Alt_L (0xcc), 
    Meta_L (0xcd)
    mod2        Num_Lock (0x4d)
    mod3        Hyper_R (0x6b),  Hyper_L (0xcf)
    mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce)
    mod5        ISO_Level3_Shift (0x5c)

I haven’t set up anything else that manipulates keymaps, so I’m 
not sure why this isn’t working after login.

I had a suspicion that another service might be running after 
xmodmap and changing the keymap.  The only home service that looks 
like it might do that is x11-display.  However, copying 
`home-xmodmap-service-type' and `my-xmodmap-shepherd-service' into 
my home.scm and editing it to add (requirement '(x11-display)) to 
the shepherd-service doesn’t fix the issue.

This appears to be a timing problem.  If I remove the service from 
my home configuration, but manually run `guix shell xmodmap -- 
xmodmap /gnu/store/g3hgzx8za4qrrdgn5hjqd80gxkb6sifx-config' after 
I log in (the file being the xmodmap configuration created by 
`serialize-xmodmap-configuration'), the keymap is set up how I 
declare it.  So *what* home-xmodmap-service-type does is correct; 
but *when* it does it is not.




             reply	other threads:[~2024-02-18 17:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-17 19:38 Ian Eure [this message]
2024-02-19 19:16 ` bug#69182: home-xmodmap-service-type requires restart to work Nicolas Graves via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0hakgv0.fsf@retrospec.tv \
    --to=ian@retrospec.tv \
    --cc=69182@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).