- Emacs Lisp 100%
|
|
||
|---|---|---|
| gdr.el | flycheck | |
| readme.org | Merge branch 'dev' | |
gdr
A simple utility for interacting with the google drive API in Emacs.
installing
gdr uses the gdrive CLI programme, which you must install and set up
yourself. For details, see https://github.com/glotlabs/gdrive and its
OAuth documentation,
https://github.com/glotlabs/gdrive/blob/main/docs/create_google_api_credentials.md.
Once you are logged in with gdrive, set gdr-base-dir to the root of your
local drive (synced or not). It will be used as your default local
directory when prompting for download destinations and items to upload.
Uploads and downloads are async by default, with the main up-/download functions having an optional sync argument to force sync operations if needed.
features
basics
- list directory files
- upload a file
- download a file
- delete a file
- view file details
- make a directory
- download a whole directory
- list home directory
org-cal related
The main use case gdr is designed for is interacting with gdrive from calendar events that include drive links.
From an org-cal (e.g. using org-gcal.el) entry you can:
- list directory files
- up-/download a directory
- up-/download a file
- delete file
- copy directory id
- automatically add an org link to downloaded file/dir
from a directory listing
- view file info
- up-/download file
- up-/download directory
- delete file
- copy item or directory URL
- view child directory listing
- view parent directory listing
working with IDs and URLs
Most interactive functions requiring a location on the remote drive will prompt for a URL. Drive URLs contain the directory ID for a given location. Because URLs are the easiest for a user to obtain, we prompt for one whenever needed. You can get such a URL from your browser if logged in, or also from anything else that links to a drive directory, such as a calendar event.
Download directory/file commands take a prefix argument to overwrite the
item if it already exists at the destination path. If not, gdrive will
signal an error.
bookmarks
gdr-bookmarks is a customize alist that holds pairs of bookmark names and URLS.
Call gdr-load-bookmark and select a bookmark by name to load it.
Download directory/file commands take prefix argument to overwrite the
item if it already exists at the destination path. If not, gdrive will
signal an error.
no sync
gdrive doesn't do any syncing, so gdr doesn't either. The idea is to just
to be able to send and fetch things on an ad hoc basis.
to do
- move file
- copy file
command index
| Binding | Command | Description |
|---|---|---|
| gdr-add-dir-link-in-entry | Read a directory and insert an org link to it in current entry. | |
| gdr-cal-copy-entry-dir-id | Copy the ID of the current calendar entry's directory. | |
| gdr-cal-delete-entry-file | Delete a file from the directory of the org cal entry at point. | |
| gdr-cal-download-entry-dir | Fetch a dir-id from org cal entry at point and download its directory. | |
| gdr-cal-download-entry-file | Select a file from the org cal entry at point and download it. | |
| gdr-cal-list-dir-url-at-point | List directory of the URL/org link at point. | |
| gdr-cal-list-entry-files | Fetch a dir-id from org cal entry at point and list its files. | |
| gdr-cal-upload-dir-to-entry-dir | Upload a file to the directory of the org cal entry at point. | |
| gdr-cal-upload-to-entry-dir | Upload a file to the directory of the org cal entry at point. | |
| gdr-delete-file | Prompt for a file in directory with URL or DIR-ID and delete it. | |
| gdr-directory-info | Get info for directory with URL. | |
| gdr-dired-dir | Read a dir with `gdr-read-dir' and open it in Dired. | |
| gdr-download-dir | Download a directory, optionally at URL. | |
| gdr-download-dir-by-url | ||
| gdr-download-file | Download a file, from directory with DIR-URL or DIR-ID. | |
| gdr-download-file-by-id | Download file by its ID. | |
| gdr-download-file-from-bookmark | Read a bookmark from `gdr-bookmarks' and download a file from it. | |
| gdr-download-item-by-docs-url | Read a google docs URL and save the file locally. | |
| gdr-download-listed-dir | Download the currently listed directory. | |
| gdr-file-info | Get info for a file in directory with DIR-URL. | |
| gdr-list-dir-by-url | ||
| gdr-list-files | Read a directory URL and return a list of its files. | |
| gdr-list-home | List files in the default remote location. | |
| gdr-list-parent-dir | List the parent directory relative to the current listing. | |
| gdr-listing-copy-item-url | From a ctable view, copy URL of active item. | |
| gdr-listing-copy-listing-url | Copy URL of current table. | |
| gdr-listing-delete-file | Delete active file. | |
| gdr-listing-download-item | From a ctable view, download active item. | |
| gdr-listing-export-file | Export the google documents file at point. | |
| gdr-listing-item-info | Return file info for listing item at point. | |
| gdr-listing-upload-dir-here | Upload dir to current table's folder. | |
| gdr-listing-upload-dir-to-item | Upload dir to folder at point. | |
| gdr-listing-upload-file-here | Upload file to current table's folder. | |
| gdr-listing-upload-file-to-item | Upload file to active folder. | |
| gdr-listing-view-item | From a ctable view, load or view active item. | |
| gdr-load-bookmark | Read a bookmark from `gdr-bookmarks' and list its files. | |
| gdr-make-dir | Prompt for a NAME and make a new directory. | |
| gdr-minor-mode | Minor mode to download items from gdrive from an org (calendar) file. | |
| gdr-upload-dir | Prompt for a dir URL and local dir and upload local to remote. | |
| gdr-upload-file | Prompt for a dir URL and file and upload file to dir. |