donnoating Posted January 27, 2022 Share Posted January 27, 2022 (edited) Hello everyone, being an old dog, it's hard for me to learn new tricks. I just received a new MBP M1 14" and being a programmer from times past, I just can't get used to the location a the tilde (~) key. That's why I'd like to exchange the location of tilde (~) with paragraph (§) key. I only have to execute the following once at logon: hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000035,"HIDKeyboardModifierMappingDst":0x700000064},{"HIDKeyboardModifierMappingSrc":0x700000064,"HIDKeyboardModifierMappingDst":0x700000035}]}' I'd like to create any kind of workflow performing the above once automatically at logon. Can anyone give me a hint or two? I could do that using launchctl, but I'd rather have all my automations in one place. Thx in advance, Edited January 27, 2022 by donnoating Link to comment
vitor Posted January 27, 2022 Share Posted January 27, 2022 39 minutes ago, donnoating said: I could do that using launchctl And you’ll have to. By design, Alfred Workflows have to be purposely called, there’s no facility to auto-run them on their own. Link to comment
gohoyer Posted January 27, 2022 Share Posted January 27, 2022 This might be what you want: https://stackoverflow.com/questions/6442364/running-script-upon-login-mac/6445525#6445525 Not on Alfred but.... Link to comment
vitor Posted January 27, 2022 Share Posted January 27, 2022 (edited) @gohoyer That solution takes the long way around and uses a deprecated tool. @donnoating mentioned they know how to do it with launchd; that’s the correct and most straightforward tool for the job—it’s even recommended in the link you posted. Edited January 27, 2022 by vitor gohoyer 1 Link to comment
donnoating Posted January 28, 2022 Author Share Posted January 28, 2022 (edited) 21 hours ago, vitor said: And you’ll have to. By design, Alfred Workflows have to be purposely called, there’s no facility to auto-run them on their own. @vitor, thanks for the help. I did hope there would be some kind of startup hook to execute stuff. Actually used https://rakhesh.com/mac/using-hidutil-to-map-macos-keyboard-keys/ to alter the keyboard layout only when I login. No one else should have to put up with my shenanigans 😉 Edited January 28, 2022 by donnoating Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now