Skip to content

Commit

Permalink
Implement import script
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvelsriram committed Jan 10, 2025
1 parent aa76b2f commit fc4d579
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Extras.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ This script is useful to capture the preferences of the known applications (both
This script is useful to capture the raycast preferences/configurations. It can be used to both export the preferences/settings (from the old system) or import them (into the new system)

```bash
export RAYCAST_SETTINGS_PASSWORD='my-passoword'
capture-raycast-configs.sh e "${PERSONAL_PROFILES_DIR}/extension-backups"
capture-raycast-configs.sh i "${PERSONAL_PROFILES_DIR}/extension-backups"
```

*Please note:*
Expand Down
37 changes: 29 additions & 8 deletions scripts/capture-raycast-configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,41 @@ EOF
elif [[ "${1}" == 'i' ]]; then
! is_file "${target_file}" && error "Couldn't find file: '$(yellow "${target_file}")' for import operation; Aborting!!!"

# TODO: Get this from password manager
password=$RAYCAST_SETTINGS_PASSWORD

open raycast://extensions/raycast/raycast/import-settings-data

# TODO: Need to get import working
osascript <<EOF
tell application "System Events"
key code 36
delay 0.3
key code 36
delay 0.3
keystroke "${target_file}"
delay 0.3
key code 5 using {command down, shift down}
delay 0.3
key code 36
delay 0.3
end tell
keystroke "${target_dir}/Raycast.rayconfig"
delay 0.3
key code 36
delay 0.5
key code 36
delay 0.3
keystroke "$password"
key code 36
delay 0.3
key code 36
delay 0.3
key code 36
delay 1
key code 53
key code 53
end tell
EOF

success "Imported raycast configs from: $(yellow "${target_file}")"
Expand Down

0 comments on commit fc4d579

Please sign in to comment.