Mounting Google Drive with Rclone
The Adfinis way π§β¨

π About the Project
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 for opening files directly in Google Drive and copying shareable links.
- CLI Tool to mount and umount shares.
- Better error handling in case of permission errors.
π¦ Installation
Using GoReleaser Packages
- 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.
- Stop nautilus to make sure the new extension gets picked up:
nautilus -q
Manual Installation
- Install the dependencies
# debian / ubuntu
sudo apt install rclone python3-nautilus xclip zenity
# fedora / rhel
sudo dnf install rclone nautilus-python xclip zenity
# arch
sudo pacman -S rclone python-nautilus xclip 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/rclone@.service /usr/lib/systemd/user/
sudo cp assets/adfinis-rclone-mgr@.service /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
π οΈ Usage
adfinis-rclone-mgr assumes 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
- 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.
Managing Mounts
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.
These commands allow you to quickly mount or unmount your Google Drive shares as needed.
π Troubleshooting
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>.
π§ͺ Development
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
π License
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.