Skip to main content

Timeline for xmodmap lost after sleep

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Dec 5, 2023 at 8:44 comment added Daniel sh is POSIX compliant and a subset of bash. In some systems it appears sh would point to bash although nowadays, at least in Ubuntu, sh is pointing to dash instead. $ file -h /bin/sh returns /bin/sh: symbolic link to dash in my case. The reason I used sh -c is that there is no guarantee that the path \bin\bash -c exists although in practice it usually does. (Related: stackoverflow.com/q/5725296/3715151)
Dec 4, 2023 at 17:05 comment added hife Thanks for reminding me of this post, so I could add a revision that may interest you as well: It even triggers the desired key together with the rebind on the first key press. (I remember vaguely that the rebind still behaved better in some situations, so I did not go with xdotool only.) Is sh -c any different from the /bin/bash -c I am using? I just tested it again with xev and see the remap the first time and then the regular Menu key.
Dec 4, 2023 at 16:57 history edited hife CC BY-SA 4.0
Also trigger the actual key
Dec 4, 2023 at 15:19 comment added Daniel I like this solution. I use numpad-zero as control and created a custom shortcut in Ubuntu with this key and the command sh -c 'xmodmap ~/.Xmodmap && notify-send Xmodmap "Xmodmap is active"'. First time I click numpad-zero it enables Xmodmap and the second time it works as control. One issue is that having directly xmodmap ~/.Xmodmap as the command wasn't working for me because it always enabled Xmodmap instead of switching to ctrl on 2nd click, I had to wrap it with the sh -c ''.
S Feb 28, 2022 at 10:24 review First answers
Mar 3, 2022 at 19:35
S Feb 28, 2022 at 10:24 history answered hife CC BY-SA 4.0