diff --git a/README.md b/README.md index 61735f2..b0102fb 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,11 @@ List File Stream contents from Google Drive -⤓ Download Workflow - -> On Alfred 4 use alternative link +⤓ Install on the Alfred Gallery ## Usage -Run the Seach Keyword (default: `gd`) or Folder Seach Keyword (default: `gdf`) to filter the contents of your Google Drive. +Search the contents of your Google Drive via the Search Keyword (default: `gd`) or Folder Search Keyword (default: `gdf`). ![Alfred search for gd](Workflow/images/about/gd.png) @@ -18,9 +16,7 @@ Run the Seach Keyword (default: `gd`) or Folder Seach Keyword (default: `gdf`) t * : Reveal in Finder. * : Search on Google Drive’s website. -You’ll be asked to build the cache on your first run. A notification will show when it’s ready. The more files you have, the longer the wait. A macOS launchd agent will be loaded to do it daily and on boot. - -To rebuild the cache on demand, run `:gdrebuildcache`. +You’ll be asked to build the cache on your first run. A notification will show when it’s ready. The more files you have, the longer the wait. A macOS launchd agent will be loaded to do it daily and on boot. If necessary, an immediate cache rebuild can be forced with the `:gdrebuildcache` keyword. The [Universal Actions](https://www.alfredapp.com/help/features/universal-actions/) make it straightforward to copy and move files to a Google Drive folder. diff --git a/Workflow/info.plist b/Workflow/info.plist index fddec34..0bac281 100644 --- a/Workflow/info.plist +++ b/Workflow/info.plist @@ -3,7 +3,7 @@ bundleid - com.alfredapp.googledrive + com.alfredapp.vitor.googledrive connections 0364D5B3-0C34-4B98-93E5-9A1A625A84C3 @@ -89,16 +89,6 @@ 24E99691-8B40-4D5E-9803-AC2BDDEDCD32 - - destinationuid - D33C8AF8-FC41-4038-A469-3E65C7F569C8 - modifiers - 0 - modifiersubtext - - vitoclose - - destinationuid D5A28DD0-88F4-4CB2-A750-118B1E0ADEE7 @@ -629,8 +619,6 @@ 0 hotmod 0 - hotstring - leftcursor modsmode @@ -694,101 +682,6 @@ version 3 - - config - - concurrently - - escaping - 0 - script - # Special values for OneUpdater reuse -readonly workflow_webaddress="$(/usr/libexec/PlistBuddy -c 'print webaddress' './info.plist')" -readonly workflow_repo="$(basename "$(dirname "${workflow_webaddress}")")/$(basename "${workflow_webaddress}")" - -# THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH. -readonly remote_info_plist="${workflow_webaddress}/raw/main/Workflow/info.plist" -readonly workflow_url="${workflow_repo}" -readonly download_type='github_release' -readonly frequency_check='4' - -# FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED! -function abort { - echo "${1}" >&2 - exit 1 -} - -function url_exists { - curl --silent --location --output /dev/null --fail --range 0-0 "${1}" -} - -function notification { - local -r notificator="$(find . -type d -name 'Notificator.app')" - if [[ -n "${notificator}" ]]; then - "${notificator}/Contents/Resources/Scripts/notificator" --message "${1}" --title "${alfred_workflow_name}" --subtitle 'A new version is available' - return - fi - - local -r terminal_notifier="$(find . -type f -name 'terminal-notifier')" - if [[ -n "${terminal_notifier}" ]]; then - "${terminal_notifier}" -title "${alfred_workflow_name}" -subtitle 'A new version is available' -message "${1}" - return - fi - - osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"A new version is available\"" -} - -# Local sanity checks -readonly local_info_plist='info.plist' -readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")" - -[[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.' -[[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'." -[[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number." - -# Check for updates -if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then - if ! url_exists "${remote_info_plist}"; then abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable."; fi # Remote sanity check - - readonly tmp_file="$(mktemp)" - curl --silent --location --output "${tmp_file}" "${remote_info_plist}" - readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")" - - if [[ "${local_version}" == "${remote_version}" ]]; then - touch "${local_info_plist}" # Reset timer by touching local file - exit 0 - fi - - if [[ "${download_type}" == 'page' ]]; then - notification 'Opening download page…' - open "${workflow_url}" - exit 0 - fi - - download_url="$([[ "${download_type}" == 'github_release' ]] && curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest" | grep 'browser_download_url' | head -1 | sed -E 's/.*browser_download_url": "(.*)"/\1/' || echo "${workflow_url}")" - - if url_exists "${download_url}"; then - notification 'Downloading and installing…' - curl --silent --location --output "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow" "${download_url}" - open "${HOME}/Downloads/${alfred_workflow_name}.alfredworkflow" - else - abort "'workflow_url' (${download_url}) appears to not be reachable." - fi -fi - scriptargtype - 1 - scriptfile - - type - 0 - - type - alfred.workflow.action.script - uid - D33C8AF8-FC41-4038-A469-3E65C7F569C8 - version - 2 - config @@ -892,8 +785,6 @@ fi 0 hotmod 0 - hotstring - leftcursor modsmode @@ -1858,19 +1749,17 @@ fi readme ## Usage -Run the Seach Keyword (default: `gd`) or Folder Seach Keyword (default: `gdf`) to filter the contents of your Google Drive. +Search the contents of your Google Drive via the Search Keyword (default: `gd`) or Folder Search Keyword (default: `gdf`). ![Alfred search for gd](images/about/gd.png) ![Alfred search for gd fran](images/about/gdfran.png) -* ↩: Open. -* ⌥↩: Reveal in Finder. -* ⇧↩: Search on Google Drive’s website. - -You’ll be asked to build the cache on your first run. A notification will show when it’s ready. The more files you have, the longer the wait. A macOS launchd agent will be loaded to do it daily and on boot. +* <kbd>↩</kbd>: Open. +* <kbd>⌥</kbd><kbd>↩</kbd>: Reveal in Finder. +* <kbd>⇧</kbd><kbd>↩</kbd>: Search on Google Drive’s website. -To rebuild the cache on demand, run `:gdrebuildcache`. +You’ll be asked to build the cache on your first run. A notification will show when it’s ready. The more files you have, the longer the wait. A macOS launchd agent will be loaded to do it daily and on boot. If necessary, an immediate cache rebuild can be forced with the `:gdrebuildcache` keyword. The [Universal Actions](https://www.alfredapp.com/help/features/universal-actions/) make it straightforward to copy and move files to a Google Drive folder. @@ -2124,17 +2013,6 @@ To report a problem, run `!gddiagnostic`. ypos 490 - D33C8AF8-FC41-4038-A469-3E65C7F569C8 - - colorindex - 12 - note - OneUpdater - xpos - 1050 - ypos - 195 - D5A28DD0-88F4-4CB2-A750-118B1E0ADEE7 xpos @@ -2332,12 +2210,12 @@ To report a problem, run `!gddiagnostic`. required text - Periodically update file cache + Automatically update the cache on a schedule description label - Auto Cache Rebuilding + Periodic Refresh type checkbox variable @@ -2345,7 +2223,7 @@ To report a problem, run `!gddiagnostic`. version - 2022.22 + 2022.23 webaddress https://github.com/alfredapp/google-drive-workflow/