mac-playbook icon indicating copy to clipboard operation
mac-playbook copied to clipboard

Mission control hotkeys

Open kinglouie opened this issue 7 years ago • 3 comments

While creating my own dev-playbook I used yours as a reference and read that you create the mission control hotkeys by hand. I investigated that matter and came up with the following ansible task:

- name: Set space changing hotkeys (Create dict).
  command: >
    /usr/libexec/PlistBuddy ~/Library/Preferences/com.apple.symbolichotkeys.plist
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }} dict"
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:enabled bool true"
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:value dict"
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:value:parameters array"
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:value:type string \"standard\""
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:value:parameters: integer 65535"
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:value:parameters: integer {{ {1: 18, 2: 19, 3: 20, 4: 21, 5: 23, 6: 22, 7: 26, 8: 28, 9: 25}[item.1] }}"
    -c "Add :AppleSymbolicHotKeys:{{ item.1 + 117 }}:value:parameters: integer 262144"
  with_indexed_items: [1, 2, 3, 4, 5, 6, 7, 8, 9]

I just wanted to let you know since I greatly benifited from you playbook. I also created an ansible role for a lot of macOS settings which also has the mission control hotkeys included.

kinglouie avatar Jan 26 '18 14:01 kinglouie

Awesome! Thanks for the tip. At some point when I have time over again I'll switch over to your role 👍

oxyc avatar Feb 02 '18 14:02 oxyc

ping @geerlingguy you might be interested in https://github.com/kinglouie/ansible-role-macos as well

oxyc avatar Feb 02 '18 14:02 oxyc

Quite right about that! Looks like a nice role.

geerlingguy avatar Feb 14 '18 04:02 geerlingguy