Skip to content

About

PDrive for Linux: unofficial third-party Proton Drive client integrated with GNOME Files (Nautilus). Not affiliated with Proton AG.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

PDrive for Linux

Unofficial third-party client, not affiliated with Proton AG. PDrive for Linux is an independent personal project. It is not made, endorsed or supported by Proton AG. "Proton" and "Proton Drive" belong to their owners. It uses Proton's published Drive SDK and does not reuse any Proton logo.

PDrive for Linux gives Proton Drive a place in the Linux desktop: your "My files" folder is mounted at ~/ProtonDrive, files are downloaded when you open them, and the file managers show it: Nautilus (GNOME Files) and Dolphin (KDE) show the sync state with a context menu, Dolphin and COSMIC Files list the drive in their sidebar (see File managers).

Status: early alpha (the application identifies itself to Proton with the -alpha channel).

Nautilus: state emblems and the "Proton Drive" sidebar entry Status window Settings
Nautilus with the state emblems and the Proton Drive sidebar entry Status window of pdrive-app Settings of pdrive-app
File context menu Sidebar entry menu Tray icon menu
Nautilus file context menu with "Keep Available Offline" and "Free Up Space" Context menu of the Proton Drive sidebar entry in Nautilus Menu of the pdrive-app tray icon

Features

  • Mount of "My files" with FUSE at ~/ProtonDrive (configurable).
  • On-demand download: a file is fetched when it is read, with progressive reading for large files.
  • Writes: files are created, modified, renamed, moved and deleted from any application; new content is uploaded when the file is closed, with revisions. Interrupted uploads are resumed at the next start.
  • Live updates: remote changes are applied from Drive events, with no repeated scan of the tree.
  • Thumbnails: Proton thumbnails are written to the desktop thumbnail cache.
  • Local cache of downloaded files, limited in size (10 GiB by default, least recently used files are dropped first, pinned files are kept).
  • Nautilus extension: sync state emblems, and the context menu entries "Keep Available Offline" and "Free Up Space". Open windows are reloaded when the drive is mounted.
  • Dolphin plugins (KDE Frameworks 6): the same emblems and context menu entries, plus a "Proton Drive" entry in the places panel.
  • COSMIC Files: a favorite and two context menu actions ("PDrive: Keep Available Offline", "PDrive: Free Up Space"). No emblems: COSMIC Files has no extension API.
  • Sidebar entry through libcloudproviders, with a menu (show status, open in the browser, mount / unmount).
  • Desktop application (pdrive-app): tray icon, status window (account, used space, recent activity, "Open folder", "View online"), settings (mount point, cache size, sign out, start at login, open the window at start), an "About" dialog (tray menu and window header) and browser sign-in. It starts pdrived and restarts it if it fails.
  • Tray icon through the StatusNotifierItem protocol: native on KDE Plasma, XFCE, Cinnamon, MATE, LXQt, waybar. On GNOME, install and enable the "AppIndicator and KStatusNotifierItem Support" extension (gnome-shell-extension-appindicator on Fedora, already installed on Ubuntu); otherwise the status window is shown with an explanation.
  • Translations with gettext (French first, see po/).
  • Command-line tool pdrive: login, logout, status, ls [PATH], keep-offline PATH..., free-up-space PATH..., selftest.

The session is kept in the Secret Service keyring (oo7, GNOME Keyring, KWallet, ...). The sign-in goes through your browser: PDrive never sees your password. When Proton no longer accepts the session (expired or revoked), the application opens the browser sign-in again by itself.

Architecture

flowchart LR
    subgraph Native["Native libraries (built by scripts/build-native.sh)"]
        SDK["Proton Drive SDK<br/>C#, .NET NativeAOT<br/>libproton_drive_sdk.so"]
        CRYPTO["libproton_crypto.so<br/>OpenPGP / SRP"]
        SDK --> CRYPTO
    end

    API(["Proton Drive API"])

    subgraph Rust["Rust workspace (crates/)"]
        PDSDK["pdsdk<br/>C + Protobuf bindings"]
        PDCORE["pdcore<br/>sign-in, keyring, HTTP host"]
        PDRIVED["pdrived<br/>FUSE daemon"]
        APP["pdrive-app<br/>tray icon, status window"]
        CLI["pdrive<br/>command line"]
    end

    FUSE[("FUSE mount<br/>~/.local/share/pdrive/.mount<br/>(hidden)")]
    LINK["~/ProtonDrive<br/>symbolic link"]
    NAUT["Nautilus<br/>+ extension (C)"]
    CP["libcloudproviders<br/>sidebar entry"]
    KEYRING[("Secret Service<br/>keyring")]

    PDSDK -- FFI --> SDK
    PDCORE --> PDSDK
    PDRIVED --> PDCORE
    APP --> PDCORE
    CLI --> PDCORE
    PDCORE -- "session" --> KEYRING
    PDCORE -- "HTTP (host callback)" --> API
    PDRIVED --- FUSE
    LINK -.-> FUSE
    NAUT -- "files" --> LINK
    APP -- "spawns and supervises" --> PDRIVED
    APP <-- "D-Bus io.github.bpresles.PDrive1" --> PDRIVED
    NAUT <-- "D-Bus: states, offline" --> PDRIVED
    CP <-- "D-Bus: CloudProviders" --> PDRIVED
    NAUT --- CP
Loading
  • The SDK is Proton's official C# Drive SDK, compiled with NativeAOT into a shared library and called from Rust through its C interface and Protobuf messages (crates/pdsdk, native/proton.drive.sdk.proto). The SDK does no network I/O itself: the HTTP requests go through a host callback implemented in pdcore, which adds the session headers.
  • pdrived mounts the drive with FUSE in a hidden directory (~/.local/share/pdrive/.mount, ignored by GLib and gvfs so that the sidebar shows a single entry), and ~/ProtonDrive is a symbolic link to it. It owns the content cache, the upload journal, the thumbnails and the D-Bus service. The file system type is fuse.s3fs (the source stays pdrive): COSMIC Files only treats a fixed list of mount types as remote, and otherwise reads every file to guess its type, which downloads it.
  • D-Bus (session bus, name io.github.bpresles.PDrive): interface io.github.bpresles.PDrive1 (per-file state, offline pinning, account, quota, recent activity, mount / unmount) and the CloudProviders objects declared in packaging/io.github.bpresles.PDrive.ini.
  • pdrive-app (GTK4 / libadwaita, application id io.github.bpresles.PDrive.App) runs and watches the daemon and shows its state. The daemon stops when the application dies.
  • The Nautilus extension (extension/, C) and the Dolphin plugins (integrations/dolphin/, C++ / KDE Frameworks 6) ask the daemon over D-Bus for the state of the files they display. Nothing in the daemon is specific to a file manager.
  • pdrive-app also writes the sidebar entries and menu actions of Dolphin and COSMIC Files in the configuration of the user (crates/pdrive-app/src/integrations.rs); COSMIC Files runs pdrive keep-offline / pdrive free-up-space.

Installation

Requirements

  • A recent Linux desktop (developed on Fedora; Debian-based systems should work with the equivalent packages).
  • A Rust toolchain supporting edition 2024, and pkg-config.
  • The .NET 10 SDK, to build the Proton SDK with NativeAOT (plus the C toolchain NativeAOT needs), and git (the sources of the SDK are fetched at a pinned revision).
  • FUSE 3 (fusermount3).
  • Development files of GTK 4, libadwaita and GLib, for pdrive-app.
  • gettext (msgfmt) for the translations.
  • A Secret Service provider (for example oo7, GNOME Keyring, KeePassXC or KWallet). The packages do not depend on any of them: use the one your desktop already runs. With KWallet, the Secret Service interface (org.freedesktop.secrets) is provided by ksecretd from KDE Frameworks 6.14 (Fedora 45 has 6.31). Debian 13 has kwallet6 6.13, whose kwalletd6 only offers it as an option: enable it in the KDE Wallet settings ("Use KWallet for the Secret Service interface") or use another provider.
  • Optional, one per file manager you want the plugins of: for the Nautilus extension, the development files of libnautilus-extension-4 (nautilus-devel on Fedora) and GTK 4; for the Dolphin plugins, CMake, extra-cmake-modules and the development files of KDE Frameworks 6 KIO, KCoreAddons, KI18n and Qt 6 (kf6-kio-devel kf6-kcoreaddons-devel kf6-ki18n-devel qt6-qtbase-devel on Fedora; libkf6kio-dev libkf6coreaddons-dev libkf6i18n-dev qt6-base-dev on Debian 13). scripts/install-system.sh builds the ones it finds. COSMIC Files needs nothing to build.
  • On GNOME: the AppIndicator extension, for the tray icon (see above).

From source

git clone https://github.com/bpresles/PDrive-for-Linux.git
cd PDrive-for-Linux

scripts/install.sh          # as your user
scripts/install-system.sh   # Nautilus extension, Dolphin plugins and sidebar, needs sudo
nautilus -q                 # restart Nautilus to load the extension (Dolphin: close it)

scripts/install.sh builds the native libraries if needed (scripts/build-native.sh, which clones the SDK into third_party/, so the first run takes a while), builds the Rust programs in release mode and installs, under your home directory:

  • ~/.local/lib/pdrive/: the native libraries;
  • ~/.local/bin/: pdrive-app, pdrived, pdrive;
  • ~/.local/share/applications/io.github.bpresles.PDrive.App.desktop: the menu entry;
  • ~/.local/share/icons/hicolor/: application, tray and emblem icons;
  • ~/.local/share/locale/<lang>/LC_MESSAGES/pdrive.mo: translations;
  • ~/.local/share/man/man1/: manual pages pdrive(1), pdrived(1) and pdrive-app(1).

~/.local/bin must be in your PATH to run the commands from a terminal. scripts/install-system.sh builds the Nautilus extension (if libnautilus-extension-4 is found) and installs it in the extension directory of Nautilus, builds the Dolphin plugins (if CMake finds KDE Frameworks 6 KIO) and installs them in the Qt 6 plugin directory of the system, and installs the sidebar declaration in /usr/local/share/cloud-providers/ and the translations in /usr/local/share/locale/. It needs sudo because Nautilus, Dolphin and libcloudproviders only read system directories.

First start

  1. Start PDrive from the applications menu (or run pdrive-app).
  2. Click "Sign in": your browser opens for the Proton sign-in (the window mentions that this is an unofficial client). pdrive login does the same from a terminal.
  3. The daemon mounts the drive at ~/ProtonDrive; it is also in the sidebar of the file managers (see below).
  4. After the first sign-in, the application offers to start at login. You can change it in the settings (it creates ~/.config/autostart/io.github.bpresles.PDrive.App.desktop).

File managers

One installation serves every desktop of the machine: a package (or install-system.sh) installs the plugin of each file manager, and each plugin is only loaded by its own file manager, so switching between GNOME, KDE and COSMIC sessions needs nothing more. The packages require none of them (Suggests: nautilus, dolphin) and pull no KDE or GNOME library.

Nautilus (GNOME) Dolphin (KDE Plasma) COSMIC Files
Sync state emblems yes (extension) yes (KOverlayIconPlugin) no: no extension API
"Keep Available Offline" / "Free Up Space" file menu file menu, only on drive files file menu, on every file (see below)
Sidebar entry libcloudproviders (system-wide) "Proton Drive" in Places (user-places.xbel) favorite

pdrive-app sets up the Dolphin places entry and the COSMIC Files favorite and actions in your own configuration (a package cannot write it), at every start, according to the file managers installed, not to the session you are running: with COSMIC and Dolphin both installed, the Dolphin entry is added from a COSMIC session too. A file manager installed later is taken into account at the next start of pdrive-app.

  • Dolphin: $XDG_DATA_HOME/user-places.xbel is only changed if it exists (Dolphin creates it at its first start), with a marker so that only our entry is touched.
  • COSMIC Files (when com.system76.CosmicFiles.desktop is installed): ~/.config/cosmic/com.system76.CosmicFiles/v1/favorites and .../context_actions. COSMIC Files cannot limit an action to a folder: "PDrive: Keep Available Offline" and "PDrive: Free Up Space" appear on every file, and run pdrive keep-offline / pdrive free-up-space, which ignore paths outside the drive and say so in a notification. If pdrive is not in the PATH of the session (for example ~/.local/bin), the actions use its full path. The favorite is recognised by the mount point: turning the integration off removes it, even if you had added it by hand.
  • The switch "Add PDrive to the file managers (sidebar, menus)" in the settings (file_manager_integration, on by default) removes these entries when turned off. pdrive-app --remove-integrations removes them and exits (scripts/uninstall.sh runs it). Removing a package does not touch your configuration files: run it first.
  • Nautilus is unchanged: no bookmark is added, its sidebar entry comes from libcloudproviders.
  • The "Open folder" button opens the folder with the default application of your system, as before.
  • Not available: emblems in COSMIC Files (no API), Nemo, Thunar, Caja. The AppImage contains none of the plugins (they live in system directories), like the Nautilus extension.

Packages

RPM and DEB packages are meant to be published with the releases of the repository: see the GitHub releases. Details for packagers are in packaging/README.md.

Configuration

Settings are in ~/.config/pdrive/config.toml (or under $XDG_CONFIG_HOME). The file is optional; unknown keys are rejected. The settings window of pdrive-app edits the same file and keeps your comments. Restart the application (or the daemon) after a manual change.

# Where "My files" is mounted ("~" is the home folder).
mountpoint = "~/ProtonDrive"
# Maximum size of the cache of downloaded files, in GiB.
cache_size_gib = 10
# Whether launching pdrive-app opens its status window (read by pdrive-app only).
show_window_at_startup = true
# Whether pdrive-app adds the drive to the file managers (Dolphin, COSMIC Files).
file_manager_integration = true
Key Default Meaning
mountpoint "~/ProtonDrive" Folder where the drive appears (a symbolic link to the hidden real mount).
cache_size_gib 10 Size limit of the cache of downloaded files, in GiB.
show_window_at_startup true Open the status window when pdrive-app is started by hand. It is never opened with --background (start at login).
file_manager_integration true Add the drive to the sidebar and menus of Dolphin and COSMIC Files (switch in the settings; see File managers).

Other locations: the content cache and the pending uploads are under ~/.cache/pdrive/; the hidden mount and the list of pinned files (pinned.json) are under ~/.local/share/pdrive/. Setting PDRIVE_VERBOSE=1 logs HTTP requests and SDK debug messages.

Logs

Started from the menu or at login, pdrive-app and the daemon it runs log to the journal of your session:

journalctl --user -t pdrive -f

Without a journal, the log is $XDG_STATE_HOME/pdrive/pdrive.log (by default ~/.local/state/pdrive/pdrive.log). From a terminal, they go to the standard error output.

Known limitations

  • File permissions and a modification date alone are not kept (Proton Drive does not store them).
  • Files "Shared with me" and Photos are not handled.
  • O_NOATIME is refused on files that are not in the cache.
  • Opening a folder also lists its sub-folders in the background (one level, a few requests at a time), and the first 32 KiB of a file read by a file manager to guess its type are kept in the cache: the rest of a file is only downloaded if something reads further.
  • Deleting a file moves it directly to the Proton trash, not to the Nautilus trash.
  • Rendering on KDE and GNOME, and the translated Nautilus and Dolphin menus, still need more real-world testing.
  • COSMIC Files shows no state emblems (no extension API), and its two PDrive actions appear on every file (they do nothing outside the drive).
  • Keep a single Secret Service on the desktop. With two of them installed (for example GNOME Keyring and oo7), whichever starts first at login answers, each with its own copy of the session; Proton renews the session regularly and refuses the outdated copy, which then asks for a new sign-in.

The roadmap is in PLAN.md (in French).

Uninstall

scripts/uninstall.sh removes what install.sh and install-system.sh installed (asking for sudo for the system files), after stopping PDrive; it keeps your session, settings and cache, and the files of an RPM or DEB package. The equivalent by hand, after quitting PDrive from the tray menu (it unmounts the drive):

# User files (first remove the entries added to Dolphin and COSMIC Files)
pdrive-app --remove-integrations
rm -f ~/.local/bin/{pdrive-app,pdrived,pdrive}
rm -rf ~/.local/lib/pdrive
rm -f ~/.local/share/applications/io.github.bpresles.PDrive.App.desktop
rm -f ~/.config/autostart/io.github.bpresles.PDrive.App.desktop
find ~/.local/share/icons/hicolor -name 'io.github.bpresles.PDrive.App.svg' -o -name 'emblem-pdrive-*.svg' -o -name 'pdrive-*.svg' | xargs -r rm -f
rm -f ~/.local/share/locale/*/LC_MESSAGES/pdrive.mo
rm -f ~/.local/share/man/man1/{pdrive,pdrived,pdrive-app}.1

# System files
sudo rm -f "$(pkg-config --variable=extensiondir libnautilus-extension-4)/libpdrive-nautilus.so"
sudo rm -f "$(qtpaths6 --query QT_INSTALL_PLUGINS)"/kf6/{overlayicon/pdriveoverlay,kfileitemaction/pdriveactions}.so
sudo rm -f /usr/local/share/cloud-providers/io.github.bpresles.PDrive.ini
sudo rm -f /usr/local/share/locale/*/LC_MESSAGES/pdrive.mo
nautilus -q    # and close Dolphin

With a package installation, run pdrive-app --remove-integrations before removing the package: the package does not touch your configuration files.

Your data: pdrive logout first removes the session from the keyring and revokes it. Then, if you want, delete ~/.config/pdrive/, ~/.cache/pdrive/ (note: this loses uploads still pending) and ~/.local/share/pdrive/. Files stored in Proton Drive are not affected. Remove the ~/ProtonDrive link if it remains.

Proton's terms for third-party apps

PDrive uses the official Proton Drive SDK and follows the conditions Proton sets for third-party applications: it is presented as an unofficial client, uses no Proton logo, sends an honest x-pm-appversion header (external-drive-pdrive_for_linux@<version>-<channel>) and synchronises with Drive events instead of polling the tree. Proton announced a cryptographic migration for the end of 2026 / early 2027: the SDK will have to be followed and a release of PDrive may be needed. Please read Proton's current terms of service before using or redistributing this software; you use it at your own risk.

Licence

PDrive for Linux is free software, licensed under the GNU General Public License, version 3 or later (GPL-3.0-or-later).

It builds on components published by Proton AG under the MIT licence (the Proton Drive SDK, dotnet-crypto and proton-crypto-rs) and on other open-source dependencies. Their notices are in THIRD_PARTY_NOTICES.

About

PDrive for Linux: unofficial third-party Proton Drive client integrated with GNOME Files (Nautilus). Not affiliated with Proton AG.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages