Jump to content

d3v1an7

Member
  • Posts

    3
  • Joined

  • Last visited

d3v1an7's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. I've mashed up a bit of a hack in the meantime, but it's pretty fragile. I'm making some assumptions on what might be in the hash based on examples I can find, and my own hash. Also assuming that there is only one hashed directory in the preferences bundle. - name: find alfred preferences localhash find: paths: "{{ home }}/Library/Application Support/Alfred 2/Alfred.alfredpreferences/preferences/local" file_type: directory patterns: "[0-9a-f]{40}" use_regex: True register: alfred_preferences_localhash - name: write alfred defaults (plistbuddy) shell: /usr/libexec/PlistBuddy -c "{{ item.command }}" "{{ alfred_preferences_localhash.files[0].path }}/{{ item.file }}" with_items: # Enable clipboard history - { command: "Add enabled bool true", file: "features/clipboard/prefs.plist" } # Set hotkey to command+space - { command: "Set default:key 49", file: "hotkey/prefs.plist" } - { command: "Set default:mod 1048576", file: "hotkey/prefs.plist" } - { command: "Set default:string Space", file: "hotkey/prefs.plist" } register: alfred_plistbuddy failed_when: "alfred_plistbuddy.stderr and 'Entry Already Exists' not in alfred_plistbuddy.stderr"
  2. Thanks @deanishe. Even with sync enabled, I still can't seem to find a way to access the preferences I'm trying to get at: Before sync enabled: ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/preferences/local/[alfred_preferences_localhash]/hotkey/prefs.plist ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/preferences/local/[alfred_preferences_localhash]/features/clipboard/prefs.plist After sync enabled: ~/Documents/Alfred.alfredpreferences/preferences/local/[alfred_preferences_localhash]/hotkey/prefs.plist ~/Documents/Alfred.alfredpreferences/preferences/local/[alfred_preferences_localhash]/features/clipboard/prefs.plist Without access to the alfred_preferences_localhash variable outside of Alfred, I'm struggling to find a way to update those preferences on a fresh install.
  3. Hi there, I'm putting together a quick system provisioning script (specifically changing the Alfred shortcut key, and enabling clipboard history), and I am having trouble figuring out how to access plist files that are tucked away in the preferences bundle. I've come across `alfred_preferences_localhash` (which is exactly what I need), but from the looks of things, these variables only seem to be available to workflows. Is there any way to access these vars, or any other way to work out the hash when running scripts outside of Alfred? Thanks, Ben
×
×
  • Create New...