Rclone-Based Google Drive Sync Integration for GNOME
KeePassXC Sync with Google Drive via Executor GNOME Shell Extension
This project provides a solution to keep your KeePassXC .kdbx password database (or any other file) synchronized between your local machine and cloud storage (i.e. Google Drive) using rclone and the Executor - Gnome Shell Extension. It includes two bash scripts:
rclone-sync.sh: Handles uploading and downloading the local file viarclone.sync-status-display.sh: Displays sync status notifications on GNOME Shell using Executor, and triggers sync or reconnection when needed.
Features
- Automatic two-way sync between local file and cloud.
- Handles internet connectivity checks.
- Detects token expiration and guides reconnection.
- Shows real-time sync status in GNOME Shell.
- Works with minimal user intervention.
Prerequisites
- Linux system with GNOME Shell.
- rclone installed and configured with your remote cloud. (i.e. Google Drive).
Note: Name the remote connection
remotefor consistency. - Executor - Gnome Shell Extension installed.
- NetworkManager CLI (
nmcli) installed and accessible, since the scripts usenmclito check internet connectivity.
Download Scripts
Save the following two scripts to your local machine:
Adjust the following variables inside the scripts to fit your environment:
| Variable | Description | Example |
|---|---|---|
LOCAL_FILE |
Path to your local file | LOCAL_FILE="$HOME/Passwords.kdbx" |
REMOTE_FILE |
Temporary file location for downloads | REMOTE_FILE="/tmp/Passwords_tmp.kdbx" |
STATUS_FILE |
Path to status tracking file | STATUS_FILE="/tmp/rclone_status.txt" |
SYNC |
Location of rclone-sync.sh script |
SYNC="$HOME/.local/share/bin/rclone-sync.sh" |
CLOUD_DIR |
Remote cloud directory (not file) | CLOUD_DIR="remote:/path" |
CLOUD_FILE |
Remote cloud file location | CLOUD_FILE="remote:/path/Passwords.kdbx" |
Make scripts executable
chmod +x /path/to/rclone-sync.sh /path/to/sync-status-display.sh
Configure Executor extension
- Open GNOME Extensions app, find Executor extension and open its preferences or open directly from the terminal:
gnome-extensions prefs executor@raujonas.github.io -
Add a new command for syncing:
-
Command:
/path/to/rclone-sync.sh -
Run every: 600 seconds (15 minutes)
-
-
Add a new command for display/status updates:
-
Command:
/path/to/sync-status-display.sh -
Run every: 10 seconds
-
- Save and enable both commands.
How it works
-
Every 15 minutes,
rclone-sync.shruns and performs:-
Internet connectivity check.
-
Downloads latest file file from remote cloud (i.e. Google Drive).
-
Compares timestamps of remote and local files.
-
Uploads newer local file if applicable.
-
Updates status in /tmp/rclone_status.txt.
-
-
Every 10 seconds,
sync-status-display.shruns and:-
Reads the status file.
-
Displays status on GNOME Shell via Executor.
-
Automatically triggers sync or reconnects Google Drive token if expired.
-
-
If token expired, a terminal will open to guide re-authentication with the remote cloud.
Manual Usage
You can manually run sync script anytime:
./rclone-sync.sh
Or display script:
./sync-status-display.sh
Troubleshooting
-
No internet: Sync is skipped until connection is restored.
-
Token expired: Terminal prompts to reconnect remote cloud via rclone.
-
Upload/download errors: Logged in status file, retry after fixing network or authentication.
-
Permission issues: Ensure scripts have execute permissions and rclone is configured correctly.
Customization
-
Modify paths to local file and status file inside scripts.
-
Adjust intervals in Executor extension according to your preference.
-
You can customize GNOME Shell display messages by editing sync-status-display.sh.
Example Directory Structure
$HOME/.local/share/bin/
├─ rclone-sync.sh
└─ sync-status-display.sh
/tmp/
├─ rclone_status.txt
└─ Passwords_tmp.kdbx (temporary)
$HOME/
└─ Passwords.kdbx (local KeePassXC database)