Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script for importing Raycast settings #19

Conversation

arunvelsriram
Copy link
Contributor

Dependent PR: #14

  • Fix issue when removing non-existent Raycast settings file
  • Add script to import Raycast settings
  • The password of the Raycast settings file is passed via an env variable. This could be enhanced by fetching from password manager.

Copy link
Owner

@vraravam vraravam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arunvelsriram - pls check if these are valid.

@@ -28,7 +28,7 @@ local target_file="${target_dir}/Raycast.rayconfig"
ensure_dir_exists "${target_dir}"

if [[ "${1}" == 'e' ]]; then
rm -rfv "${target_dir}"/Raycast*.rayconfig
[ -f "${target_dir}"/Raycast.rayconfig ] && rm -rfv "${target_dir}"/Raycast.rayconfig
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the ~/.shellrc file is loaded, let's use the functions defined in it.

Suggested change
[ -f "${target_dir}"/Raycast.rayconfig ] && rm -rfv "${target_dir}"/Raycast.rayconfig
is_file "${target_dir}"/Raycast.rayconfig && rm -rfv "${target_dir}"/Raycast.rayconfig

@@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
password=$RAYCAST_SETTINGS_PASSWORD
password="${RAYCAST_SETTINGS_PASSWORD}"

osascript <<EOF
tell application "System Events"
key code 36
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since the tell has a corresponding end tell should the nested lines be indented? I'm not sure.

key code 36
delay 0.3

keystroke "$password"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
keystroke "$password"
keystroke "${password}"

@vraravam vraravam force-pushed the export-raycast-configs branch 3 times, most recently from 2fcabcf to c8e3d5b Compare January 10, 2025 16:19
@vraravam vraravam deleted the branch vraravam:export-raycast-configs January 11, 2025 13:39
@vraravam vraravam closed this Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants