The Adfinis way 🧙✨
This repository provides a streamlined way to mount Google Drive using Rclone, tailored for Adfinis workflows. It includes:
- A web-based configuration tool for Google Drive mounts.
- Systemd service templates for managing Rclone mounts.
- Nautilus integration
- Open file in Google Drive
- Copy Google Drive link to a file
- Copy and move files using server-side actions to avoid file conversions
- CLI Tool to mount and umount shares.
- Better error handling in case of permission errors.
- Download the latest release from the Releases page.
- Install the package for your distribution:
- Debian/Ubuntu:
sudo apt install adfinis-rclone-mgr-<version>.deb - Fedora/RHEL:
sudo dnf install adfinis-rclone-mgr-<version>.rpm - Arch Linux (AUR):
yay -S adfinis-rclone-mgr-bin.
- Debian/Ubuntu:
- Stop nautilus to make sure the new extension gets picked up:
nautilus -q
- Install the dependencies
# debian / ubuntu sudo apt install rclone python3-nautilus python3-httpx zenity # fedora / rhel sudo dnf install rclone nautilus-python python-httpx zenity # arch sudo pacman -S rclone python-nautilus python-httpx zenity
- Clone the repository:
git clone https://github.com/adfinis/adfinis-rclone-mgr.git cd adfinis-rclone-mgr - Build the binary:
go build -o adfinis-rclone-mgr . - Install the assets:
sudo cp assets/[email protected] /usr/lib/systemd/user/ sudo cp assets/[email protected] /usr/lib/systemd/user/ sudo cp assets/google_drive_opener.py /usr/share/nautilus-python/extensions/ sudo cp assets/adfinis-rclone-mgr.desktop /usr/share/applications/ sudo cp assets/adfinis-rclone-mgr.png /usr/share/icons/hicolor/512x512/apps/
- Optional: Autocompletion
./adfinis-rclone-mgr completion --help
adfinis-rclone-mgrassumes you have your own client_id and client_secret.
Make sure to create that or ask your Google Workspace Admin to provide one.
- Start the application:
- Via Desktop: Just search for
adfinis-rclone-mgr - Via Terminal:
adfinis-rclone-mgr gdrive-config
- Via Desktop: Just search for
- Open the provided URL in your browser to configure Google Drive mounts.
- Follow the on-screen instructions to log in, select drives, and generate configurations.
- Use the Nautilus context menu to open files directly in Google Drive or to copy files and folders between Google Drives using the special "Copy on Google Drive" action.
There is also a Nemo extension that gets installed. If Nemo is your file manager of choice,
make sure you also have nemo-python installed for the integration to work.
You can now manage your Google Drive mounts directly from the terminal using the following commands:
-
List available shares:
adfinis-rclone-mgr ls
-
Mount a configured share:
adfinis-rclone-mgr mount <share-name>
Replace
<share-name>with the name of your configured Google Drive share.
You can use tab for autocompletion of the share names. -
Unmount a share:
adfinis-rclone-mgr umount <share-name>
This will safely unmount the specified share.
-
Copy files or folders between Google Drives (server-side, no conversion):
adfinis-rclone-mgr cp <source>... <destination>
This command allows you to copy files or folders from one Google Drive to another, or within the same drive, using rclone's server-side copy. This avoids any file format conversion and is the recommended way to copy Google Docs, Sheets, and Slides natively.
-
Move files or folders between Google Drives (server-side, no conversion):
adfinis-rclone-mgr mv <source>... <destination>
This command allows you to move files or folders from one Google Drive to another, or within the same drive, using rclone's server-side move. This avoids any file format conversion and is the recommended way to move Google Docs, Sheets, and Slides natively.
Why not use normal copy or move?
If you use the standard copy or move methods (ctrl+c/ctrl+x, right-click + Copy/Move, or drag & drop) in your file manager or
cp,rsync,mv, etc. in the terminal, rclone mountes will convert Google Docs, Sheets, and Slides to Microsoft Office formats (e.g., gdocs to .docx) during the operation. This can cause formatting issues. Thecpandmvcommands and the "Copy on Google Drive"/"Move on Google Drive" Nautilus context menu entries ensure that all copy and move actions are performed server-side, preserving the native Google format and avoiding unwanted conversions.
The daemon command replaces the old journald command. It runs a background process that reads logs from the systemd journal and handles IPC events for features like server-side copy.
adfinis-rclone-mgr daemon <drive-name>This is started automatically for each mounted drive.
If there are still pending io operations on a share, or if you have a Drive folder open in your file manager, unmounting a share might fail.
In that case, make sure to close all open files and file manager windows and execute adfinis-rclone-mgr umount <share-name> --force or fusermount -u ~/google/<share-name>.
Make sure to install all dependencies:
go mod tidy
If you make any changes to a .templ file, don't forget to generate a native go code based on the template:
go tool templ generate
To create a release, simply push a tag and the pipeline will do the rest.
Semantic versioning and conventional commits are a must!
git tag vX.Y.Z
git push --tags
This project is licensed under the GNU General Public License v3.0.
You are free to use, modify, and distribute this software under the terms of the license.
Made with ❤️ by Adfinis.