Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2462cb24bd | ||
|
|
a1dd2b5a9b | ||
|
|
e9d6d4a907 | ||
|
|
6fa91e83f1 | ||
|
|
f239dffbcc | ||
|
|
e011a0d89f | ||
|
|
f2c4c05f27 | ||
|
|
8598aff7dd | ||
|
|
38a8db0e3e | ||
|
|
db8c0cb382 | ||
|
|
a7baf2313c | ||
|
|
7e0d7d020e | ||
|
|
7d445bb02c |
No files matched your search
@@ -44,6 +44,9 @@ jobs:
|
|||||||
- name: Formatting
|
- name: Formatting
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
- name: Shell scripts of the release tarball
|
||||||
|
run: shellcheck packaging/tarball/*.sh
|
||||||
|
|
||||||
- name: Lints
|
- name: Lints
|
||||||
run: cargo clippy --workspace --all-targets --locked -- -D warnings
|
run: cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||||
|
|
||||||
|
|||||||
@@ -119,17 +119,12 @@ jobs:
|
|||||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
echo "Building version: $VERSION"
|
echo "Building version: $VERSION"
|
||||||
|
|
||||||
- name: Package raw binaries (.tar.gz)
|
# Binaries plus everything around them, with install.sh for a home
|
||||||
|
# directory install (immutable distributions, anything without a package).
|
||||||
|
- name: Package the installable tarball (.tar.gz)
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist/binaries
|
tarball=$(packaging/tarball/build.sh target/release "${{ env.VERSION }}" .)
|
||||||
cp target/release/pdfs dist/binaries/
|
packaging/tarball/test.sh "$tarball"
|
||||||
cp target/release/pdfs-tray dist/binaries/
|
|
||||||
cp target/release/pdfs-app dist/binaries/
|
|
||||||
cp target/release/pdfs-prompt dist/binaries/
|
|
||||||
po/build.sh dist/binaries/locale
|
|
||||||
|
|
||||||
# Create tarball
|
|
||||||
tar -czf proton-drive-linux-${{ env.VERSION }}-x86_64.tar.gz -C dist/binaries .
|
|
||||||
|
|
||||||
# Every crate the build needs, so COPR can build the spec without network.
|
# Every crate the build needs, so COPR can build the spec without network.
|
||||||
- name: Package vendored crates (.tar.xz)
|
- name: Package vendored crates (.tar.xz)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
|
|
||||||
<img src="images/logo.svg" alt="" width="112" height="112">
|
<a href="images/logo.svg"><img src="images/logo.svg" alt="Proton Drive for Linux icon" width="128" height="128"></a>
|
||||||
|
|
||||||
# Proton Drive for Linux
|
# Proton Drive for Linux
|
||||||
|
|
||||||
@@ -77,7 +77,8 @@ scriptable CLI.
|
|||||||
| Arch Linux | [`proton-drive-for-linux`](https://aur.archlinux.org/packages/proton-drive-for-linux) (also `-bin` and `-git`) in the AUR |
|
| Arch Linux | [`proton-drive-for-linux`](https://aur.archlinux.org/packages/proton-drive-for-linux) (also `-bin` and `-git`) in the AUR |
|
||||||
| Debian, Ubuntu 24.04 or newer | `.deb` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest) |
|
| Debian, Ubuntu 24.04 or newer | `.deb` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest) |
|
||||||
| NixOS | The flake in this repository: see [Installation → NixOS](docs/INSTALL.md#nixos-flake) |
|
| NixOS | The flake in this repository: see [Installation → NixOS](docs/INSTALL.md#nixos-flake) |
|
||||||
| Anything else | [Build from source](docs/INSTALL.md#build-from-source) |
|
| Fedora Atomic (Silverblue, Kinoite, Bazzite, Bluefin) | The COPR repository, layered with `rpm-ostree`: see [Installation → Fedora Atomic](docs/INSTALL.md#fedora-atomic-silverblue-kinoite-bazzite-bluefin) |
|
||||||
|
| Anything else, immutable ones included | `.tar.gz` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest), installed into your home folder by its `install.sh`: see [Installation → Other distributions](docs/INSTALL.md#other-distributions), or [build from source](docs/INSTALL.md#build-from-source) |
|
||||||
|
|
||||||
**Fedora**
|
**Fedora**
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ use pdfs_core::cache::ContentCache;
|
|||||||
use pdfs_core::config::AppDirs;
|
use pdfs_core::config::AppDirs;
|
||||||
use pdfs_core::control::{
|
use pdfs_core::control::{
|
||||||
ConflictKeep, ErrorKind, LinkChange, MountKind, RefreshScope, Request as CtlRequest,
|
ConflictKeep, ErrorKind, LinkChange, MountKind, RefreshScope, Request as CtlRequest,
|
||||||
Response as CtlResponse, RestoreItem as CtlRestoreItem, ShareEntryKind, SyncIssue, SyncPhase,
|
Response as CtlResponse, RestoreItem as CtlRestoreItem, ShareEntryKind, SyncFolderInfo,
|
||||||
daemon_outdated, pending_summary,
|
SyncIssue, SyncPhase, daemon_outdated, pending_summary,
|
||||||
};
|
};
|
||||||
use pdfs_core::db::Db;
|
use pdfs_core::db::Db;
|
||||||
use pdfs_core::service;
|
use pdfs_core::service;
|
||||||
@@ -752,20 +752,30 @@ enum ConflictCmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// `pdfs sync ignore`: the patterns in `ignore_patterns`, for every synced
|
/// `pdfs sync ignore`: the patterns in `ignore_patterns`, for every synced
|
||||||
/// folder. A folder's own rules are in its `.pdfsignore`.
|
/// folder, or with `--folder` the ones in that folder's own `.pdfsignore`.
|
||||||
#[derive(Subcommand, Debug)]
|
#[derive(Subcommand, Debug)]
|
||||||
enum IgnoreCmd {
|
enum IgnoreCmd {
|
||||||
/// List the patterns every synced folder leaves out.
|
/// List the patterns every synced folder leaves out, or one folder's own.
|
||||||
List,
|
List {
|
||||||
|
/// List the own patterns of the synced folder holding this path.
|
||||||
|
#[arg(long, value_hint = ValueHint::DirPath)]
|
||||||
|
folder: Option<PathBuf>,
|
||||||
|
},
|
||||||
/// Leave out files matching a gitignore-style pattern, e.g. `*.db` or `build/`.
|
/// Leave out files matching a gitignore-style pattern, e.g. `*.db` or `build/`.
|
||||||
Add {
|
Add {
|
||||||
/// The pattern; end it with `/` to match folders only.
|
/// The pattern; end it with `/` to match folders only.
|
||||||
pattern: String,
|
pattern: String,
|
||||||
|
/// Add it only for the synced folder holding this path.
|
||||||
|
#[arg(long, value_hint = ValueHint::DirPath)]
|
||||||
|
folder: Option<PathBuf>,
|
||||||
},
|
},
|
||||||
/// Stop leaving out files matching a pattern.
|
/// Stop leaving out files matching a pattern.
|
||||||
Remove {
|
Remove {
|
||||||
/// The pattern, as `sync ignore list` shows it.
|
/// The pattern, as `sync ignore list` shows it.
|
||||||
pattern: String,
|
pattern: String,
|
||||||
|
/// Remove it from the own patterns of the synced folder holding this path.
|
||||||
|
#[arg(long, value_hint = ValueHint::DirPath)]
|
||||||
|
folder: Option<PathBuf>,
|
||||||
},
|
},
|
||||||
/// Go back to the built-in patterns.
|
/// Go back to the built-in patterns.
|
||||||
Reset,
|
Reset,
|
||||||
@@ -3733,27 +3743,26 @@ fn cmd_sync_limit(up: Option<u64>, down: Option<u64>) -> Result<()> {
|
|||||||
|
|
||||||
fn cmd_sync_ignore(action: IgnoreCmd) -> Result<()> {
|
fn cmd_sync_ignore(action: IgnoreCmd) -> Result<()> {
|
||||||
use pdfs_core::syncignore::{
|
use pdfs_core::syncignore::{
|
||||||
DEFAULT_IGNORE_PATTERNS, IgnoreRules, RuleSource, Verdict, check_pattern,
|
DEFAULT_IGNORE_PATTERNS, FolderRules, IgnoreRules, RuleSource, Verdict, add_folder_pattern,
|
||||||
|
check_pattern, remove_folder_pattern,
|
||||||
};
|
};
|
||||||
let dirs = AppDirs::new()?;
|
let dirs = AppDirs::new()?;
|
||||||
let defaults: Vec<String> = DEFAULT_IGNORE_PATTERNS
|
|
||||||
.iter()
|
|
||||||
.map(|p| (*p).to_string())
|
|
||||||
.collect();
|
|
||||||
// A list equal to the built-in one is stored as unset, so it follows the
|
|
||||||
// built-in list in later releases, as Preferences does.
|
|
||||||
let change = |edit: &dyn Fn(&mut Vec<String>)| -> Result<()> {
|
let change = |edit: &dyn Fn(&mut Vec<String>)| -> Result<()> {
|
||||||
dirs.update_config(|config| {
|
dirs.change_ignore_patterns(edit)?;
|
||||||
let mut list = config.resolved_ignore_patterns();
|
|
||||||
edit(&mut list);
|
|
||||||
config.ignore_patterns = (list != defaults).then_some(list);
|
|
||||||
})?;
|
|
||||||
// The next pass picks the change up anyway; this only hurries it.
|
// The next pass picks the change up anyway; this only hurries it.
|
||||||
let _ = control_request(CtlRequest::SyncNow { id: None });
|
let _ = control_request(CtlRequest::SyncNow { id: None });
|
||||||
Ok(())
|
Ok(())
|
||||||
};
|
};
|
||||||
|
let valid = |pattern: &str| -> Result<String> {
|
||||||
|
let pattern = pattern.trim();
|
||||||
|
if pattern.is_empty() || pattern.starts_with('#') {
|
||||||
|
bail!("not a pattern: `{pattern}`");
|
||||||
|
}
|
||||||
|
check_pattern(pattern).map_err(|e| anyhow!("not a valid pattern: {e}"))?;
|
||||||
|
Ok(pattern.to_string())
|
||||||
|
};
|
||||||
match action {
|
match action {
|
||||||
IgnoreCmd::List => {
|
IgnoreCmd::List { folder: None } => {
|
||||||
let config = dirs.load_config();
|
let config = dirs.load_config();
|
||||||
let list = config.resolved_ignore_patterns();
|
let list = config.resolved_ignore_patterns();
|
||||||
if list.is_empty() {
|
if list.is_empty() {
|
||||||
@@ -3767,39 +3776,80 @@ fn cmd_sync_ignore(action: IgnoreCmd) -> Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IgnoreCmd::Add { pattern } => {
|
IgnoreCmd::List {
|
||||||
let pattern = pattern.trim().to_string();
|
folder: Some(folder),
|
||||||
if let Err(e) = check_pattern(&pattern) {
|
} => {
|
||||||
bail!("not a valid pattern: {e}");
|
let (_, root) = mirror_folder_of(&folder)?;
|
||||||
|
let rules = FolderRules::read(&root)?;
|
||||||
|
let patterns = rules.patterns();
|
||||||
|
if patterns.is_empty() {
|
||||||
|
println!(
|
||||||
|
"{} has no own patterns; the ones for all synced folders apply.",
|
||||||
|
root.display()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
for pattern in patterns {
|
||||||
|
println!("{pattern}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IgnoreCmd::Add {
|
||||||
|
pattern,
|
||||||
|
folder: None,
|
||||||
|
} => {
|
||||||
|
let pattern = valid(&pattern)?;
|
||||||
change(&|list| {
|
change(&|list| {
|
||||||
if !list.contains(&pattern) {
|
if !list.contains(&pattern) {
|
||||||
list.push(pattern.clone());
|
list.push(pattern.clone());
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
IgnoreCmd::Remove { pattern } => {
|
IgnoreCmd::Add {
|
||||||
|
pattern,
|
||||||
|
folder: Some(folder),
|
||||||
|
} => {
|
||||||
|
let pattern = valid(&pattern)?;
|
||||||
|
let (id, root) = mirror_folder_of(&folder)?;
|
||||||
|
if add_folder_pattern(&root, &pattern)? {
|
||||||
|
let _ = control_request(CtlRequest::SyncNow { id: Some(id) });
|
||||||
|
} else {
|
||||||
|
println!("`{pattern}` is already in {}/.pdfsignore.", root.display());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
IgnoreCmd::Remove {
|
||||||
|
pattern,
|
||||||
|
folder: None,
|
||||||
|
} => {
|
||||||
|
let pattern = pattern.trim().to_string();
|
||||||
let list = dirs.load_config().resolved_ignore_patterns();
|
let list = dirs.load_config().resolved_ignore_patterns();
|
||||||
if !list.contains(&pattern) {
|
if !list.contains(&pattern) {
|
||||||
bail!("`{pattern}` is not in the list; see `pdfs sync ignore list`");
|
bail!("`{pattern}` is not in the list; see `pdfs sync ignore list`");
|
||||||
}
|
}
|
||||||
change(&|list| list.retain(|p| *p != pattern))?;
|
change(&|list| list.retain(|p| *p != pattern))?;
|
||||||
}
|
}
|
||||||
IgnoreCmd::Reset => change(&|list| *list = defaults.clone())?,
|
IgnoreCmd::Remove {
|
||||||
|
pattern,
|
||||||
|
folder: Some(folder),
|
||||||
|
} => {
|
||||||
|
let (id, root) = mirror_folder_of(&folder)?;
|
||||||
|
if !remove_folder_pattern(&root, &pattern)? {
|
||||||
|
bail!(
|
||||||
|
"`{}` is not among the own patterns of {}; see `pdfs sync ignore list --folder {}`",
|
||||||
|
pattern.trim(),
|
||||||
|
root.display(),
|
||||||
|
root.display()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let _ = control_request(CtlRequest::SyncNow { id: Some(id) });
|
||||||
|
}
|
||||||
|
IgnoreCmd::Reset => change(&|list| {
|
||||||
|
*list = DEFAULT_IGNORE_PATTERNS
|
||||||
|
.iter()
|
||||||
|
.map(|p| (*p).to_string())
|
||||||
|
.collect()
|
||||||
|
})?,
|
||||||
IgnoreCmd::Check { path } => {
|
IgnoreCmd::Check { path } => {
|
||||||
let path = std::path::absolute(&path)?;
|
let path = std::path::absolute(&path)?;
|
||||||
let folders = match control_request(CtlRequest::ListSyncFolders)? {
|
let folder = synced_folder_of(&path)?;
|
||||||
CtlResponse::SyncFolders { items } => items,
|
|
||||||
CtlResponse::Error { message, kind } => bail!("{}", cli_error(kind, &message)),
|
|
||||||
other => bail!("unexpected reply: {other:?}"),
|
|
||||||
};
|
|
||||||
let Some(folder) = folders
|
|
||||||
.iter()
|
|
||||||
.filter(|f| path.starts_with(&f.local_path))
|
|
||||||
.max_by_key(|f| f.local_path.len())
|
|
||||||
else {
|
|
||||||
bail!("{} is not in a synced folder", path.display());
|
|
||||||
};
|
|
||||||
if folder.mode != "mirror" {
|
if folder.mode != "mirror" {
|
||||||
println!(
|
println!(
|
||||||
"{} is online only; patterns apply only to folders kept on this computer.",
|
"{} is online only; patterns apply only to folders kept on this computer.",
|
||||||
@@ -3829,6 +3879,35 @@ fn cmd_sync_ignore(action: IgnoreCmd) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The synced folder holding `path`: the innermost one, as the daemon lists
|
||||||
|
/// them.
|
||||||
|
fn synced_folder_of(path: &Path) -> Result<SyncFolderInfo> {
|
||||||
|
let path = std::path::absolute(path)?;
|
||||||
|
let folders = match control_request(CtlRequest::ListSyncFolders)? {
|
||||||
|
CtlResponse::SyncFolders { items } => items,
|
||||||
|
CtlResponse::Error { message, kind } => bail!("{}", cli_error(kind, &message)),
|
||||||
|
other => bail!("unexpected reply: {other:?}"),
|
||||||
|
};
|
||||||
|
folders
|
||||||
|
.into_iter()
|
||||||
|
.filter(|f| path.starts_with(&f.local_path))
|
||||||
|
.max_by_key(|f| f.local_path.len())
|
||||||
|
.ok_or_else(|| anyhow!("{} is not in a synced folder", path.display()))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The id and root of the synced folder kept on this computer that holds
|
||||||
|
/// `path`. Own patterns mean nothing to an online-only folder.
|
||||||
|
fn mirror_folder_of(path: &Path) -> Result<(i64, PathBuf)> {
|
||||||
|
let folder = synced_folder_of(path)?;
|
||||||
|
if folder.mode != "mirror" {
|
||||||
|
bail!(
|
||||||
|
"{} is online only; patterns apply only to folders kept on this computer",
|
||||||
|
folder.local_path
|
||||||
|
);
|
||||||
|
}
|
||||||
|
Ok((folder.id, PathBuf::from(folder.local_path)))
|
||||||
|
}
|
||||||
|
|
||||||
/// How long the oldest write may wait to upload before `diagnose` calls it
|
/// How long the oldest write may wait to upload before `diagnose` calls it
|
||||||
/// out. Under a day it is a slow link or a big file; past it, something is
|
/// out. Under a day it is a slow link or a big file; past it, something is
|
||||||
/// holding the queue.
|
/// holding the queue.
|
||||||
@@ -4785,12 +4864,32 @@ mod login_wait_tests {
|
|||||||
cli.command,
|
cli.command,
|
||||||
Command::Sync {
|
Command::Sync {
|
||||||
action: SyncCmd::Ignore {
|
action: SyncCmd::Ignore {
|
||||||
action: IgnoreCmd::Add { ref pattern }
|
action: IgnoreCmd::Add {
|
||||||
|
ref pattern,
|
||||||
|
folder: None
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} if pattern == "-temp*"
|
} if pattern == "-temp*"
|
||||||
));
|
));
|
||||||
assert!(Cli::try_parse_from(["pdfs", "sync", "ignore", "add"]).is_err());
|
assert!(Cli::try_parse_from(["pdfs", "sync", "ignore", "add"]).is_err());
|
||||||
assert!(Cli::try_parse_from(["pdfs", "sync", "ignore", "reset"]).is_ok());
|
assert!(Cli::try_parse_from(["pdfs", "sync", "ignore", "reset"]).is_ok());
|
||||||
|
let cli =
|
||||||
|
Cli::try_parse_from(["pdfs", "sync", "ignore", "add", "*.db", "--folder", "Work"])
|
||||||
|
.unwrap();
|
||||||
|
assert!(matches!(
|
||||||
|
cli.command,
|
||||||
|
Command::Sync {
|
||||||
|
action: SyncCmd::Ignore {
|
||||||
|
action: IgnoreCmd::Add {
|
||||||
|
ref pattern,
|
||||||
|
folder: Some(ref folder)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} if pattern == "*.db" && folder == Path::new("Work")
|
||||||
|
));
|
||||||
|
assert!(
|
||||||
|
Cli::try_parse_from(["pdfs", "sync", "ignore", "list", "--folder", "Work"]).is_ok()
|
||||||
|
);
|
||||||
assert!(
|
assert!(
|
||||||
Cli::try_parse_from(["pdfs", "import-google-photos", "--resume", "a.zip"]).is_err()
|
Cli::try_parse_from(["pdfs", "import-google-photos", "--resume", "a.zip"]).is_err()
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -391,6 +391,27 @@ impl AppConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Apply `edit` to the ignore patterns in effect in the config at `path`,
|
||||||
|
/// under the config lock, and return the saved config. A list equal to the
|
||||||
|
/// built-in one is stored as unset, so it follows the built-in list in later
|
||||||
|
/// releases.
|
||||||
|
pub fn change_ignore_patterns_at(
|
||||||
|
path: &Path,
|
||||||
|
edit: impl FnOnce(&mut Vec<String>),
|
||||||
|
) -> Result<AppConfig> {
|
||||||
|
update_config_at(path, |config| {
|
||||||
|
let mut list = config.resolved_ignore_patterns();
|
||||||
|
edit(&mut list);
|
||||||
|
let builtin = list.len() == DEFAULT_IGNORE_PATTERNS.len()
|
||||||
|
&& list
|
||||||
|
.iter()
|
||||||
|
.zip(DEFAULT_IGNORE_PATTERNS)
|
||||||
|
.all(|(a, b)| a == b);
|
||||||
|
config.ignore_patterns = (!builtin).then_some(list);
|
||||||
|
config.clone()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/// Fail when the config file at `path` exists but does not parse, so that
|
/// Fail when the config file at `path` exists but does not parse, so that
|
||||||
/// [`AppDirs::save_config`] never writes over settings it could not read.
|
/// [`AppDirs::save_config`] never writes over settings it could not read.
|
||||||
fn refuse_to_replace_unreadable(path: &Path) -> Result<()> {
|
fn refuse_to_replace_unreadable(path: &Path) -> Result<()> {
|
||||||
@@ -565,6 +586,13 @@ impl AppDirs {
|
|||||||
update_config_at(&self.config_path(), change)
|
update_config_at(&self.config_path(), change)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Apply `edit` to the ignore patterns in effect for every synced folder
|
||||||
|
/// and save them, returning the saved config. See
|
||||||
|
/// [`change_ignore_patterns_at`].
|
||||||
|
pub fn change_ignore_patterns(&self, edit: impl FnOnce(&mut Vec<String>)) -> Result<AppConfig> {
|
||||||
|
change_ignore_patterns_at(&self.config_path(), edit)
|
||||||
|
}
|
||||||
|
|
||||||
/// This machine's id (e.g. ~/.config/proton-drive-linux/machine-id). See
|
/// This machine's id (e.g. ~/.config/proton-drive-linux/machine-id). See
|
||||||
/// [`machine_id`](Self::machine_id).
|
/// [`machine_id`](Self::machine_id).
|
||||||
pub fn machine_id_path(&self) -> PathBuf {
|
pub fn machine_id_path(&self) -> PathBuf {
|
||||||
@@ -798,6 +826,31 @@ mod tests {
|
|||||||
let _ = std::fs::remove_dir_all(&dir);
|
let _ = std::fs::remove_dir_all(&dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn ignore_patterns_back_at_the_built_in_list_are_stored_as_unset() {
|
||||||
|
let dir = std::env::temp_dir().join(format!(
|
||||||
|
"pdfs-cfg-ignore-{}-{:?}",
|
||||||
|
std::process::id(),
|
||||||
|
std::thread::current().id()
|
||||||
|
));
|
||||||
|
let _ = std::fs::remove_dir_all(&dir);
|
||||||
|
std::fs::create_dir_all(&dir).unwrap();
|
||||||
|
let path = dir.join("config.json");
|
||||||
|
|
||||||
|
let config = change_ignore_patterns_at(&path, |list| list.push("*.db".into())).unwrap();
|
||||||
|
assert_eq!(
|
||||||
|
config.ignore_patterns.as_ref().unwrap().last().unwrap(),
|
||||||
|
"*.db"
|
||||||
|
);
|
||||||
|
let config = change_ignore_patterns_at(&path, |list| list.retain(|p| p != "*.db")).unwrap();
|
||||||
|
assert_eq!(config.ignore_patterns, None);
|
||||||
|
assert_eq!(load_config_at(&path).ignore_patterns, None);
|
||||||
|
// An empty list is a choice, not the built-in one.
|
||||||
|
let config = change_ignore_patterns_at(&path, Vec::clear).unwrap();
|
||||||
|
assert_eq!(config.ignore_patterns, Some(Vec::new()));
|
||||||
|
let _ = std::fs::remove_dir_all(&dir);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_change_is_never_applied_over_an_unreadable_config() {
|
fn a_change_is_never_applied_over_an_unreadable_config() {
|
||||||
let dir = std::env::temp_dir().join(format!(
|
let dir = std::env::temp_dir().join(format!(
|
||||||
|
|||||||
@@ -262,6 +262,82 @@ impl FolderRules {
|
|||||||
}
|
}
|
||||||
Ok(written?)
|
Ok(written?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The patterns in the rules: every line that is not blank or a comment,
|
||||||
|
/// trimmed of surrounding white space.
|
||||||
|
pub fn patterns(&self) -> Vec<&str> {
|
||||||
|
self.text
|
||||||
|
.as_deref()
|
||||||
|
.unwrap_or_default()
|
||||||
|
.lines()
|
||||||
|
.map(str::trim)
|
||||||
|
.filter(|line| !line.is_empty() && !line.starts_with('#'))
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// How often [`add_folder_pattern`] and [`remove_folder_pattern`] read the
|
||||||
|
/// rules again when they changed between the read and the write.
|
||||||
|
const RULES_RETRIES: usize = 3;
|
||||||
|
|
||||||
|
/// Add `pattern` at the end of the own rules of the folder at `root`, keeping
|
||||||
|
/// every other line and comment. Says whether it added it: a pattern already
|
||||||
|
/// there is left alone.
|
||||||
|
pub fn add_folder_pattern(root: &Path, pattern: &str) -> std::io::Result<bool> {
|
||||||
|
let pattern = pattern.trim();
|
||||||
|
edit_folder_rules(root, |rules| {
|
||||||
|
if rules.patterns().contains(&pattern) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let mut text = rules.text.clone().unwrap_or_default();
|
||||||
|
if !text.is_empty() && !text.ends_with('\n') {
|
||||||
|
text.push('\n');
|
||||||
|
}
|
||||||
|
text.push_str(pattern);
|
||||||
|
text.push('\n');
|
||||||
|
Some(text)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Remove every line that is `pattern` from the own rules of the folder at
|
||||||
|
/// `root`. Says whether there was one.
|
||||||
|
pub fn remove_folder_pattern(root: &Path, pattern: &str) -> std::io::Result<bool> {
|
||||||
|
let pattern = pattern.trim();
|
||||||
|
edit_folder_rules(root, |rules| {
|
||||||
|
if !rules.patterns().contains(&pattern) {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let text = rules.text.as_deref().unwrap_or_default();
|
||||||
|
Some(
|
||||||
|
text.lines()
|
||||||
|
.filter(|line| line.trim() != pattern)
|
||||||
|
.map(|line| format!("{line}\n"))
|
||||||
|
.collect(),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Read the folder's rules, let `edit` return their new text (or `None` to
|
||||||
|
/// leave them), and write it. Rules that changed in between, such as by sync
|
||||||
|
/// bringing in an edit from another computer, are read again and edited anew.
|
||||||
|
fn edit_folder_rules(
|
||||||
|
root: &Path,
|
||||||
|
edit: impl Fn(&FolderRules) -> Option<String>,
|
||||||
|
) -> std::io::Result<bool> {
|
||||||
|
for _ in 0..RULES_RETRIES {
|
||||||
|
let rules = FolderRules::read(root)?;
|
||||||
|
let Some(text) = edit(&rules) else {
|
||||||
|
return Ok(false);
|
||||||
|
};
|
||||||
|
match rules.write(&text) {
|
||||||
|
Ok(()) => return Ok(true),
|
||||||
|
Err(WriteRulesError::Changed) => continue,
|
||||||
|
Err(WriteRulesError::Io(e)) => return Err(e),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(std::io::Error::other(
|
||||||
|
"the rules kept changing while they were being saved",
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Where a rule that decided about a path came from.
|
/// Where a rule that decided about a path came from.
|
||||||
@@ -639,6 +715,44 @@ mod tests {
|
|||||||
assert!(matches!(rules.write("c/"), Err(WriteRulesError::Changed)));
|
assert!(matches!(rules.write("c/"), Err(WriteRulesError::Changed)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn a_pattern_added_to_a_folder_keeps_its_other_lines() {
|
||||||
|
let dir = TempDir::new();
|
||||||
|
assert!(add_folder_pattern(dir.path(), " *.db ").unwrap());
|
||||||
|
assert_eq!(
|
||||||
|
std::fs::read_to_string(dir.path().join(".pdfsignore")).unwrap(),
|
||||||
|
"*.db\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
write(dir.path(), ".pdfsignore", "# my notes\nbuild/");
|
||||||
|
assert!(add_folder_pattern(dir.path(), "*.db").unwrap());
|
||||||
|
assert!(!add_folder_pattern(dir.path(), "build/").unwrap());
|
||||||
|
assert_eq!(
|
||||||
|
std::fs::read_to_string(dir.path().join(".pdfsignore")).unwrap(),
|
||||||
|
"# my notes\nbuild/\n*.db\n"
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
FolderRules::read(dir.path()).unwrap().patterns(),
|
||||||
|
["build/", "*.db"]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn removing_a_folder_pattern_keeps_comments_and_drops_an_empty_file() {
|
||||||
|
let dir = TempDir::new();
|
||||||
|
write(dir.path(), ".pdfsignore", "# keep\nbuild/\n*.db\n");
|
||||||
|
assert!(remove_folder_pattern(dir.path(), "build/").unwrap());
|
||||||
|
assert!(!remove_folder_pattern(dir.path(), "build/").unwrap());
|
||||||
|
assert_eq!(
|
||||||
|
std::fs::read_to_string(dir.path().join(".pdfsignore")).unwrap(),
|
||||||
|
"# keep\n*.db\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
write(dir.path(), ".pdfsignore", "*.db\n");
|
||||||
|
assert!(remove_folder_pattern(dir.path(), "*.db").unwrap());
|
||||||
|
assert!(!dir.path().join(".pdfsignore").exists());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn no_rules_at_all_ignores_nothing() {
|
fn no_rules_at_all_ignores_nothing() {
|
||||||
let dir = TempDir::new();
|
let dir = TempDir::new();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ use pages::preferences_sync::*;
|
|||||||
use pages::shared::*;
|
use pages::shared::*;
|
||||||
use pages::shared_by_me::*;
|
use pages::shared_by_me::*;
|
||||||
use pages::status::*;
|
use pages::status::*;
|
||||||
|
use pages::sync_exclusions::*;
|
||||||
use pages::takeout::*;
|
use pages::takeout::*;
|
||||||
use pages::trash::*;
|
use pages::trash::*;
|
||||||
use pages::verify::*;
|
use pages::verify::*;
|
||||||
@@ -344,7 +345,15 @@ fn present_window(app: &adw::Application) {
|
|||||||
|
|
||||||
/// Spawn the tray icon process in the background.
|
/// Spawn the tray icon process in the background.
|
||||||
pub(crate) fn spawn_tray() {
|
pub(crate) fn spawn_tray() {
|
||||||
match Command::new("pdfs-tray").spawn() {
|
// The tray installed next to this app, as the tray finds the app; the
|
||||||
|
// bare name for a PATH install. An install into ~/.local is often not on
|
||||||
|
// the PATH of a desktop session.
|
||||||
|
let tray = std::env::current_exe()
|
||||||
|
.ok()
|
||||||
|
.and_then(|p| p.parent().map(|d| d.join("pdfs-tray")))
|
||||||
|
.filter(|p| p.exists())
|
||||||
|
.unwrap_or_else(|| PathBuf::from("pdfs-tray"));
|
||||||
|
match Command::new(&tray).spawn() {
|
||||||
Ok(child) => {
|
Ok(child) => {
|
||||||
tracing::info!("spawned `pdfs-tray`");
|
tracing::info!("spawned `pdfs-tray`");
|
||||||
pdfs_core::opener::reap(child);
|
pdfs_core::opener::reap(child);
|
||||||
@@ -673,6 +682,13 @@ fn build_window(app: &adw::Application) {
|
|||||||
views: locations_widgets.views.clone(),
|
views: locations_widgets.views.clone(),
|
||||||
banner: locations_widgets.banner.clone(),
|
banner: locations_widgets.banner.clone(),
|
||||||
failing: Cell::new(0),
|
failing: Cell::new(0),
|
||||||
|
exclusions: ExclusionsState {
|
||||||
|
group: locations_widgets.exclusions_group.clone(),
|
||||||
|
add: locations_widgets.add_pattern.clone(),
|
||||||
|
rows: RefCell::new(Vec::new()),
|
||||||
|
folders: RefCell::new(Vec::new()),
|
||||||
|
generation: Cell::new(0),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
activity: ActivityState {
|
activity: ActivityState {
|
||||||
content: activity_widgets.content.clone(),
|
content: activity_widgets.content.clone(),
|
||||||
@@ -756,6 +772,7 @@ fn build_window(app: &adw::Application) {
|
|||||||
wire_shared_by_me(&ui, &shared_by_me_widgets);
|
wire_shared_by_me(&ui, &shared_by_me_widgets);
|
||||||
wire_devices(&ui, &devices_widgets);
|
wire_devices(&ui, &devices_widgets);
|
||||||
wire_locations(&ui, &locations_widgets.retry, &locations_widgets.add_folder);
|
wire_locations(&ui, &locations_widgets.retry, &locations_widgets.add_folder);
|
||||||
|
wire_exclusions(&ui);
|
||||||
wire_activity(&ui, &activity_widgets);
|
wire_activity(&ui, &activity_widgets);
|
||||||
wire_takeout(&ui, &takeout_widgets);
|
wire_takeout(&ui, &takeout_widgets);
|
||||||
wire_retry(&ui);
|
wire_retry(&ui);
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ pub(crate) struct LocationsState {
|
|||||||
pub(crate) banner: adw::Banner,
|
pub(crate) banner: adw::Banner,
|
||||||
/// Changes the daemon failed to upload, from the last status.
|
/// Changes the daemon failed to upload, from the last status.
|
||||||
pub(crate) failing: Cell<u64>,
|
pub(crate) failing: Cell<u64>,
|
||||||
|
/// Excluded Files, under the folder list.
|
||||||
|
pub(crate) exclusions: ExclusionsState,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The status card heading the Sync page's Overview, and Pause/Resume in the
|
/// The status card heading the Sync page's Overview, and Pause/Resume in the
|
||||||
@@ -120,6 +122,8 @@ pub(crate) struct LocationsWidgets {
|
|||||||
pub(crate) conflicts_group: adw::PreferencesGroup,
|
pub(crate) conflicts_group: adw::PreferencesGroup,
|
||||||
pub(crate) views: adw::ViewStack,
|
pub(crate) views: adw::ViewStack,
|
||||||
pub(crate) banner: adw::Banner,
|
pub(crate) banner: adw::Banner,
|
||||||
|
pub(crate) exclusions_group: adw::PreferencesGroup,
|
||||||
|
pub(crate) add_pattern: gtk4::Button,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The Sync page: Overview (the status, conflicts, transfers and queue),
|
/// The Sync page: Overview (the status, conflicts, transfers and queue),
|
||||||
@@ -208,8 +212,14 @@ pub(crate) fn build_locations_page(history: >k4::Widget) -> (gtk4::Widget, Loc
|
|||||||
.child(&status)
|
.child(&status)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
// What the folders leave out, under them: the rules belong to the folders.
|
||||||
|
let (exclusions_group, add_pattern) = build_exclusions_group();
|
||||||
|
let folders = gtk4::Box::new(gtk4::Orientation::Vertical, 24);
|
||||||
|
folders.append(&group);
|
||||||
|
folders.append(&exclusions_group);
|
||||||
|
|
||||||
let content = gtk4::Stack::new();
|
let content = gtk4::Stack::new();
|
||||||
content.add_named(&scrolled_column(&group), Some("list"));
|
content.add_named(&scrolled_column(&folders), Some("list"));
|
||||||
content.add_named(&status_scroll, Some("status"));
|
content.add_named(&status_scroll, Some("status"));
|
||||||
|
|
||||||
let views = adw::ViewStack::new();
|
let views = adw::ViewStack::new();
|
||||||
@@ -267,6 +277,8 @@ pub(crate) fn build_locations_page(history: >k4::Widget) -> (gtk4::Widget, Loc
|
|||||||
conflicts_group,
|
conflicts_group,
|
||||||
views,
|
views,
|
||||||
banner,
|
banner,
|
||||||
|
exclusions_group,
|
||||||
|
add_pattern,
|
||||||
};
|
};
|
||||||
(frame.upcast(), widgets)
|
(frame.upcast(), widgets)
|
||||||
}
|
}
|
||||||
@@ -1243,6 +1255,7 @@ pub(crate) fn repaint_locations(ui: &Rc<Ui>, items: &[MountSpec]) {
|
|||||||
};
|
};
|
||||||
if !unchanged {
|
if !unchanged {
|
||||||
rebuild_locations(ui, items, keys);
|
rebuild_locations(ui, items, keys);
|
||||||
|
paint_exclusions(ui, items);
|
||||||
}
|
}
|
||||||
for (row, spec) in ui.locations.rows.borrow().iter().zip(items) {
|
for (row, spec) in ui.locations.rows.borrow().iter().zip(items) {
|
||||||
update_location_row(row, spec);
|
update_location_row(row, spec);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ pub(crate) mod preferences_sync;
|
|||||||
pub(crate) mod shared;
|
pub(crate) mod shared;
|
||||||
pub(crate) mod shared_by_me;
|
pub(crate) mod shared_by_me;
|
||||||
pub(crate) mod status;
|
pub(crate) mod status;
|
||||||
|
pub(crate) mod sync_exclusions;
|
||||||
pub(crate) mod takeout;
|
pub(crate) mod takeout;
|
||||||
pub(crate) mod trash;
|
pub(crate) mod trash;
|
||||||
pub(crate) mod verify;
|
pub(crate) mod verify;
|
||||||
@@ -85,6 +85,13 @@ pub(crate) fn wire_sync_prefs(ui: &Rc<Ui>, widgets: SyncPrefs) {
|
|||||||
let rows: Rc<RefCell<Vec<adw::PreferencesRow>>> = Rc::default();
|
let rows: Rc<RefCell<Vec<adw::PreferencesRow>>> = Rc::default();
|
||||||
let config = ui.dirs.load_config();
|
let config = ui.dirs.load_config();
|
||||||
paint_patterns(ui, &widgets, &rows, &config);
|
paint_patterns(ui, &widgets, &rows, &config);
|
||||||
|
// The Sync page and `pdfs sync ignore` change the patterns too: show the
|
||||||
|
// saved ones each time the page comes up.
|
||||||
|
let (ui_map, w_map, rows_map) = (ui.clone(), widgets.clone(), rows.clone());
|
||||||
|
widgets.page.connect_map(move |_| {
|
||||||
|
let config = ui_map.dirs.load_config();
|
||||||
|
paint_patterns(&ui_map, &w_map, &rows_map, &config);
|
||||||
|
});
|
||||||
|
|
||||||
let mode = config.conflict_sweep.unwrap_or_default();
|
let mode = config.conflict_sweep.unwrap_or_default();
|
||||||
let suppress = ui.status.settings_suppress.replace(true);
|
let suppress = ui.status.settings_suppress.replace(true);
|
||||||
@@ -184,22 +191,14 @@ fn default_patterns() -> Vec<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Apply `edit` to the patterns in effect and save them, then show them and
|
/// Apply `edit` to the patterns in effect and save them, then show them and
|
||||||
/// have every synced folder sync with them. A list equal to the built-in one
|
/// have every synced folder sync with them. Says whether it saved.
|
||||||
/// is saved as "unset", so it follows the built-in list in later releases.
|
|
||||||
/// Says whether it saved.
|
|
||||||
fn change_patterns(
|
fn change_patterns(
|
||||||
ui: &Rc<Ui>,
|
ui: &Rc<Ui>,
|
||||||
widgets: &Rc<SyncPrefs>,
|
widgets: &Rc<SyncPrefs>,
|
||||||
rows: &Rc<RefCell<Vec<adw::PreferencesRow>>>,
|
rows: &Rc<RefCell<Vec<adw::PreferencesRow>>>,
|
||||||
edit: impl FnOnce(&mut Vec<String>),
|
edit: impl FnOnce(&mut Vec<String>),
|
||||||
) -> bool {
|
) -> bool {
|
||||||
let saved = ui.dirs.update_config(|config| {
|
match ui.dirs.change_ignore_patterns(edit) {
|
||||||
let mut list = config.resolved_ignore_patterns();
|
|
||||||
edit(&mut list);
|
|
||||||
config.ignore_patterns = (list != default_patterns()).then_some(list);
|
|
||||||
config.clone()
|
|
||||||
});
|
|
||||||
match saved {
|
|
||||||
Ok(config) => {
|
Ok(config) => {
|
||||||
paint_patterns(ui, widgets, rows, &config);
|
paint_patterns(ui, widgets, rows, &config);
|
||||||
// Best effort: the next pass picks the change up anyway.
|
// Best effort: the next pass picks the change up anyway.
|
||||||
|
|||||||
@@ -0,0 +1,426 @@
|
|||||||
|
//! The Excluded Files group on the Sync page's Folders view: what is left out
|
||||||
|
//! of every synced folder and of each one on its own, with how many patterns
|
||||||
|
//! each has, and an Add Pattern dialog that asks where a pattern goes.
|
||||||
|
//!
|
||||||
|
//! The rows open the editors that already exist: Preferences → Sync for the
|
||||||
|
//! patterns of all folders, the Excluded Files dialog for a folder's own
|
||||||
|
//! `.pdfsignore`. Only folders kept on this computer are listed; an
|
||||||
|
//! online-only folder has no local files for patterns to leave out. With none
|
||||||
|
//! of those, the group still shows, so the patterns can be found and set up
|
||||||
|
//! before a folder is switched to Synced, and says why they do nothing yet.
|
||||||
|
|
||||||
|
use crate::*;
|
||||||
|
use pdfs_core::syncignore::{FolderRules, add_folder_pattern, check_pattern};
|
||||||
|
|
||||||
|
pub(crate) struct ExclusionsState {
|
||||||
|
pub(crate) group: adw::PreferencesGroup,
|
||||||
|
pub(crate) add: gtk4::Button,
|
||||||
|
pub(crate) rows: RefCell<Vec<adw::ActionRow>>,
|
||||||
|
/// The synced folders kept on this computer the rows were built for, as
|
||||||
|
/// id and root.
|
||||||
|
pub(crate) folders: RefCell<Vec<(i64, PathBuf)>>,
|
||||||
|
/// Counts painted, so a slow read from an older paint does not land on
|
||||||
|
/// newer rows.
|
||||||
|
pub(crate) generation: Cell<u64>,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn build_exclusions_group() -> (adw::PreferencesGroup, gtk4::Button) {
|
||||||
|
let add = gtk4::Button::builder()
|
||||||
|
.child(
|
||||||
|
&adw::ButtonContent::builder()
|
||||||
|
.label(gettext("Add Pattern"))
|
||||||
|
.icon_name("list-add-symbolic")
|
||||||
|
.build(),
|
||||||
|
)
|
||||||
|
.tooltip_text(gettext(
|
||||||
|
"Leave files matching a pattern out of all synced folders or one of them",
|
||||||
|
))
|
||||||
|
.valign(gtk4::Align::Center)
|
||||||
|
.build();
|
||||||
|
add.add_css_class("flat");
|
||||||
|
let group = adw::PreferencesGroup::builder()
|
||||||
|
.title(gettext("Excluded Files"))
|
||||||
|
.description(gettext(
|
||||||
|
"Files matching these patterns stay on this computer and are not synced. Excluding never deletes anything from Proton Drive.",
|
||||||
|
))
|
||||||
|
.header_suffix(&add)
|
||||||
|
.visible(false)
|
||||||
|
.build();
|
||||||
|
(group, add)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) fn wire_exclusions(ui: &Rc<Ui>) {
|
||||||
|
let ui_add = ui.clone();
|
||||||
|
ui.locations
|
||||||
|
.exclusions
|
||||||
|
.add
|
||||||
|
.connect_clicked(move |_| present_add_pattern_dialog(&ui_add, None));
|
||||||
|
// Preferences change the patterns of all folders; show the new count.
|
||||||
|
let ui_prefs = ui.clone();
|
||||||
|
ui.status
|
||||||
|
.prefs
|
||||||
|
.connect_closed(move |_| refresh_exclusions(&ui_prefs));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Rebuild the rows for the folders in `items` when the set of synced folders
|
||||||
|
/// kept on this computer changed, or on the first paint. The tick repaints the folder list every few
|
||||||
|
/// seconds; the rows and their counts stay as they are in between.
|
||||||
|
pub(crate) fn paint_exclusions(ui: &Rc<Ui>, items: &[MountSpec]) {
|
||||||
|
let folders: Vec<(i64, PathBuf)> = items
|
||||||
|
.iter()
|
||||||
|
.filter(|spec| spec.mode == MountMode::Mirror)
|
||||||
|
.filter_map(|spec| match spec.kind {
|
||||||
|
MountKind::Device { sync_folder_id } | MountKind::Attached { sync_folder_id } => {
|
||||||
|
Some((sync_folder_id, PathBuf::from(&spec.local_path)))
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
let state = &ui.locations.exclusions;
|
||||||
|
if *state.folders.borrow() == folders && !state.rows.borrow().is_empty() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*state.folders.borrow_mut() = folders;
|
||||||
|
refresh_exclusions(ui);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Build the rows again from the folders last painted, and read every count
|
||||||
|
/// anew: after a pattern was added or a list edited.
|
||||||
|
pub(crate) fn refresh_exclusions(ui: &Rc<Ui>) {
|
||||||
|
let state = &ui.locations.exclusions;
|
||||||
|
for row in state.rows.borrow_mut().drain(..) {
|
||||||
|
state.group.remove(&row);
|
||||||
|
}
|
||||||
|
let folders = state.folders.borrow().clone();
|
||||||
|
state.group.set_visible(true);
|
||||||
|
let generation = state.generation.get() + 1;
|
||||||
|
state.generation.set(generation);
|
||||||
|
|
||||||
|
let config = ui.dirs.load_config();
|
||||||
|
let all = adw::ActionRow::builder()
|
||||||
|
.title(gettext("All Synced Folders"))
|
||||||
|
.subtitle(glib::markup_escape_text(&all_folders_subtitle(&config)).as_str())
|
||||||
|
.activatable(true)
|
||||||
|
.build();
|
||||||
|
all.add_prefix(>k4::Image::from_icon_name("view-list-symbolic"));
|
||||||
|
all.add_suffix(>k4::Image::from_icon_name("go-next-symbolic"));
|
||||||
|
let ui_all = ui.clone();
|
||||||
|
all.connect_activated(move |_| {
|
||||||
|
let prefs = &ui_all.status.prefs;
|
||||||
|
prefs.set_visible_page_name("sync");
|
||||||
|
prefs.present(ui_window(&ui_all).as_ref());
|
||||||
|
});
|
||||||
|
state.group.add(&all);
|
||||||
|
let mut rows = vec![all];
|
||||||
|
if folders.is_empty() {
|
||||||
|
let none = adw::ActionRow::builder()
|
||||||
|
.title(gettext("No folder is set to Synced"))
|
||||||
|
.subtitle(gettext(
|
||||||
|
"Patterns apply only to folders kept on this computer. Online-only folders upload every file saved in them.",
|
||||||
|
))
|
||||||
|
.build();
|
||||||
|
none.add_prefix(>k4::Image::from_icon_name("info-outline-symbolic"));
|
||||||
|
state.group.add(&none);
|
||||||
|
rows.push(none);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut counted = Vec::new();
|
||||||
|
for (id, root) in folders {
|
||||||
|
let name = root
|
||||||
|
.file_name()
|
||||||
|
.map(|name| name.to_string_lossy().into_owned())
|
||||||
|
.unwrap_or_else(|| root.display().to_string());
|
||||||
|
let row = adw::ActionRow::builder()
|
||||||
|
.title(glib::markup_escape_text(&name).as_str())
|
||||||
|
.tooltip_text(root.display().to_string())
|
||||||
|
.subtitle(glib::markup_escape_text(&tilde_path(&root.display().to_string())).as_str())
|
||||||
|
.subtitle_lines(1)
|
||||||
|
.activatable(true)
|
||||||
|
.build();
|
||||||
|
row.add_prefix(>k4::Image::from_icon_name("folder-symbolic"));
|
||||||
|
row.add_suffix(>k4::Image::from_icon_name("go-next-symbolic"));
|
||||||
|
let (ui_row, root_row) = (ui.clone(), root.clone());
|
||||||
|
row.connect_activated(move |_| present_ignore_dialog(&ui_row, id, root_row.clone()));
|
||||||
|
state.group.add(&row);
|
||||||
|
counted.push((row.clone(), root));
|
||||||
|
rows.push(row);
|
||||||
|
}
|
||||||
|
*state.rows.borrow_mut() = rows;
|
||||||
|
|
||||||
|
// A folder may sit on a slow or sleeping disk: count off the main thread.
|
||||||
|
let ui = ui.clone();
|
||||||
|
glib::spawn_future_local(async move {
|
||||||
|
let roots: Vec<PathBuf> = counted.iter().map(|(_, root)| root.clone()).collect();
|
||||||
|
let counts = gio::spawn_blocking(move || {
|
||||||
|
roots
|
||||||
|
.iter()
|
||||||
|
.map(|root| {
|
||||||
|
FolderRules::read(root)
|
||||||
|
.ok()
|
||||||
|
.map(|rules| rules.patterns().len())
|
||||||
|
})
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.unwrap_or_default();
|
||||||
|
if ui.locations.exclusions.generation.get() != generation {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for ((row, root), count) in counted.iter().zip(counts) {
|
||||||
|
let state = match count {
|
||||||
|
Some(0) => gettext("no own patterns"),
|
||||||
|
// Translators: how many patterns a synced folder has of its own.
|
||||||
|
Some(n) => ngettext_f("{n} own pattern", "{n} own patterns", n as u64, &[]),
|
||||||
|
None => gettext("own patterns unreadable"),
|
||||||
|
};
|
||||||
|
// Translators: a synced folder's location and how many patterns of its own it has, such as "~/Projects · 2 own patterns".
|
||||||
|
let subtitle = gettext_f(
|
||||||
|
"{path} · {state}",
|
||||||
|
&[
|
||||||
|
("path", &tilde_path(&root.display().to_string())),
|
||||||
|
("state", &state),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
row.set_subtitle(glib::markup_escape_text(&subtitle).as_str());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// How many patterns apply to every synced folder, and whether they are the
|
||||||
|
/// built-in ones.
|
||||||
|
fn all_folders_subtitle(config: &pdfs_core::config::AppConfig) -> String {
|
||||||
|
let n = config.resolved_ignore_patterns().len() as u64;
|
||||||
|
match (&config.ignore_patterns, n) {
|
||||||
|
(_, 0) => gettext("No patterns: every file is synced"),
|
||||||
|
(None, n) => ngettext_f("{n} built-in pattern", "{n} built-in patterns", n, &[]),
|
||||||
|
(Some(_), n) => ngettext_f("{n} pattern", "{n} patterns", n, &[]),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Ask for a pattern and where it applies: every synced folder, or one of
|
||||||
|
/// them (`folder`, preselected when given).
|
||||||
|
pub(crate) fn present_add_pattern_dialog(ui: &Rc<Ui>, folder: Option<i64>) {
|
||||||
|
let folders = ui.locations.exclusions.folders.borrow().clone();
|
||||||
|
let pattern_row = adw::EntryRow::builder().title(gettext("Pattern")).build();
|
||||||
|
pattern_row.add_css_class("monospace");
|
||||||
|
let mut places = vec![gettext("All synced folders")];
|
||||||
|
places.extend(
|
||||||
|
folders
|
||||||
|
.iter()
|
||||||
|
.map(|(_, root)| tilde_path(&root.display().to_string())),
|
||||||
|
);
|
||||||
|
let places: Vec<&str> = places.iter().map(String::as_str).collect();
|
||||||
|
let scope_row = adw::ComboRow::builder()
|
||||||
|
.title(gettext("Apply To"))
|
||||||
|
.model(>k4::StringList::new(&places))
|
||||||
|
.build();
|
||||||
|
if let Some(at) = folder.and_then(|id| folders.iter().position(|(f, _)| *f == id)) {
|
||||||
|
scope_row.set_selected(at as u32 + 1);
|
||||||
|
}
|
||||||
|
let rows = adw::PreferencesGroup::new();
|
||||||
|
rows.add(&pattern_row);
|
||||||
|
rows.add(&scope_row);
|
||||||
|
|
||||||
|
let hint = gtk4::Label::builder()
|
||||||
|
.label(gettext(
|
||||||
|
"Use * for any characters, such as *.db, and end a pattern with / to match folders only, such as build/.",
|
||||||
|
))
|
||||||
|
.wrap(true)
|
||||||
|
.xalign(0.0)
|
||||||
|
.build();
|
||||||
|
hint.add_css_class("dim-label");
|
||||||
|
hint.add_css_class("caption");
|
||||||
|
let problem = gtk4::Label::builder()
|
||||||
|
.wrap(true)
|
||||||
|
.xalign(0.0)
|
||||||
|
.visible(false)
|
||||||
|
.build();
|
||||||
|
problem.add_css_class("error");
|
||||||
|
|
||||||
|
let body = gtk4::Box::new(gtk4::Orientation::Vertical, 12);
|
||||||
|
body.set_margin_top(12);
|
||||||
|
body.set_margin_bottom(18);
|
||||||
|
body.set_margin_start(18);
|
||||||
|
body.set_margin_end(18);
|
||||||
|
body.append(&rows);
|
||||||
|
body.append(&hint);
|
||||||
|
body.append(&problem);
|
||||||
|
|
||||||
|
let cancel = gtk4::Button::with_label(&gettext("Cancel"));
|
||||||
|
let add = gtk4::Button::with_label(&gettext("Add"));
|
||||||
|
add.add_css_class("suggested-action");
|
||||||
|
add.set_sensitive(false);
|
||||||
|
let header = adw::HeaderBar::builder()
|
||||||
|
.show_start_title_buttons(false)
|
||||||
|
.show_end_title_buttons(false)
|
||||||
|
.build();
|
||||||
|
header.pack_start(&cancel);
|
||||||
|
header.pack_end(&add);
|
||||||
|
let view = adw::ToolbarView::new();
|
||||||
|
view.add_top_bar(&header);
|
||||||
|
view.set_content(Some(&body));
|
||||||
|
let dialog = adw::Dialog::builder()
|
||||||
|
.title(gettext("Add Pattern"))
|
||||||
|
.content_width(460)
|
||||||
|
.child(&view)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
let (add_check, problem_check) = (add.clone(), problem.clone());
|
||||||
|
pattern_row.connect_changed(move |row| {
|
||||||
|
let verdict = pattern_problem(&row.text());
|
||||||
|
match &verdict {
|
||||||
|
Some(message) if !row.text().trim().is_empty() => {
|
||||||
|
row.add_css_class("error");
|
||||||
|
problem_check.set_text(message);
|
||||||
|
problem_check.set_visible(true);
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
row.remove_css_class("error");
|
||||||
|
problem_check.set_visible(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_check.set_sensitive(verdict.is_none());
|
||||||
|
});
|
||||||
|
let d = dialog.clone();
|
||||||
|
cancel.connect_clicked(move |_| {
|
||||||
|
d.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
let submit = {
|
||||||
|
let (ui, dialog, pattern_row, scope_row, add, problem) = (
|
||||||
|
ui.clone(),
|
||||||
|
dialog.clone(),
|
||||||
|
pattern_row.clone(),
|
||||||
|
scope_row.clone(),
|
||||||
|
add.clone(),
|
||||||
|
problem.clone(),
|
||||||
|
);
|
||||||
|
move || {
|
||||||
|
if !add.is_sensitive() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let pattern = pattern_row.text().trim().to_string();
|
||||||
|
let target = match scope_row.selected() {
|
||||||
|
0 => None,
|
||||||
|
at => folders.get(at as usize - 1).cloned(),
|
||||||
|
};
|
||||||
|
// One click, one save: the button comes back if the save fails.
|
||||||
|
add.set_sensitive(false);
|
||||||
|
add_pattern(&ui, &dialog, &add, &problem, pattern, target);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
let submit_enter = submit.clone();
|
||||||
|
pattern_row.connect_entry_activated(move |_| submit_enter());
|
||||||
|
add.connect_clicked(move |_| submit());
|
||||||
|
|
||||||
|
dialog.present(ui_window(ui).as_ref());
|
||||||
|
pattern_row.grab_focus();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// What is wrong with `text` as a pattern to add, or `None` when it is one.
|
||||||
|
fn pattern_problem(text: &str) -> Option<String> {
|
||||||
|
let text = text.trim();
|
||||||
|
if text.is_empty() {
|
||||||
|
return Some(String::new());
|
||||||
|
}
|
||||||
|
if text.starts_with('#') {
|
||||||
|
return Some(gettext(
|
||||||
|
"A line starting with # is a comment, not a pattern.",
|
||||||
|
));
|
||||||
|
}
|
||||||
|
check_pattern(text).err().map(|e| {
|
||||||
|
tracing::debug!(pattern = %text, error = %e, "not a valid ignore pattern");
|
||||||
|
// Translators: {pattern} is what the user typed as a pattern.
|
||||||
|
gettext_f("“{pattern}” isn't a valid pattern.", &[("pattern", text)])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Save `pattern` for every synced folder (`target` is `None`) or for the
|
||||||
|
/// folder `target`, then close `dialog`, say so and sync. A failure shows in
|
||||||
|
/// `problem`, in the dialog, which stays open.
|
||||||
|
fn add_pattern(
|
||||||
|
ui: &Rc<Ui>,
|
||||||
|
dialog: &adw::Dialog,
|
||||||
|
add: >k4::Button,
|
||||||
|
problem: >k4::Label,
|
||||||
|
pattern: String,
|
||||||
|
target: Option<(i64, PathBuf)>,
|
||||||
|
) {
|
||||||
|
let (ui, dialog, add, problem) = (ui.clone(), dialog.clone(), add.clone(), problem.clone());
|
||||||
|
glib::spawn_future_local(async move {
|
||||||
|
let (id, place) = match &target {
|
||||||
|
None => (None, gettext("all synced folders")),
|
||||||
|
Some((id, root)) => (Some(*id), tilde_path(&root.display().to_string())),
|
||||||
|
};
|
||||||
|
let added: Result<bool, String> = match target {
|
||||||
|
None => {
|
||||||
|
let mut added = false;
|
||||||
|
ui.dirs
|
||||||
|
.change_ignore_patterns(|list| {
|
||||||
|
if !list.contains(&pattern) {
|
||||||
|
list.push(pattern.clone());
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.map(|_| added)
|
||||||
|
.map_err(|e| e.to_string())
|
||||||
|
}
|
||||||
|
Some((_, root)) => {
|
||||||
|
let p = pattern.clone();
|
||||||
|
gio::spawn_blocking(move || add_folder_pattern(&root, &p))
|
||||||
|
.await
|
||||||
|
.unwrap_or_else(|_| Err(std::io::Error::other("the save did not finish")))
|
||||||
|
.map_err(|e| e.to_string())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
match added {
|
||||||
|
Ok(added) => {
|
||||||
|
dialog.close();
|
||||||
|
let message = if added {
|
||||||
|
// Translators: {pattern} is an ignore pattern, {place} "all synced folders" or a folder path.
|
||||||
|
gettext_f(
|
||||||
|
"“{pattern}” is now excluded in {place}",
|
||||||
|
&[("pattern", &pattern), ("place", &place)],
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
gettext_f(
|
||||||
|
"“{pattern}” was already excluded in {place}",
|
||||||
|
&[("pattern", &pattern), ("place", &place)],
|
||||||
|
)
|
||||||
|
};
|
||||||
|
toast(&ui, &message);
|
||||||
|
refresh_exclusions(&ui);
|
||||||
|
if added {
|
||||||
|
// Best effort: the next pass picks the change up anyway.
|
||||||
|
let _ = spawn_request(ui.dirs.control_socket(), Request::SyncNow { id });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
add.set_sensitive(true);
|
||||||
|
problem.set_text(&gettext_f(
|
||||||
|
"{what}: {detail}",
|
||||||
|
&[
|
||||||
|
("what", &gettext("Couldn't save the patterns")),
|
||||||
|
("detail", &e),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
problem.set_visible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn only_real_patterns_can_be_added() {
|
||||||
|
assert!(pattern_problem("*.db").is_none());
|
||||||
|
assert!(pattern_problem(" build/ ").is_none());
|
||||||
|
assert!(pattern_problem("").is_some());
|
||||||
|
assert!(pattern_problem(" ").is_some());
|
||||||
|
assert!(pattern_problem("# note").is_some());
|
||||||
|
assert!(pattern_problem("*.{jpg,png").is_some());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -238,6 +238,7 @@ fn write_rules(
|
|||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
dialog.close();
|
dialog.close();
|
||||||
toast(&ui, &gettext("Excluded files saved"));
|
toast(&ui, &gettext("Excluded files saved"));
|
||||||
|
refresh_exclusions(&ui);
|
||||||
let _ = spawn_request(ui.dirs.control_socket(), Request::SyncNow { id: Some(id) });
|
let _ = spawn_request(ui.dirs.control_socket(), Request::SyncNow { id: Some(id) });
|
||||||
}
|
}
|
||||||
Err(WriteRulesError::Changed) => {
|
Err(WriteRulesError::Changed) => {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
use gettextrs::LocaleCategory;
|
use gettextrs::LocaleCategory;
|
||||||
use pdfs_core::config::AppDirs;
|
use pdfs_core::config::AppDirs;
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
/// The gettext text domain, matching `po/pdfs.pot` and the installed `.mo` name.
|
/// The gettext text domain, matching `po/pdfs.pot` and the installed `.mo` name.
|
||||||
pub(crate) const DOMAIN: &str = "pdfs";
|
pub(crate) const DOMAIN: &str = "pdfs";
|
||||||
@@ -53,14 +54,11 @@ pub(crate) fn init() {
|
|||||||
if let Some(code) = language {
|
if let Some(code) = language {
|
||||||
apply_language(&code);
|
apply_language(&code);
|
||||||
}
|
}
|
||||||
let dir = std::env::var(LOCALEDIR_ENV)
|
let dir = locale_dir(
|
||||||
.ok()
|
std::env::var(LOCALEDIR_ENV).ok(),
|
||||||
.filter(|dir| !dir.is_empty())
|
option_env!("PDFS_LOCALEDIR"),
|
||||||
.unwrap_or_else(|| {
|
std::env::current_exe().ok(),
|
||||||
option_env!("PDFS_LOCALEDIR")
|
);
|
||||||
.unwrap_or(DEFAULT_LOCALEDIR)
|
|
||||||
.to_string()
|
|
||||||
});
|
|
||||||
if let Err(e) = gettextrs::bindtextdomain(DOMAIN, dir) {
|
if let Err(e) = gettextrs::bindtextdomain(DOMAIN, dir) {
|
||||||
tracing::warn!("bindtextdomain failed: {e}");
|
tracing::warn!("bindtextdomain failed: {e}");
|
||||||
}
|
}
|
||||||
@@ -73,6 +71,33 @@ pub(crate) fn init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Where the catalogs are: `$PDFS_LOCALEDIR`, then the directory the build
|
||||||
|
/// named, then `share/locale` beside the `bin` directory the program runs
|
||||||
|
/// from when that holds a catalog of ours, then [`DEFAULT_LOCALEDIR`].
|
||||||
|
///
|
||||||
|
/// The third is for an install outside `/usr`, such as the release tarball's
|
||||||
|
/// `install.sh` into `~/.local`: its programs find their translations without
|
||||||
|
/// a wrapper setting the variable.
|
||||||
|
fn locale_dir(env: Option<String>, build: Option<&str>, exe: Option<PathBuf>) -> PathBuf {
|
||||||
|
if let Some(dir) = env.filter(|dir| !dir.is_empty()) {
|
||||||
|
return PathBuf::from(dir);
|
||||||
|
}
|
||||||
|
if let Some(dir) = build {
|
||||||
|
return PathBuf::from(dir);
|
||||||
|
}
|
||||||
|
let beside = exe
|
||||||
|
.as_deref()
|
||||||
|
.and_then(Path::parent)
|
||||||
|
.and_then(Path::parent)
|
||||||
|
.map(|prefix| prefix.join("share/locale"))
|
||||||
|
.filter(|dir| {
|
||||||
|
LANGUAGES
|
||||||
|
.iter()
|
||||||
|
.any(|(code, _)| dir.join(code).join("LC_MESSAGES/pdfs.mo").is_file())
|
||||||
|
});
|
||||||
|
beside.unwrap_or_else(|| PathBuf::from(DEFAULT_LOCALEDIR))
|
||||||
|
}
|
||||||
|
|
||||||
/// The iso-codes text domain that translates ISO 3166-1 country names.
|
/// The iso-codes text domain that translates ISO 3166-1 country names.
|
||||||
const ISO_3166_DOMAIN: &str = "iso_3166-1";
|
const ISO_3166_DOMAIN: &str = "iso_3166-1";
|
||||||
|
|
||||||
@@ -234,6 +259,32 @@ fn fill(template: &str, args: &[(&str, &str)]) -> String {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn the_catalogs_are_found_beside_an_install_outside_usr() {
|
||||||
|
let prefix = std::env::temp_dir().join(format!("pdfs-locale-{}", std::process::id()));
|
||||||
|
let mo = prefix.join("share/locale/de/LC_MESSAGES/pdfs.mo");
|
||||||
|
std::fs::create_dir_all(mo.parent().unwrap()).unwrap();
|
||||||
|
std::fs::write(&mo, b"").unwrap();
|
||||||
|
let exe = Some(prefix.join("bin/pdfs-app"));
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
locale_dir(None, None, exe.clone()),
|
||||||
|
prefix.join("share/locale")
|
||||||
|
);
|
||||||
|
// The variable and the build's own choice still win.
|
||||||
|
assert_eq!(
|
||||||
|
locale_dir(Some("/x".into()), Some("/y"), exe.clone()),
|
||||||
|
PathBuf::from("/x")
|
||||||
|
);
|
||||||
|
assert_eq!(locale_dir(None, Some("/y"), exe), PathBuf::from("/y"));
|
||||||
|
// A prefix without our catalogs falls back to the system's.
|
||||||
|
assert_eq!(
|
||||||
|
locale_dir(None, None, Some(PathBuf::from("/nonexistent/bin/pdfs-app"))),
|
||||||
|
PathBuf::from(DEFAULT_LOCALEDIR)
|
||||||
|
);
|
||||||
|
let _ = std::fs::remove_dir_all(&prefix);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn fill_replaces_named_placeholders_in_any_order() {
|
fn fill_replaces_named_placeholders_in_any_order() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|||||||
@@ -29,16 +29,28 @@ Existing folders stay device backups. Older builds cannot open the upgraded data
|
|||||||
- **Apps → Search Launcher**: whether `pdfs-prompt` opens its own window, your dmenu-style
|
- **Apps → Search Launcher**: whether `pdfs-prompt` opens its own window, your dmenu-style
|
||||||
launcher (rofi, wofi, fuzzel, bemenu) or fzf in a terminal.
|
launcher (rofi, wofi, fuzzel, bemenu) or fzf in a terminal.
|
||||||
|
|
||||||
Each synced folder kept on this computer has **Excluded Files…** in its menu on the Sync page,
|
The Sync page's Folders view lists **Excluded Files** under the folders: how many patterns
|
||||||
for its own `.pdfsignore`. It checks every line as you type, tells you whether a path is synced
|
apply to all of them and to each one, and **Add Pattern** to add one for all synced folders or
|
||||||
and which pattern decides, and asks before replacing rules that changed on another computer
|
for a single folder. A folder's own rules (its `.pdfsignore`) open in an editor, also from the
|
||||||
meanwhile. `pdfs sync ignore list|add|remove|reset|check` does the same from a terminal.
|
folder's menu. It checks every line as you type, tells you whether a path is synced and which
|
||||||
|
pattern decides, and asks before replacing rules that changed on another computer meanwhile.
|
||||||
|
`pdfs sync ignore list|add|remove|reset|check` does the same from a terminal, and `--folder`
|
||||||
|
picks a single folder.
|
||||||
`pdfs-app --page preferences-sync` (or `-apps`, `-storage`, plain `preferences`) opens
|
`pdfs-app --page preferences-sync` (or `-apps`, `-storage`, plain `preferences`) opens
|
||||||
Preferences at that page.
|
Preferences at that page.
|
||||||
- **More clutter left out of synced folders by default**: `desktop.ini`, `.directory`, trash
|
- **More clutter left out of synced folders by default**: `desktop.ini`, `.directory`, trash
|
||||||
folders, `.fuse_hidden*` and `.nfs*` leftovers, partial downloads (`*.part`, `*.crdownload`),
|
folders, `.fuse_hidden*` and `.nfs*` leftovers, partial downloads (`*.part`, `*.crdownload`),
|
||||||
Kate swap files and office lock files. This only changes folders where you never set your own
|
Kate swap files and office lock files. This only changes folders where you never set your own
|
||||||
list. Leaving a file out never deletes its copy on Proton Drive.
|
list. Leaving a file out never deletes its copy on Proton Drive.
|
||||||
|
- **An install without a package, for immutable distributions** (#99). The release `.tar.gz` now
|
||||||
|
carries everything around the programs and an `install.sh` that installs them into your home
|
||||||
|
folder, no root needed: `~/.local` for the programs, menu entry, icon, translations and shell
|
||||||
|
completion, `~/.config` for the service and the tray's login entry. It checks the libraries
|
||||||
|
first and names the packages to install, refuses to install next to a package of the client,
|
||||||
|
updates in place (restarting a running service) and removes itself with `--uninstall`, leaving
|
||||||
|
settings and data alone. The app finds its translations and the tray beside its own program, so
|
||||||
|
nothing has to be on the `PATH`. [Installation](INSTALL.md) also shows how to layer the COPR
|
||||||
|
package on Fedora Atomic (Silverblue, Kinoite, Bazzite, Bluefin).
|
||||||
- **Sync a local folder with a folder you already have in My files** (#67, #77).
|
- **Sync a local folder with a folder you already have in My files** (#67, #77).
|
||||||
`pdfs sync attach ~/Work --to Work` keeps `~/Work` an ordinary local folder and syncs it both
|
`pdfs sync attach ~/Work --to Work` keeps `~/Work` an ordinary local folder and syncs it both
|
||||||
ways with My files/Work. The first sync uploads files that are only on this computer, downloads
|
ways with My files/Work. The first sync uploads files that are only on this computer, downloads
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ commands are for scripts and for cases where the mount is not available.
|
|||||||
| `pdfs sync reset ID` | Forget what a synced folder synced before and compare it with Proton Drive again. A file on one side only is copied to the other, and a file that differs keeps both versions. Nothing is deleted. |
|
| `pdfs sync reset ID` | Forget what a synced folder synced before and compare it with Proton Drive again. A file on one side only is copied to the other, and a file that differs keeps both versions. Nothing is deleted. |
|
||||||
| `pdfs sync pause [--for 1h] [--folder ID]` | Pause uploads and synced folders. Reading files keeps working. `--for` ends the pause by itself (`30m`, `1h`, `2d`). |
|
| `pdfs sync pause [--for 1h] [--folder ID]` | Pause uploads and synced folders. Reading files keeps working. `--for` ends the pause by itself (`30m`, `1h`, `2d`). |
|
||||||
| `pdfs sync resume [--folder ID]` | Resume after a pause. |
|
| `pdfs sync resume [--folder ID]` | Resume after a pause. |
|
||||||
| `pdfs sync ignore list` | Print the patterns every synced folder leaves out. Built-in ones are marked. |
|
| `pdfs sync ignore list [--folder PATH]` | Print the patterns every synced folder leaves out; built-in ones are marked. With `--folder`, the own patterns of the synced folder holding `PATH`. |
|
||||||
| `pdfs sync ignore add PATTERN` / `remove PATTERN` | Leave out, or stop leaving out, files matching a gitignore-style pattern such as `*.db` or `build/`. A pattern starting with `-` goes after `--`. |
|
| `pdfs sync ignore add PATTERN [--folder PATH]` / `remove PATTERN [--folder PATH]` | Leave out, or stop leaving out, files matching a gitignore-style pattern such as `*.db` or `build/`, in every synced folder or, with `--folder`, in that folder's `.pdfsignore` only. A pattern starting with `-` goes after `--`. |
|
||||||
| `pdfs sync ignore reset` | Use the built-in patterns again. |
|
| `pdfs sync ignore reset` | Use the built-in patterns again. |
|
||||||
| `pdfs sync ignore check PATH` | Say whether a file in a synced folder is synced, and which pattern decides. |
|
| `pdfs sync ignore check PATH` | Say whether a file in a synced folder is synced, and which pattern decides. |
|
||||||
| `pdfs sync limit [--up RATE] [--down RATE]` | Cap bandwidth, for example `500K` or `2M` per second. `0` removes a cap. Without options, prints the current caps. |
|
| `pdfs sync limit [--up RATE] [--down RATE]` | Cap bandwidth, for example `500K` or `2M` per second. `0` removes a cap. Without options, prints the current caps. |
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ Gitignore-style rules applied to every synced folder, in addition to each folder
|
|||||||
".fuse_hidden*", ".nfs*", "*.part", "*.crdownload", "*.kate-swp", ".~lock.*#", "~$*"]
|
".fuse_hidden*", ".nfs*", "*.part", "*.crdownload", "*.kate-swp", ".~lock.*#", "~$*"]
|
||||||
```
|
```
|
||||||
|
|
||||||
Preferences → Sync → Excluded Files edits this list, and `pdfs sync ignore` does the same from
|
Preferences → Sync → Excluded Files edits this list, **Add Pattern** on the Sync page's Folders
|
||||||
a terminal. A list equal to the defaults is saved as absent, so it follows the defaults of later
|
view adds to it, and `pdfs sync ignore` does the same from a terminal. A list equal to the defaults is saved as absent, so it follows the defaults of later
|
||||||
releases. Set it to `[]` to turn the defaults off. See
|
releases. Set it to `[]` to turn the defaults off. See
|
||||||
[Synced folders](SYNCED_FOLDERS.md#excluding-files-with-pdfsignore) for how excluding behaves.
|
[Synced folders](SYNCED_FOLDERS.md#excluding-files-with-pdfsignore) for how excluding behaves.
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ again.
|
|||||||
| [Arch Linux](#arch-linux-aur) | `proton-drive-for-linux` in the AUR | With your AUR helper |
|
| [Arch Linux](#arch-linux-aur) | `proton-drive-for-linux` in the AUR | With your AUR helper |
|
||||||
| [Debian, Ubuntu 24.04 or newer](#debian-and-ubuntu-2404-or-newer) | `.deb` from the release page | Download each release |
|
| [Debian, Ubuntu 24.04 or newer](#debian-and-ubuntu-2404-or-newer) | `.deb` from the release page | Download each release |
|
||||||
| [NixOS](#nixos-flake) | The flake in this repository | With `nix flake update` |
|
| [NixOS](#nixos-flake) | The flake in this repository | With `nix flake update` |
|
||||||
| [Anything else](#other-distributions) | `.tar.gz` from the release page, or [build from source](#build-from-source) | By hand |
|
| [Fedora Atomic](#fedora-atomic-silverblue-kinoite-bazzite-bluefin) (Silverblue, Kinoite, Bazzite, Bluefin) | The COPR repository, layered with `rpm-ostree` | With `rpm-ostree upgrade` |
|
||||||
|
| [Anything else](#other-distributions), immutable ones included | `.tar.gz` from the release page, installed into your home folder by its `install.sh`, or [build from source](#build-from-source) | Run the new release's `install.sh` |
|
||||||
|
|
||||||
Release packages are for x86_64. You also need a Secret Service provider, such as GNOME
|
Release packages are for x86_64. You also need a Secret Service provider, such as GNOME
|
||||||
Keyring, KWallet or KeePassXC, to keep your session. Most desktops have one already.
|
Keyring, KWallet or KeePassXC, to keep your session. Most desktops have one already.
|
||||||
@@ -139,12 +140,42 @@ the module) and a Secret Service such as GNOME Keyring or KWallet. To leave out
|
|||||||
it video thumbnails, override the package with `withFfmpeg = false`. The recipe is in
|
it video thumbnails, override the package with `withFfmpeg = false`. The recipe is in
|
||||||
[`packaging/nix/`](../packaging/nix/).
|
[`packaging/nix/`](../packaging/nix/).
|
||||||
|
|
||||||
|
### Fedora Atomic (Silverblue, Kinoite, Bazzite, Bluefin)
|
||||||
|
|
||||||
|
The system is read-only, so layer the COPR package on top of it. It brings its libraries along:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo curl -o /etc/yum.repos.d/proton-drive-linux.repo \
|
||||||
|
"https://copr.fedorainfracloud.org/coprs/narl-rs/proton-drive-linux/repo/fedora-$(rpm -E %fedora)/narl-rs-proton-drive-linux-fedora-$(rpm -E %fedora).repo"
|
||||||
|
rpm-ostree install proton-drive-linux
|
||||||
|
systemctl reboot
|
||||||
|
```
|
||||||
|
|
||||||
|
`rpm-ostree upgrade` brings new releases with the system's own updates.
|
||||||
|
|
||||||
### Other distributions
|
### Other distributions
|
||||||
|
|
||||||
Unpack the `.tar.gz` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest)
|
The `.tar.gz` from the [latest release](https://github.com/narrrl/proton-drive-linux/releases/latest)
|
||||||
into a directory on your `PATH`, then install the service as shown in
|
installs into your home folder, without root, so it also works where the system is read-only:
|
||||||
[Using a binary outside `/usr/bin`](#using-a-binary-outside-usrbin). The binaries need GTK 4.12,
|
|
||||||
libadwaita 1.5, WebKitGTK 6.0 and FUSE 3; see [Requirements](#requirements).
|
```bash
|
||||||
|
tar -xzf proton-drive-linux-*-x86_64.tar.gz
|
||||||
|
proton-drive-linux-*-x86_64/install.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
It puts the programs in `~/.local/bin`, the menu entry, icon, translations and shell completion in
|
||||||
|
`~/.local/share`, the service in `~/.config/systemd/user` and the tray's login entry in
|
||||||
|
`~/.config/autostart`, each pointing at `~/.local/bin`. Then open **Proton Drive for Linux** from
|
||||||
|
your applications menu. `--prefix DIR` installs somewhere else.
|
||||||
|
|
||||||
|
The system has to provide glibc 2.39 or newer (the binaries are built on Ubuntu 24.04), GTK 4.12,
|
||||||
|
libadwaita 1.5, WebKitGTK 6.0 and FUSE 3 with a setuid `fusermount3`; see
|
||||||
|
[Requirements](#requirements). `install.sh` checks the libraries first and names the packages to
|
||||||
|
install for each distribution. It refuses to install next to a package of this client, since the
|
||||||
|
two would run different versions of the service.
|
||||||
|
|
||||||
|
To update, download the new release and run its `install.sh`; a running service restarts on the new
|
||||||
|
version. Turn on **Preferences → General → Check for updates** to hear about new releases.
|
||||||
|
|
||||||
## Optional extras
|
## Optional extras
|
||||||
|
|
||||||
@@ -195,7 +226,9 @@ browser, solve it, then press Enter.
|
|||||||
| COPR (Fedora) | `sudo dnf upgrade` |
|
| COPR (Fedora) | `sudo dnf upgrade` |
|
||||||
| AUR | `paru -Syu`, or your AUR helper's equivalent |
|
| AUR | `paru -Syu`, or your AUR helper's equivalent |
|
||||||
| Nix flake | `nix flake update proton-drive-linux`, or change the pinned tag, then rebuild |
|
| Nix flake | `nix flake update proton-drive-linux`, or change the pinned tag, then rebuild |
|
||||||
| `.deb`, release `.rpm`, `.tar.gz` | Download the new release and install it over the old one |
|
| Fedora Atomic | `rpm-ostree upgrade`, then reboot |
|
||||||
|
| `.deb`, release `.rpm` | Download the new release and install it over the old one |
|
||||||
|
| `.tar.gz` | Download the new release and run its `install.sh` |
|
||||||
|
|
||||||
The service switches to the new version the next time it starts. To switch at once:
|
The service switches to the new version the next time it starts. To switch at once:
|
||||||
|
|
||||||
@@ -245,6 +278,8 @@ open in an older release, so going back to an older version means clearing the l
|
|||||||
| `.deb` | `sudo apt remove proton-drive-linux` |
|
| `.deb` | `sudo apt remove proton-drive-linux` |
|
||||||
| AUR | `sudo pacman -R proton-drive-for-linux` (or the `-bin` or `-git` package) |
|
| AUR | `sudo pacman -R proton-drive-for-linux` (or the `-bin` or `-git` package) |
|
||||||
| NixOS | Remove the module and the flake input, then rebuild |
|
| NixOS | Remove the module and the flake input, then rebuild |
|
||||||
|
| Fedora Atomic | `rpm-ostree uninstall proton-drive-linux`, remove `/etc/yum.repos.d/proton-drive-linux.repo`, then reboot |
|
||||||
|
| `.tar.gz` | `~/.local/share/proton-drive-linux/install.sh --uninstall` |
|
||||||
|
|
||||||
Removing the package also stops the service of every logged-in user, in case step 1 was
|
Removing the package also stops the service of every logged-in user, in case step 1 was
|
||||||
skipped.
|
skipped.
|
||||||
@@ -353,8 +388,10 @@ sudo dnf install packaging/out/x86_64/proton-drive-linux-*.rpm
|
|||||||
|
|
||||||
### Using a binary outside `/usr/bin`
|
### Using a binary outside `/usr/bin`
|
||||||
|
|
||||||
The service unit starts `/usr/bin/pdfs daemon`. If you installed the programs somewhere else, for
|
The release tarball's `install.sh` does all of this for you (see
|
||||||
example `~/.local/bin`, install the unit for your user and point it at your binary:
|
[Other distributions](#other-distributions)). For programs you built yourself: the service unit
|
||||||
|
starts `/usr/bin/pdfs daemon`. If you installed the programs somewhere else, for example
|
||||||
|
`~/.local/bin`, install the unit for your user and point it at your binary:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/.config/systemd/user
|
mkdir -p ~/.config/systemd/user
|
||||||
@@ -382,3 +419,7 @@ Every package installs the same files:
|
|||||||
| `/usr/lib/systemd/user/proton-drive.service` | User service that keeps the drive mounted |
|
| `/usr/lib/systemd/user/proton-drive.service` | User service that keeps the drive mounted |
|
||||||
| `/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop` | Starts the tray at login |
|
| `/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop` | Starts the tray at login |
|
||||||
| `/usr/share/locale/*/LC_MESSAGES/pdfs.mo` | Translations |
|
| `/usr/share/locale/*/LC_MESSAGES/pdfs.mo` | Translations |
|
||||||
|
|
||||||
|
The release tarball's `install.sh` puts the same files under `~/.local` instead of `/usr`, the
|
||||||
|
service in `~/.config/systemd/user` and the tray's login entry in `~/.config/autostart`. It keeps a
|
||||||
|
list of them in `~/.local/share/proton-drive-linux/installed-files` for `--uninstall`.
|
||||||
@@ -108,10 +108,15 @@ apply together:
|
|||||||
lock files, `.DS_Store`, `Thumbs.db`, `desktop.ini`, `.directory`, trash folders, `.nfs*` and
|
lock files, `.DS_Store`, `Thumbs.db`, `desktop.ini`, `.directory`, trash folders, `.nfs*` and
|
||||||
`.fuse_hidden*`). Each built-in pattern can be turned off on its own.
|
`.fuse_hidden*`). Each built-in pattern can be turned off on its own.
|
||||||
|
|
||||||
To edit a folder's own rules in the app, open the **Sync** page, then **Folders**, and pick
|
In the app, open the **Sync** page, then **Folders**. Under the folder list, **Excluded Files**
|
||||||
**Excluded Files…** in the folder's menu. It checks every line as you type, and **Check a path**
|
shows how many patterns apply to all synced folders and how many each folder has of its own:
|
||||||
tells you whether a file is synced and which pattern decides. If the file changed meanwhile, for
|
|
||||||
example on another computer, it asks before replacing that version.
|
- **Add Pattern** asks for a pattern and where it applies: all synced folders, or one of them.
|
||||||
|
- **All Synced Folders** opens Preferences → Sync, with every pattern and the built-in ones.
|
||||||
|
- A folder opens the editor for its own rules, which **Excluded Files…** in the folder's menu
|
||||||
|
opens too. It checks every line as you type, and **Check a path** tells you whether a file is
|
||||||
|
synced and which pattern decides. If the file changed meanwhile, for example on another
|
||||||
|
computer, it asks before replacing that version.
|
||||||
|
|
||||||
From a terminal:
|
From a terminal:
|
||||||
|
|
||||||
@@ -120,6 +125,8 @@ pdfs sync ignore list # the patterns for every synced folder
|
|||||||
pdfs sync ignore add '*.db' # leave out files ending in .db
|
pdfs sync ignore add '*.db' # leave out files ending in .db
|
||||||
pdfs sync ignore remove '*.db'
|
pdfs sync ignore remove '*.db'
|
||||||
pdfs sync ignore reset # back to the built-in patterns
|
pdfs sync ignore reset # back to the built-in patterns
|
||||||
|
pdfs sync ignore add 'cache/' --folder ~/Projects # only in ~/Projects/.pdfsignore
|
||||||
|
pdfs sync ignore list --folder ~/Projects
|
||||||
pdfs sync ignore check ~/Projects/app/node_modules
|
pdfs sync ignore check ~/Projects/app/node_modules
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# Violet / Copper vector branding
|
||||||
|
|
||||||
|
Drive, Stream, and Gallery share frontal violet–pink faces, shallow metallic copper backing, and narrow edge highlights. The icons are editable vector artwork with no embedded images or raster effects.
|
||||||
|
|
||||||
|
| App | Mark |
|
||||||
|
| --- | --- |
|
||||||
|
| Proton Drive for Linux | Open folder with lilac documents |
|
||||||
|
| Proton Stream | Rounded play prism |
|
||||||
|
| Proton Gallery | Stacked photo plates, mountains, and a copper sun |
|
||||||
|
|
||||||
|
## Master artwork
|
||||||
|
|
||||||
|
Edit `images/logo.svg`. It uses a 256-unit grid with transparent margins, a `mark` group, and reusable linear gradients. The copper backing extends six units up and right. SVG paths, rounded rectangles, circles, strokes, translation, and the photo clip are retained when exporting Android VectorDrawables. Unsupported SVG features cause generation to fail rather than silently change the artwork.
|
||||||
|
|
||||||
|
Earlier artwork is preserved in `images/branding-archive/`. The new assets replace the active branding without removing previous designs.
|
||||||
|
|
||||||
|
## Regeneration
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python scripts/render-branding.py
|
||||||
|
python scripts/render-branding.py --check
|
||||||
|
```
|
||||||
|
|
||||||
|
Requires Python 3, librsvg (`rsvg-convert`), and ImageMagick (`magick`). Stream's TV banner also requires fontconfig and DejaVu Sans. Keep the generator identical across the three repositories; every checkout renders independently and requires no sibling checkout. Edit the canonical master rather than generated platform assets.
|
||||||
|
|
||||||
|
## Platform treatment
|
||||||
|
|
||||||
|
- Desktop SVGs and PNGs retain transparent margins and the exact approved geometry. The same colored artwork works on light and dark surfaces.
|
||||||
|
- Android adaptive icons use a pale lavender full-bleed background and a separate foreground containing the complete object. The 256-unit canvas maps to the central 64dp of the 108dp adaptive canvas; the painted geometry stays within the central safe circle. Android supplies the outer mask.
|
||||||
|
- Themed launcher icons and Stream's status-bar notification icon use a white silhouette without colored bevel highlights.
|
||||||
|
- iOS uses the same play prism over an opaque pale lavender square, exported at 1024px. The system supplies the corner mask.
|
||||||
|
- The Android TV banner pairs the play prism with the full Proton Stream name.
|
||||||
|
|
||||||
|
Keep full product names in launcher metadata. Application UI typography and photo-content icons are independent of this branding.
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
`packaging/io.narl.proton-drive-linux.svg` is installed by the desktop packages and embedded in the GTK resource bundle for in-app branding.
|
||||||
|
|
||||||
|
The Drive cover (`images/cover.svg` and `images/cover.png`) also embeds the canonical icon. The generator updates its `app-logo` group while preserving the surrounding cover layout.
|
||||||
|
After Width: | Height: | Size: 363 KiB |
@@ -0,0 +1,156 @@
|
|||||||
|
<svg width="1920" height="1080" viewBox="0 0 1920 1080" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bg" x1="0" y1="0" x2="1920" y2="1080" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#1A1240"/>
|
||||||
|
<stop offset="1" stop-color="#0A0618"/>
|
||||||
|
</linearGradient>
|
||||||
|
<radialGradient id="glow1" cx="1390" cy="520" r="640" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#6D4AFF" stop-opacity="0.55"/>
|
||||||
|
<stop offset="0.5" stop-color="#6D4AFF" stop-opacity="0.15"/>
|
||||||
|
<stop offset="1" stop-color="#6D4AFF" stop-opacity="0"/>
|
||||||
|
</radialGradient>
|
||||||
|
<radialGradient id="glow2" cx="160" cy="1080" r="700" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#A855F7" stop-opacity="0.25"/>
|
||||||
|
<stop offset="1" stop-color="#A855F7" stop-opacity="0"/>
|
||||||
|
</radialGradient>
|
||||||
|
<pattern id="dots" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||||
|
<circle cx="2" cy="2" r="1.6" fill="#FFFFFF"/>
|
||||||
|
</pattern>
|
||||||
|
<radialGradient id="dotfade" cx="1390" cy="520" r="900" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#FFFFFF" stop-opacity="1"/>
|
||||||
|
<stop offset="1" stop-color="#FFFFFF" stop-opacity="0"/>
|
||||||
|
</radialGradient>
|
||||||
|
<mask id="dotmask" maskUnits="userSpaceOnUse" x="0" y="0" width="1920" height="1080">
|
||||||
|
<rect width="1920" height="1080" fill="url(#dotfade)"/>
|
||||||
|
</mask>
|
||||||
|
<linearGradient id="title2" x1="140" y1="0" x2="760" y2="0" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#C9BBFF"/>
|
||||||
|
<stop offset="1" stop-color="#8A6CFF"/>
|
||||||
|
</linearGradient>
|
||||||
|
|
||||||
|
<!-- app logo -->
|
||||||
|
<linearGradient id="pdl-face" x1="12" y1="12" x2="116" y2="112" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#A48BFF"/>
|
||||||
|
<stop offset="0.55" stop-color="#7552FF"/>
|
||||||
|
<stop offset="1" stop-color="#5B36F2"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="pdl-cloud" x1="0" y1="34" x2="0" y2="88" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop offset="0" stop-color="#FFFFFF"/>
|
||||||
|
<stop offset="1" stop-color="#ECE6FF"/>
|
||||||
|
</linearGradient>
|
||||||
|
<mask id="pdl-cut" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128">
|
||||||
|
<g fill="#FFFFFF">
|
||||||
|
<circle cx="66" cy="57" r="23"/>
|
||||||
|
<circle cx="42" cy="68" r="16"/>
|
||||||
|
<circle cx="88" cy="69" r="15"/>
|
||||||
|
<rect x="26" y="68" width="77" height="20" rx="10"/>
|
||||||
|
</g>
|
||||||
|
<g stroke="#000000" stroke-width="7.5" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
||||||
|
<path d="M64 49v26"/>
|
||||||
|
<path d="M54.5 65.5l9.5 9.5 9.5-9.5"/>
|
||||||
|
</g>
|
||||||
|
</mask>
|
||||||
|
<filter id="logoshadow" x="-50%" y="-50%" width="200%" height="200%">
|
||||||
|
<feGaussianBlur stdDeviation="6"/>
|
||||||
|
</filter>
|
||||||
|
<filter id="chipshadow" x="-50%" y="-50%" width="200%" height="200%">
|
||||||
|
<feGaussianBlur stdDeviation="14"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
|
||||||
|
<!-- background -->
|
||||||
|
<rect width="1920" height="1080" fill="url(#bg)"/>
|
||||||
|
<rect width="1920" height="1080" fill="url(#glow2)"/>
|
||||||
|
<rect width="1920" height="1080" fill="url(#glow1)"/>
|
||||||
|
<rect width="1920" height="1080" fill="url(#dots)" opacity="0.07" mask="url(#dotmask)"/>
|
||||||
|
|
||||||
|
<!-- orbit rings -->
|
||||||
|
<g fill="none" stroke="#FFFFFF">
|
||||||
|
<circle cx="1390" cy="520" r="300" stroke-opacity="0.10" stroke-width="2"/>
|
||||||
|
<circle cx="1390" cy="520" r="420" stroke-opacity="0.06" stroke-width="2" stroke-dasharray="4 14" stroke-linecap="round"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- logo, 128 -> 384 -->
|
||||||
|
<g transform="translate(1198 328) scale(3)">
|
||||||
|
<rect x="16" y="24" width="96" height="92" rx="24" fill="#2A1080" opacity="0.8" filter="url(#logoshadow)"/>
|
||||||
|
<rect x="12" y="16" width="104" height="100" rx="26" fill="#4424C0"/>
|
||||||
|
<rect x="12" y="12" width="104" height="100" rx="26" fill="url(#pdl-face)"/>
|
||||||
|
<rect x="12.5" y="12.5" width="103" height="99" rx="25.5" fill="none" stroke="#FFFFFF" stroke-opacity="0.2"/>
|
||||||
|
<rect y="3" width="128" height="128" fill="#2E1596" fill-opacity="0.3" mask="url(#pdl-cut)"/>
|
||||||
|
<rect width="128" height="128" fill="url(#pdl-cloud)" mask="url(#pdl-cut)"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- feature chips around the logo -->
|
||||||
|
<g font-family="Adwaita Sans" font-size="26" font-weight="600" fill="#FFFFFF">
|
||||||
|
<!-- folder, top left -->
|
||||||
|
<g transform="translate(1000 200)">
|
||||||
|
<rect x="0" y="10" width="236" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
||||||
|
<rect x="0" y="0" width="236" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#6D4AFF"/>
|
||||||
|
<path d="M8 13a2 2 0 0 1 2-2h5l2.5 2.5H26a2 2 0 0 1 2 2V25a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2z" fill="#FFFFFF"/>
|
||||||
|
</g>
|
||||||
|
<text x="74" y="47">On demand</text>
|
||||||
|
</g>
|
||||||
|
<!-- sync, top right -->
|
||||||
|
<g transform="translate(1590 290)">
|
||||||
|
<rect x="0" y="10" width="164" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
||||||
|
<rect x="0" y="0" width="164" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#1EA885"/>
|
||||||
|
<g fill="none" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M26 15a8.5 8.5 0 0 0-15-2"/>
|
||||||
|
<path d="M10 9v4.5h4.5"/>
|
||||||
|
<path d="M10 21a8.5 8.5 0 0 0 15 2"/>
|
||||||
|
<path d="M26 27v-4.5h-4.5"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<text x="74" y="47">Sync</text>
|
||||||
|
</g>
|
||||||
|
<!-- photos, bottom right -->
|
||||||
|
<g transform="translate(1560 690)">
|
||||||
|
<rect x="0" y="10" width="206" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
||||||
|
<rect x="0" y="0" width="206" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#E8618C"/>
|
||||||
|
<rect x="8" y="9" width="20" height="18" rx="3" fill="none" stroke="#FFFFFF" stroke-width="2.4"/>
|
||||||
|
<circle cx="14" cy="15" r="2" fill="#FFFFFF"/>
|
||||||
|
<path d="M9.5 25l6-6 4 4 3-3 4 4" fill="none" stroke="#FFFFFF" stroke-width="2.4" stroke-linejoin="round"/>
|
||||||
|
</g>
|
||||||
|
<text x="74" y="47">Photos</text>
|
||||||
|
</g>
|
||||||
|
<!-- terminal, bottom left -->
|
||||||
|
<g transform="translate(980 790)">
|
||||||
|
<rect x="0" y="10" width="206" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
||||||
|
<rect x="0" y="0" width="206" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#3B3F5C"/>
|
||||||
|
<path d="M9 12l6 6-6 6" fill="none" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
<path d="M18 25h9" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round"/>
|
||||||
|
</g>
|
||||||
|
<text x="74" y="48" font-family="JetBrainsMono NF" font-size="25" font-weight="700">pdfs</text>
|
||||||
|
<text x="150" y="48" font-weight="500" fill="#B9B0D9">CLI</text>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- text block -->
|
||||||
|
<g font-family="Adwaita Sans">
|
||||||
|
<g transform="translate(140 292)">
|
||||||
|
<rect width="410" height="48" rx="24" fill="#6D4AFF" fill-opacity="0.18" stroke="#8A6CFF" stroke-opacity="0.6" stroke-width="1.5"/>
|
||||||
|
<circle cx="28" cy="24" r="6" fill="#A48BFF"/>
|
||||||
|
<text x="46" y="32" font-size="21" font-weight="700" letter-spacing="2.4" fill="#D6CCFF">UNOFFICIAL · OPEN SOURCE</text>
|
||||||
|
</g>
|
||||||
|
<text x="134" y="478" font-size="124" font-weight="800" letter-spacing="-3" fill="#FFFFFF">Proton Drive</text>
|
||||||
|
<text x="134" y="610" font-size="124" font-weight="800" letter-spacing="-3" fill="url(#title2)">for Linux</text>
|
||||||
|
<text x="140" y="702" font-size="38" font-weight="400" fill="#B9B0D9">Your Drive as a folder, and a native GTK4 app.</text>
|
||||||
|
<text x="140" y="752" font-size="38" font-weight="400" fill="#B9B0D9">No Electron.</text>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
<!-- footer -->
|
||||||
|
<g font-family="JetBrainsMono NF" font-size="24" fill="#8C83B0">
|
||||||
|
<text x="140" y="968">github.com/narrrl/proton-drive-linux</text>
|
||||||
|
</g>
|
||||||
|
<g font-family="Adwaita Sans" font-size="22" fill="#6F6894">
|
||||||
|
<text x="1780" y="968" text-anchor="end">Not affiliated with Proton AG</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 8.3 KiB |
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"
|
||||||
|
role="img" aria-label="Proton Drive for Linux" data-app="drive">
|
||||||
|
<title>Proton Drive for Linux</title>
|
||||||
|
<desc>A custom faceted D with an inset mount channel, in violet warming to copper.</desc>
|
||||||
|
<!-- Canonical artwork. Regenerate platform assets with scripts/render-branding.py. -->
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="face" x1="18" y1="12" x2="112" y2="116" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#F6F2FC"/>
|
||||||
|
<stop offset="1" stop-color="#E5DDEE"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="material" x1="31" y1="35" x2="96" y2="95" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#9170E2"/>
|
||||||
|
<stop offset=".38" stop-color="#6D4AFF"/>
|
||||||
|
<stop offset=".6" stop-color="#7044D1"/>
|
||||||
|
<stop offset=".82" stop-color="#A66598"/>
|
||||||
|
<stop offset="1" stop-color="#B56D51"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect x="12" y="12" width="104" height="104" rx="27" fill="url(#face)"/>
|
||||||
|
<rect x="12.75" y="12.75" width="102.5" height="102.5" rx="26.25"
|
||||||
|
fill="none" stroke="#A18CB7" stroke-width="1.5"/>
|
||||||
|
<g id="mark">
|
||||||
|
<path d="M 43.32 33.92 H 64.94 C 73.4 33.92 80.92 36.74 86.56 42.38 L 96.9 52.72 C 103.48 59.3 103.48 68.7 96.9 75.28 L 86.56 85.62 C 80.92 91.26 73.4 94.08 64.94 94.08 H 43.32 C 38.15 94.08 33.92 89.85 33.92 84.68 V 75.28 H 47.08 V 79.04 C 47.08 80.074 47.926 80.92 48.96 80.92 H 64.94 C 69.64 80.92 73.4 79.04 77.16 75.28 L 85.62 66.82 C 87.218 65.222 87.218 62.778 85.62 61.18 L 77.16 52.72 C 73.4 48.96 69.64 47.08 64.94 47.08 H 48.96 C 47.926 47.08 47.08 47.926 47.08 48.96 V 52.72 H 33.92 V 43.32 C 33.92 38.15 38.15 33.92 43.32 33.92 Z" fill="url(#material)" fill-rule="nonzero"/>
|
||||||
|
<path d="M 29.22 58.36 H 62.12 C 65.222 58.36 67.76 60.898 67.76 64 C 67.76 67.102 65.222 69.64 62.12 69.64 H 29.22 C 26.118 69.64 23.58 67.102 23.58 64 C 23.58 60.898 26.118 58.36 29.22 58.36 Z" fill="url(#material)" fill-rule="nonzero"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 363 KiB After Width: | Height: | Size: 407 KiB |
@@ -1,156 +1,164 @@
|
|||||||
<svg width="1920" height="1080" viewBox="0 0 1920 1080" xmlns="http://www.w3.org/2000/svg">
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<defs>
|
<!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->
|
||||||
<linearGradient id="bg" x1="0" y1="0" x2="1920" y2="1080" gradientUnits="userSpaceOnUse">
|
<svg xmlns="http://www.w3.org/2000/svg" width="1920" height="1080" viewBox="0 0 1920 1080">
|
||||||
<stop offset="0" stop-color="#1A1240"/>
|
<defs>
|
||||||
<stop offset="1" stop-color="#0A0618"/>
|
<linearGradient id="bg" x1="0" y1="0" x2="1920" y2="1080" gradientUnits="userSpaceOnUse">
|
||||||
</linearGradient>
|
<stop offset="0" stop-color="#1A1240" />
|
||||||
<radialGradient id="glow1" cx="1390" cy="520" r="640" gradientUnits="userSpaceOnUse">
|
<stop offset="1" stop-color="#0A0618" />
|
||||||
<stop offset="0" stop-color="#6D4AFF" stop-opacity="0.55"/>
|
</linearGradient>
|
||||||
<stop offset="0.5" stop-color="#6D4AFF" stop-opacity="0.15"/>
|
<radialGradient id="glow1" cx="1390" cy="520" r="640" gradientUnits="userSpaceOnUse">
|
||||||
<stop offset="1" stop-color="#6D4AFF" stop-opacity="0"/>
|
<stop offset="0" stop-color="#6D4AFF" stop-opacity="0.55" />
|
||||||
</radialGradient>
|
<stop offset="0.5" stop-color="#6D4AFF" stop-opacity="0.15" />
|
||||||
<radialGradient id="glow2" cx="160" cy="1080" r="700" gradientUnits="userSpaceOnUse">
|
<stop offset="1" stop-color="#6D4AFF" stop-opacity="0" />
|
||||||
<stop offset="0" stop-color="#A855F7" stop-opacity="0.25"/>
|
</radialGradient>
|
||||||
<stop offset="1" stop-color="#A855F7" stop-opacity="0"/>
|
<radialGradient id="glow2" cx="160" cy="1080" r="700" gradientUnits="userSpaceOnUse">
|
||||||
</radialGradient>
|
<stop offset="0" stop-color="#A855F7" stop-opacity="0.25" />
|
||||||
<pattern id="dots" width="32" height="32" patternUnits="userSpaceOnUse">
|
<stop offset="1" stop-color="#A855F7" stop-opacity="0" />
|
||||||
<circle cx="2" cy="2" r="1.6" fill="#FFFFFF"/>
|
</radialGradient>
|
||||||
</pattern>
|
<pattern id="dots" width="32" height="32" patternUnits="userSpaceOnUse">
|
||||||
<radialGradient id="dotfade" cx="1390" cy="520" r="900" gradientUnits="userSpaceOnUse">
|
<circle cx="2" cy="2" r="1.6" fill="#FFFFFF" />
|
||||||
<stop offset="0" stop-color="#FFFFFF" stop-opacity="1"/>
|
</pattern>
|
||||||
<stop offset="1" stop-color="#FFFFFF" stop-opacity="0"/>
|
<radialGradient id="dotfade" cx="1390" cy="520" r="900" gradientUnits="userSpaceOnUse">
|
||||||
</radialGradient>
|
<stop offset="0" stop-color="#FFFFFF" stop-opacity="1" />
|
||||||
<mask id="dotmask" maskUnits="userSpaceOnUse" x="0" y="0" width="1920" height="1080">
|
<stop offset="1" stop-color="#FFFFFF" stop-opacity="0" />
|
||||||
<rect width="1920" height="1080" fill="url(#dotfade)"/>
|
</radialGradient>
|
||||||
</mask>
|
<mask id="dotmask" maskUnits="userSpaceOnUse" x="0" y="0" width="1920" height="1080">
|
||||||
<linearGradient id="title2" x1="140" y1="0" x2="760" y2="0" gradientUnits="userSpaceOnUse">
|
<rect width="1920" height="1080" fill="url(#dotfade)" />
|
||||||
<stop offset="0" stop-color="#C9BBFF"/>
|
</mask>
|
||||||
<stop offset="1" stop-color="#8A6CFF"/>
|
<linearGradient id="title2" x1="140" y1="0" x2="760" y2="0" gradientUnits="userSpaceOnUse">
|
||||||
</linearGradient>
|
<stop offset="0" stop-color="#C9BBFF" />
|
||||||
|
<stop offset="1" stop-color="#8A6CFF" />
|
||||||
<!-- app logo -->
|
</linearGradient>
|
||||||
<linearGradient id="pdl-face" x1="12" y1="12" x2="116" y2="112" gradientUnits="userSpaceOnUse">
|
<filter id="chipshadow" x="-50%" y="-50%" width="200%" height="200%">
|
||||||
<stop offset="0" stop-color="#A48BFF"/>
|
<feGaussianBlur stdDeviation="14" />
|
||||||
<stop offset="0.55" stop-color="#7552FF"/>
|
</filter>
|
||||||
<stop offset="1" stop-color="#5B36F2"/>
|
</defs>
|
||||||
</linearGradient>
|
<rect width="1920" height="1080" fill="url(#bg)" />
|
||||||
<linearGradient id="pdl-cloud" x1="0" y1="34" x2="0" y2="88" gradientUnits="userSpaceOnUse">
|
<rect width="1920" height="1080" fill="url(#glow2)" />
|
||||||
<stop offset="0" stop-color="#FFFFFF"/>
|
<rect width="1920" height="1080" fill="url(#glow1)" />
|
||||||
<stop offset="1" stop-color="#ECE6FF"/>
|
<rect width="1920" height="1080" fill="url(#dots)" opacity="0.07" mask="url(#dotmask)" />
|
||||||
</linearGradient>
|
<g fill="none" stroke="#FFFFFF">
|
||||||
<mask id="pdl-cut" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128">
|
<circle cx="1390" cy="520" r="300" stroke-opacity="0.10" stroke-width="2" />
|
||||||
<g fill="#FFFFFF">
|
<circle cx="1390" cy="520" r="420" stroke-opacity="0.06" stroke-width="2" stroke-dasharray="4 14" stroke-linecap="round" />
|
||||||
<circle cx="66" cy="57" r="23"/>
|
|
||||||
<circle cx="42" cy="68" r="16"/>
|
|
||||||
<circle cx="88" cy="69" r="15"/>
|
|
||||||
<rect x="26" y="68" width="77" height="20" rx="10"/>
|
|
||||||
</g>
|
|
||||||
<g stroke="#000000" stroke-width="7.5" stroke-linecap="round" stroke-linejoin="round" fill="none">
|
|
||||||
<path d="M64 49v26"/>
|
|
||||||
<path d="M54.5 65.5l9.5 9.5 9.5-9.5"/>
|
|
||||||
</g>
|
|
||||||
</mask>
|
|
||||||
<filter id="logoshadow" x="-50%" y="-50%" width="200%" height="200%">
|
|
||||||
<feGaussianBlur stdDeviation="6"/>
|
|
||||||
</filter>
|
|
||||||
<filter id="chipshadow" x="-50%" y="-50%" width="200%" height="200%">
|
|
||||||
<feGaussianBlur stdDeviation="14"/>
|
|
||||||
</filter>
|
|
||||||
</defs>
|
|
||||||
|
|
||||||
<!-- background -->
|
|
||||||
<rect width="1920" height="1080" fill="url(#bg)"/>
|
|
||||||
<rect width="1920" height="1080" fill="url(#glow2)"/>
|
|
||||||
<rect width="1920" height="1080" fill="url(#glow1)"/>
|
|
||||||
<rect width="1920" height="1080" fill="url(#dots)" opacity="0.07" mask="url(#dotmask)"/>
|
|
||||||
|
|
||||||
<!-- orbit rings -->
|
|
||||||
<g fill="none" stroke="#FFFFFF">
|
|
||||||
<circle cx="1390" cy="520" r="300" stroke-opacity="0.10" stroke-width="2"/>
|
|
||||||
<circle cx="1390" cy="520" r="420" stroke-opacity="0.06" stroke-width="2" stroke-dasharray="4 14" stroke-linecap="round"/>
|
|
||||||
</g>
|
|
||||||
|
|
||||||
<!-- logo, 128 -> 384 -->
|
|
||||||
<g transform="translate(1198 328) scale(3)">
|
|
||||||
<rect x="16" y="24" width="96" height="92" rx="24" fill="#2A1080" opacity="0.8" filter="url(#logoshadow)"/>
|
|
||||||
<rect x="12" y="16" width="104" height="100" rx="26" fill="#4424C0"/>
|
|
||||||
<rect x="12" y="12" width="104" height="100" rx="26" fill="url(#pdl-face)"/>
|
|
||||||
<rect x="12.5" y="12.5" width="103" height="99" rx="25.5" fill="none" stroke="#FFFFFF" stroke-opacity="0.2"/>
|
|
||||||
<rect y="3" width="128" height="128" fill="#2E1596" fill-opacity="0.3" mask="url(#pdl-cut)"/>
|
|
||||||
<rect width="128" height="128" fill="url(#pdl-cloud)" mask="url(#pdl-cut)"/>
|
|
||||||
</g>
|
|
||||||
|
|
||||||
<!-- feature chips around the logo -->
|
|
||||||
<g font-family="Adwaita Sans" font-size="26" font-weight="600" fill="#FFFFFF">
|
|
||||||
<!-- folder, top left -->
|
|
||||||
<g transform="translate(1000 200)">
|
|
||||||
<rect x="0" y="10" width="236" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
|
||||||
<rect x="0" y="0" width="236" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
|
||||||
<g transform="translate(22 20)">
|
|
||||||
<rect width="36" height="36" rx="10" fill="#6D4AFF"/>
|
|
||||||
<path d="M8 13a2 2 0 0 1 2-2h5l2.5 2.5H26a2 2 0 0 1 2 2V25a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2z" fill="#FFFFFF"/>
|
|
||||||
</g>
|
|
||||||
<text x="74" y="47">On demand</text>
|
|
||||||
</g>
|
</g>
|
||||||
<!-- sync, top right -->
|
<g id="app-logo" transform="translate(1198 328) scale(1.5)">
|
||||||
<g transform="translate(1590 290)">
|
<defs>
|
||||||
<rect x="0" y="10" width="164" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
<linearGradient id="drive-face" x1="36" y1="212" x2="220" y2="54" gradientUnits="userSpaceOnUse">
|
||||||
<rect x="0" y="0" width="164" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
<stop stop-color="#6240DA" />
|
||||||
<g transform="translate(22 20)">
|
<stop offset=".52" stop-color="#8056EF" />
|
||||||
<rect width="36" height="36" rx="10" fill="#1EA885"/>
|
<stop offset="1" stop-color="#D58BDF" />
|
||||||
<g fill="none" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round">
|
</linearGradient>
|
||||||
<path d="M26 15a8.5 8.5 0 0 0-15-2"/>
|
<linearGradient id="drive-rear" x1="26" y1="42" x2="218" y2="220" gradientUnits="userSpaceOnUse">
|
||||||
<path d="M10 9v4.5h4.5"/>
|
<stop stop-color="#8C68EE" />
|
||||||
<path d="M10 21a8.5 8.5 0 0 0 15 2"/>
|
<stop offset="1" stop-color="#5533B5" />
|
||||||
<path d="M26 27v-4.5h-4.5"/>
|
</linearGradient>
|
||||||
|
<linearGradient id="drive-paper" x1="60" y1="80" x2="180" y2="162" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#E7DFFA" />
|
||||||
|
<stop offset="1" stop-color="#BDA5EF" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="drive-copper" x1="32" y1="32" x2="232" y2="224" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#703E30" />
|
||||||
|
<stop offset=".16" stop-color="#B47456" />
|
||||||
|
<stop offset=".28" stop-color="#E6B296" />
|
||||||
|
<stop offset=".32" stop-color="#F8D8C3" />
|
||||||
|
<stop offset=".37" stop-color="#BB7C5A" />
|
||||||
|
<stop offset=".56" stop-color="#8A4D36" />
|
||||||
|
<stop offset=".69" stop-color="#D69B77" />
|
||||||
|
<stop offset=".75" stop-color="#F2C9AA" />
|
||||||
|
<stop offset=".81" stop-color="#B87956" />
|
||||||
|
<stop offset="1" stop-color="#713F30" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="drive-sun" x1="172" y1="82" x2="201" y2="112" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#8D513A" />
|
||||||
|
<stop offset=".33" stop-color="#DDA581" />
|
||||||
|
<stop offset=".47" stop-color="#F7D8B8" />
|
||||||
|
<stop offset=".53" stop-color="#D69B74" />
|
||||||
|
<stop offset="1" stop-color="#925439" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="drive-mountain" x1="44" y1="148" x2="186" y2="218" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#D9C9FA" />
|
||||||
|
<stop offset="1" stop-color="#A582E9" />
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient id="drive-far-mountain" x1="142" y1="152" x2="211" y2="216" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#E8B4EB" />
|
||||||
|
<stop offset="1" stop-color="#BB7BD7" />
|
||||||
|
</linearGradient>
|
||||||
|
<clipPath id="drive-photo-clip">
|
||||||
|
<rect x="28" y="54" width="194" height="172" rx="24" />
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
<g id="mark">
|
||||||
|
<path d="M48 48H91Q99 48 105 54L117 66Q123 72 132 72H208Q228 72 228 92V200Q228 220 208 220H48Q28 220 28 200V68Q28 48 48 48Z" fill="url(#drive-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round" />
|
||||||
|
<path d="M48 48H91Q99 48 105 54L117 66Q123 72 132 72H208Q228 72 228 92V200Q228 220 208 220H48Q28 220 28 200V68Q28 48 48 48Z" fill="url(#drive-rear)" stroke="#5E3CBD" stroke-width=".8" />
|
||||||
|
<rect x="72" y="82" width="132" height="112" rx="10" fill="url(#drive-paper)" stroke="#EFE9FC" stroke-width="1" />
|
||||||
|
<rect x="51" y="97" width="140" height="109" rx="10" fill="url(#drive-paper)" stroke="#EFE9FC" stroke-width="1" />
|
||||||
|
<path d="M48 94H89Q97 94 103 100L115 112Q121 118 130 118H208Q228 118 228 138V206Q228 226 208 226H48Q28 226 28 206V114Q28 94 48 94Z" fill="url(#drive-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round" />
|
||||||
|
<path d="M48 94H89Q97 94 103 100L115 112Q121 118 130 118H208Q228 118 228 138V206Q228 226 208 226H48Q28 226 28 206V114Q28 94 48 94Z" fill="url(#drive-face)" stroke="#5936B7" stroke-width=".9" />
|
||||||
|
<path d="M32 113Q32 98 48 98H89Q95 98 100 103L112 115Q120 122 130 122H208Q224 122 224 138" fill="none" stroke="#F3DDF9" stroke-opacity=".52" stroke-width="1.5" stroke-linecap="round" />
|
||||||
</g>
|
</g>
|
||||||
</g>
|
|
||||||
<text x="74" y="47">Sync</text>
|
|
||||||
</g>
|
</g>
|
||||||
<!-- photos, bottom right -->
|
<g font-family="Adwaita Sans" font-size="26" font-weight="600" fill="#FFFFFF">
|
||||||
<g transform="translate(1560 690)">
|
<g transform="translate(1000 200)">
|
||||||
<rect x="0" y="10" width="206" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
<rect x="0" y="10" width="236" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)" />
|
||||||
<rect x="0" y="0" width="206" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
<rect x="0" y="0" width="236" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5" />
|
||||||
<g transform="translate(22 20)">
|
<g transform="translate(22 20)">
|
||||||
<rect width="36" height="36" rx="10" fill="#E8618C"/>
|
<rect width="36" height="36" rx="10" fill="#6D4AFF" />
|
||||||
<rect x="8" y="9" width="20" height="18" rx="3" fill="none" stroke="#FFFFFF" stroke-width="2.4"/>
|
<path d="M8 13a2 2 0 0 1 2-2h5l2.5 2.5H26a2 2 0 0 1 2 2V25a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2z" fill="#FFFFFF" />
|
||||||
<circle cx="14" cy="15" r="2" fill="#FFFFFF"/>
|
</g>
|
||||||
<path d="M9.5 25l6-6 4 4 3-3 4 4" fill="none" stroke="#FFFFFF" stroke-width="2.4" stroke-linejoin="round"/>
|
<text x="74" y="47">On demand</text>
|
||||||
</g>
|
</g>
|
||||||
<text x="74" y="47">Photos</text>
|
<g transform="translate(1590 290)">
|
||||||
|
<rect x="0" y="10" width="164" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)" />
|
||||||
|
<rect x="0" y="0" width="164" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5" />
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#1EA885" />
|
||||||
|
<g fill="none" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path d="M26 15a8.5 8.5 0 0 0-15-2" />
|
||||||
|
<path d="M10 9v4.5h4.5" />
|
||||||
|
<path d="M10 21a8.5 8.5 0 0 0 15 2" />
|
||||||
|
<path d="M26 27v-4.5h-4.5" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<text x="74" y="47">Sync</text>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(1560 690)">
|
||||||
|
<rect x="0" y="10" width="206" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)" />
|
||||||
|
<rect x="0" y="0" width="206" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5" />
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#E8618C" />
|
||||||
|
<rect x="8" y="9" width="20" height="18" rx="3" fill="none" stroke="#FFFFFF" stroke-width="2.4" />
|
||||||
|
<circle cx="14" cy="15" r="2" fill="#FFFFFF" />
|
||||||
|
<path d="M9.5 25l6-6 4 4 3-3 4 4" fill="none" stroke="#FFFFFF" stroke-width="2.4" stroke-linejoin="round" />
|
||||||
|
</g>
|
||||||
|
<text x="74" y="47">Photos</text>
|
||||||
|
</g>
|
||||||
|
<g transform="translate(980 790)">
|
||||||
|
<rect x="0" y="10" width="206" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)" />
|
||||||
|
<rect x="0" y="0" width="206" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5" />
|
||||||
|
<g transform="translate(22 20)">
|
||||||
|
<rect width="36" height="36" rx="10" fill="#3B3F5C" />
|
||||||
|
<path d="M9 12l6 6-6 6" fill="none" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" />
|
||||||
|
<path d="M18 25h9" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" />
|
||||||
|
</g>
|
||||||
|
<text x="74" y="48" font-family="JetBrainsMono NF" font-size="25" font-weight="700">pdfs</text>
|
||||||
|
<text x="150" y="48" font-weight="500" fill="#B9B0D9">CLI</text>
|
||||||
|
</g>
|
||||||
</g>
|
</g>
|
||||||
<!-- terminal, bottom left -->
|
<g font-family="Adwaita Sans">
|
||||||
<g transform="translate(980 790)">
|
<g transform="translate(140 292)">
|
||||||
<rect x="0" y="10" width="206" height="76" rx="22" fill="#000000" opacity="0.35" filter="url(#chipshadow)"/>
|
<rect width="410" height="48" rx="24" fill="#6D4AFF" fill-opacity="0.18" stroke="#8A6CFF" stroke-opacity="0.6" stroke-width="1.5" />
|
||||||
<rect x="0" y="0" width="206" height="76" rx="22" fill="#2A2058" fill-opacity="0.85" stroke="#FFFFFF" stroke-opacity="0.14" stroke-width="1.5"/>
|
<circle cx="28" cy="24" r="6" fill="#A48BFF" />
|
||||||
<g transform="translate(22 20)">
|
<text x="46" y="32" font-size="21" font-weight="700" letter-spacing="2.4" fill="#D6CCFF">UNOFFICIAL · OPEN SOURCE</text>
|
||||||
<rect width="36" height="36" rx="10" fill="#3B3F5C"/>
|
</g>
|
||||||
<path d="M9 12l6 6-6 6" fill="none" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>
|
<text x="134" y="478" font-size="124" font-weight="800" letter-spacing="-3" fill="#FFFFFF">Proton Drive</text>
|
||||||
<path d="M18 25h9" stroke="#FFFFFF" stroke-width="2.6" stroke-linecap="round"/>
|
<text x="134" y="610" font-size="124" font-weight="800" letter-spacing="-3" fill="url(#title2)">for Linux</text>
|
||||||
</g>
|
<text x="140" y="702" font-size="38" font-weight="400" fill="#B9B0D9">Your Drive as a folder, and a native GTK4 app.</text>
|
||||||
<text x="74" y="48" font-family="JetBrainsMono NF" font-size="25" font-weight="700">pdfs</text>
|
<text x="140" y="752" font-size="38" font-weight="400" fill="#B9B0D9">No Electron.</text>
|
||||||
<text x="150" y="48" font-weight="500" fill="#B9B0D9">CLI</text>
|
|
||||||
</g>
|
</g>
|
||||||
</g>
|
<g font-family="JetBrainsMono NF" font-size="24" fill="#8C83B0">
|
||||||
|
<text x="140" y="968">github.com/narrrl/proton-drive-linux</text>
|
||||||
<!-- text block -->
|
</g>
|
||||||
<g font-family="Adwaita Sans">
|
<g font-family="Adwaita Sans" font-size="22" fill="#6F6894">
|
||||||
<g transform="translate(140 292)">
|
<text x="1780" y="968" text-anchor="end">Not affiliated with Proton AG</text>
|
||||||
<rect width="410" height="48" rx="24" fill="#6D4AFF" fill-opacity="0.18" stroke="#8A6CFF" stroke-opacity="0.6" stroke-width="1.5"/>
|
|
||||||
<circle cx="28" cy="24" r="6" fill="#A48BFF"/>
|
|
||||||
<text x="46" y="32" font-size="21" font-weight="700" letter-spacing="2.4" fill="#D6CCFF">UNOFFICIAL · OPEN SOURCE</text>
|
|
||||||
</g>
|
</g>
|
||||||
<text x="134" y="478" font-size="124" font-weight="800" letter-spacing="-3" fill="#FFFFFF">Proton Drive</text>
|
|
||||||
<text x="134" y="610" font-size="124" font-weight="800" letter-spacing="-3" fill="url(#title2)">for Linux</text>
|
|
||||||
<text x="140" y="702" font-size="38" font-weight="400" fill="#B9B0D9">Your Drive as a folder, and a native GTK4 app.</text>
|
|
||||||
<text x="140" y="752" font-size="38" font-weight="400" fill="#B9B0D9">No Electron.</text>
|
|
||||||
</g>
|
|
||||||
|
|
||||||
<!-- footer -->
|
|
||||||
<g font-family="JetBrainsMono NF" font-size="24" fill="#8C83B0">
|
|
||||||
<text x="140" y="968">github.com/narrrl/proton-drive-linux</text>
|
|
||||||
</g>
|
|
||||||
<g font-family="Adwaita Sans" font-size="22" fill="#6F6894">
|
|
||||||
<text x="1780" y="968" text-anchor="end">Not affiliated with Proton AG</text>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,36 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256" data-app="drive" role="img" aria-labelledby="drive-title drive-desc">
|
||||||
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Proton Drive for Linux">
|
<title id="drive-title">Proton Drive for Linux</title>
|
||||||
<defs>
|
<desc id="drive-desc">Frontal violet and pink vector icon with shallow metallic copper backing.</desc>
|
||||||
<linearGradient id="pdl-face" x1="12" y1="12" x2="116" y2="112" gradientUnits="userSpaceOnUse">
|
<defs>
|
||||||
<stop offset="0" stop-color="#A48BFF"/>
|
<linearGradient id="drive-face" x1="36" y1="212" x2="220" y2="54" gradientUnits="userSpaceOnUse">
|
||||||
<stop offset="0.55" stop-color="#7552FF"/>
|
<stop stop-color="#6240DA"/><stop offset=".52" stop-color="#8056EF"/><stop offset="1" stop-color="#D58BDF"/>
|
||||||
<stop offset="1" stop-color="#5B36F2"/>
|
</linearGradient>
|
||||||
</linearGradient>
|
<linearGradient id="drive-rear" x1="26" y1="42" x2="218" y2="220" gradientUnits="userSpaceOnUse">
|
||||||
<linearGradient id="pdl-cloud" x1="0" y1="34" x2="0" y2="88" gradientUnits="userSpaceOnUse">
|
<stop stop-color="#8C68EE"/><stop offset="1" stop-color="#5533B5"/>
|
||||||
<stop offset="0" stop-color="#FFFFFF"/>
|
</linearGradient>
|
||||||
<stop offset="1" stop-color="#ECE6FF"/>
|
<linearGradient id="drive-paper" x1="60" y1="80" x2="180" y2="162" gradientUnits="userSpaceOnUse">
|
||||||
</linearGradient>
|
<stop stop-color="#E7DFFA"/><stop offset="1" stop-color="#BDA5EF"/>
|
||||||
<!-- the cloud, with the arrow cut out of it as negative space -->
|
</linearGradient>
|
||||||
<mask id="pdl-cut" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128">
|
<linearGradient id="drive-copper" x1="32" y1="32" x2="232" y2="224" gradientUnits="userSpaceOnUse">
|
||||||
<g fill="#FFFFFF">
|
<stop stop-color="#703E30"/><stop offset=".16" stop-color="#B47456"/>
|
||||||
<circle cx="66" cy="57" r="23"/>
|
<stop offset=".28" stop-color="#E6B296"/><stop offset=".32" stop-color="#F8D8C3"/>
|
||||||
<circle cx="42" cy="68" r="16"/>
|
<stop offset=".37" stop-color="#BB7C5A"/><stop offset=".56" stop-color="#8A4D36"/>
|
||||||
<circle cx="88" cy="69" r="15"/>
|
<stop offset=".69" stop-color="#D69B77"/><stop offset=".75" stop-color="#F2C9AA"/>
|
||||||
<rect x="26" y="68" width="77" height="20" rx="10"/>
|
<stop offset=".81" stop-color="#B87956"/><stop offset="1" stop-color="#713F30"/>
|
||||||
</g>
|
</linearGradient>
|
||||||
<g stroke="#000000" stroke-width="7.5" stroke-linecap="round" stroke-linejoin="round">
|
<linearGradient id="drive-sun" x1="172" y1="82" x2="201" y2="112" gradientUnits="userSpaceOnUse">
|
||||||
<path d="M64 49v26"/>
|
<stop stop-color="#8D513A"/><stop offset=".33" stop-color="#DDA581"/>
|
||||||
<path d="M54.5 65.5l9.5 9.5 9.5-9.5"/>
|
<stop offset=".47" stop-color="#F7D8B8"/><stop offset=".53" stop-color="#D69B74"/>
|
||||||
</g>
|
<stop offset="1" stop-color="#925439"/>
|
||||||
</mask>
|
</linearGradient>
|
||||||
</defs>
|
<linearGradient id="drive-mountain" x1="44" y1="148" x2="186" y2="218" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#D9C9FA"/><stop offset="1" stop-color="#A582E9"/>
|
||||||
<!-- base: a rounded tile with a darker lower edge for depth -->
|
</linearGradient>
|
||||||
<rect x="12" y="16" width="104" height="100" rx="26" fill="#4424C0"/>
|
<linearGradient id="drive-far-mountain" x1="142" y1="152" x2="211" y2="216" gradientUnits="userSpaceOnUse">
|
||||||
<rect x="12" y="12" width="104" height="100" rx="26" fill="url(#pdl-face)"/>
|
<stop stop-color="#E8B4EB"/><stop offset="1" stop-color="#BB7BD7"/>
|
||||||
<rect x="12.5" y="12.5" width="103" height="99" rx="25.5" stroke="#FFFFFF" stroke-opacity="0.2"/>
|
</linearGradient>
|
||||||
|
<clipPath id="drive-photo-clip"><rect x="28" y="54" width="194" height="172" rx="24"/></clipPath>
|
||||||
<!-- cloud shadow, then the cloud itself -->
|
</defs>
|
||||||
<rect y="3" width="128" height="128" fill="#2E1596" fill-opacity="0.3" mask="url(#pdl-cut)"/>
|
<!-- Canonical vector artwork; regenerate platform assets with scripts/render-branding.py. -->
|
||||||
<rect width="128" height="128" fill="url(#pdl-cloud)" mask="url(#pdl-cut)"/>
|
<g id="mark">
|
||||||
|
<path d="M48 48H91Q99 48 105 54L117 66Q123 72 132 72H208Q228 72 228 92V200Q228 220 208 220H48Q28 220 28 200V68Q28 48 48 48Z" fill="url(#drive-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round"/>
|
||||||
|
<path d="M48 48H91Q99 48 105 54L117 66Q123 72 132 72H208Q228 72 228 92V200Q228 220 208 220H48Q28 220 28 200V68Q28 48 48 48Z" fill="url(#drive-rear)" stroke="#5E3CBD" stroke-width=".8"/>
|
||||||
|
<rect x="72" y="82" width="132" height="112" rx="10" fill="url(#drive-paper)" stroke="#EFE9FC" stroke-width="1"/>
|
||||||
|
<rect x="51" y="97" width="140" height="109" rx="10" fill="url(#drive-paper)" stroke="#EFE9FC" stroke-width="1"/>
|
||||||
|
<path d="M48 94H89Q97 94 103 100L115 112Q121 118 130 118H208Q228 118 228 138V206Q228 226 208 226H48Q28 226 28 206V114Q28 94 48 94Z" fill="url(#drive-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round"/>
|
||||||
|
<path d="M48 94H89Q97 94 103 100L115 112Q121 118 130 118H208Q228 118 228 138V206Q228 226 208 226H48Q28 226 28 206V114Q28 94 48 94Z" fill="url(#drive-face)" stroke="#5936B7" stroke-width=".9"/>
|
||||||
|
<path d="M32 113Q32 98 48 98H89Q95 98 100 103L112 115Q120 122 130 122H208Q224 122 224 138" fill="none" stroke="#F3DDF9" stroke-opacity=".52" stroke-width="1.5" stroke-linecap="round"/>
|
||||||
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -1,6 +1,6 @@
|
|||||||
pkgbase = proton-drive-for-linux-bin
|
pkgbase = proton-drive-for-linux-bin
|
||||||
pkgdesc = Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)
|
pkgdesc = Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)
|
||||||
pkgver = 3.7.0
|
pkgver = 3.8.0
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://proton-drive.narl.io
|
url = https://proton-drive.narl.io
|
||||||
install = proton-drive.install
|
install = proton-drive.install
|
||||||
@@ -22,25 +22,15 @@ pkgbase = proton-drive-for-linux-bin
|
|||||||
optdepends = xdg-utils: "Open folder" action in the tray menu
|
optdepends = xdg-utils: "Open folder" action in the tray menu
|
||||||
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
|
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
|
||||||
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
|
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
|
||||||
provides = proton-drive-for-linux=3.7.0
|
provides = proton-drive-for-linux=3.8.0
|
||||||
provides = proton-drive-linux=3.7.0
|
provides = proton-drive-linux=3.8.0
|
||||||
provides = pdfs
|
provides = pdfs
|
||||||
conflicts = proton-drive-linux
|
conflicts = proton-drive-linux
|
||||||
conflicts = proton-drive-for-linux
|
conflicts = proton-drive-for-linux
|
||||||
conflicts = proton-drive-for-linux-git
|
conflicts = proton-drive-for-linux-git
|
||||||
options = !strip
|
options = !strip
|
||||||
options = !debug
|
options = !debug
|
||||||
source = proton-drive-linux-3.7.0-x86_64.tar.gz::https://github.com/narrrl/proton-drive-linux/releases/download/v3.7.0/proton-drive-linux-3.7.0-x86_64.tar.gz
|
source = proton-drive-linux-3.8.0-x86_64.tar.gz::https://github.com/narrrl/proton-drive-linux/releases/download/v3.8.0/proton-drive-linux-3.8.0-x86_64.tar.gz
|
||||||
source = io.narl.proton-drive-linux-3.7.0.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/io.narl.proton-drive-linux.desktop
|
sha256sums = 99348fbf9121624701ae43e52776e5d1c469ff5cd5e52cd216bf8cb969e0bab2
|
||||||
source = io.narl.proton-drive-linux-tray-3.7.0.desktop::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/io.narl.proton-drive-linux-tray.desktop
|
|
||||||
source = io.narl.proton-drive-linux-3.7.0.svg::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/io.narl.proton-drive-linux.svg
|
|
||||||
source = proton-drive-3.7.0.service::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/packaging/proton-drive.service
|
|
||||||
source = LICENSE-3.7.0::https://raw.githubusercontent.com/narrrl/proton-drive-linux/v3.7.0/LICENSE
|
|
||||||
sha256sums = 3f0d16c19b10b30e3f181e3c7fb439f0a8c38980e8ab7a4a96ae6596b349787c
|
|
||||||
sha256sums = d190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123
|
|
||||||
sha256sums = 1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0
|
|
||||||
sha256sums = e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828
|
|
||||||
sha256sums = 44c25dca6e759c46fca50b58099aa6194abe78293dee07d971bbbce0ff3ca58f
|
|
||||||
sha256sums = 02c419e7f9af08dda720e4f852f3e57cf5a69e192605440f750e9d244fa2817c
|
|
||||||
|
|
||||||
pkgname = proton-drive-for-linux-bin
|
pkgname = proton-drive-for-linux-bin
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Nils Pukropp <contact@narl.io>
|
# Maintainer: Nils Pukropp <contact@narl.io>
|
||||||
|
|
||||||
pkgname=proton-drive-for-linux-bin
|
pkgname=proton-drive-for-linux-bin
|
||||||
pkgver=3.7.0
|
pkgver=3.8.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)"
|
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (binaries)"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
@@ -25,54 +25,37 @@ options=('!strip' '!debug')
|
|||||||
# Stops the running daemon before removal, so the mount stops mirroring deletes.
|
# Stops the running daemon before removal, so the mount stops mirroring deletes.
|
||||||
install=proton-drive.install
|
install=proton-drive.install
|
||||||
_tag="v$pkgver"
|
_tag="v$pkgver"
|
||||||
_raw="https://raw.githubusercontent.com/narrrl/proton-drive-linux/$_tag"
|
# The release tarball holds the binaries and everything installed around them
|
||||||
# The release tarball holds the four binaries only, so the desktop integration
|
# (desktop files, icon, user service, translations, completions) in a /usr-like
|
||||||
# files come straight from the tagged tree. Every one carries $pkgver in its
|
# tree under one directory.
|
||||||
# name: makepkg reuses a cached file of the same name, so an unversioned name
|
source=("proton-drive-linux-$pkgver-x86_64.tar.gz::$_repo/releases/download/$_tag/proton-drive-linux-$pkgver-x86_64.tar.gz")
|
||||||
# keeps the old copy after upstream changes it and fails the checksum.
|
sha256sums=('99348fbf9121624701ae43e52776e5d1c469ff5cd5e52cd216bf8cb969e0bab2')
|
||||||
source=("proton-drive-linux-$pkgver-x86_64.tar.gz::$_repo/releases/download/$_tag/proton-drive-linux-$pkgver-x86_64.tar.gz"
|
|
||||||
"io.narl.proton-drive-linux-$pkgver.desktop::$_raw/packaging/io.narl.proton-drive-linux.desktop"
|
|
||||||
"io.narl.proton-drive-linux-tray-$pkgver.desktop::$_raw/packaging/io.narl.proton-drive-linux-tray.desktop"
|
|
||||||
"io.narl.proton-drive-linux-$pkgver.svg::$_raw/packaging/io.narl.proton-drive-linux.svg"
|
|
||||||
"proton-drive-$pkgver.service::$_raw/packaging/proton-drive.service"
|
|
||||||
"LICENSE-$pkgver::$_raw/LICENSE")
|
|
||||||
sha256sums=('3f0d16c19b10b30e3f181e3c7fb439f0a8c38980e8ab7a4a96ae6596b349787c'
|
|
||||||
'd190d6771fff0b975271fb62fd3fb0fa8bbf17d7278c10853c18557855b0c123'
|
|
||||||
'1d95e250370220e3bb6aead6ce34d1d6cc759f42c4803b75f1667e78ff47c6c0'
|
|
||||||
'e598a93c2715c3a9fdc7fb937902083d4a1135e8fbdfe6fe7e37f0383ebbd828'
|
|
||||||
'44c25dca6e759c46fca50b58099aa6194abe78293dee07d971bbbce0ff3ca58f'
|
|
||||||
'02c419e7f9af08dda720e4f852f3e57cf5a69e192605440f750e9d244fa2817c')
|
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
install -Dm755 "$srcdir/pdfs" "$pkgdir/usr/bin/pdfs"
|
cd "$srcdir/proton-drive-linux-$pkgver-x86_64"
|
||||||
install -Dm755 "$srcdir/pdfs-tray" "$pkgdir/usr/bin/pdfs-tray"
|
local exe
|
||||||
install -Dm755 "$srcdir/pdfs-app" "$pkgdir/usr/bin/pdfs-app"
|
for exe in pdfs pdfs-tray pdfs-app pdfs-prompt; do
|
||||||
install -Dm755 "$srcdir/pdfs-prompt" "$pkgdir/usr/bin/pdfs-prompt"
|
install -Dm755 "bin/$exe" "$pkgdir/usr/bin/$exe"
|
||||||
|
done
|
||||||
|
|
||||||
install -Dm644 "$srcdir/io.narl.proton-drive-linux-$pkgver.desktop" \
|
install -Dm644 share/applications/io.narl.proton-drive-linux.desktop \
|
||||||
"$pkgdir/usr/share/applications/io.narl.proton-drive-linux.desktop"
|
"$pkgdir/usr/share/applications/io.narl.proton-drive-linux.desktop"
|
||||||
install -Dm644 "$srcdir/io.narl.proton-drive-linux-tray-$pkgver.desktop" \
|
install -Dm644 etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop \
|
||||||
"$pkgdir/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
|
"$pkgdir/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
|
||||||
install -Dm644 "$srcdir/io.narl.proton-drive-linux-$pkgver.svg" \
|
install -Dm644 share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg \
|
||||||
"$pkgdir/usr/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
|
"$pkgdir/usr/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
|
||||||
|
|
||||||
# systemd user unit for the auto-mount daemon; enabled per user, not by pacman.
|
# systemd user unit for the auto-mount daemon; enabled per user, not by pacman.
|
||||||
install -Dm644 "$srcdir/proton-drive-$pkgver.service" \
|
install -Dm644 lib/systemd/user/proton-drive.service \
|
||||||
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
|
"$pkgdir/usr/lib/systemd/user/proton-drive.service"
|
||||||
|
|
||||||
# Translations ship precompiled in the release tarball.
|
# Translations and shell completion for bash, zsh and fish.
|
||||||
install -dm755 "$pkgdir/usr/share"
|
install -dm755 "$pkgdir/usr/share"
|
||||||
cp -r --no-preserve=ownership "$srcdir/locale" "$pkgdir/usr/share/locale"
|
cp -r --no-preserve=ownership share/locale share/bash-completion share/zsh share/fish \
|
||||||
|
"$pkgdir/usr/share/"
|
||||||
|
|
||||||
# Shell completion for bash, zsh and fish, written by the binary itself.
|
install -Dm644 share/licenses/proton-drive-linux/LICENSE \
|
||||||
local share="$pkgdir/usr/share"
|
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
||||||
install -d "$share/bash-completion/completions" "$share/zsh/site-functions" \
|
|
||||||
"$share/fish/vendor_completions.d"
|
|
||||||
"$srcdir/pdfs" completions bash > "$share/bash-completion/completions/pdfs"
|
|
||||||
"$srcdir/pdfs" completions zsh > "$share/zsh/site-functions/_pdfs"
|
|
||||||
"$srcdir/pdfs" completions fish > "$share/fish/vendor_completions.d/pdfs.fish"
|
|
||||||
|
|
||||||
install -Dm644 "$srcdir/LICENSE-$pkgver" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
|
||||||
|
|
||||||
# pacman brings new releases, so the app never checks for them itself.
|
# pacman brings new releases, so the app never checks for them itself.
|
||||||
install -Dm644 /dev/null "$pkgdir/usr/share/proton-drive-linux/managed-updates"
|
install -Dm644 /dev/null "$pkgdir/usr/share/proton-drive-linux/managed-updates"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
pkgbase = proton-drive-for-linux-git
|
pkgbase = proton-drive-for-linux-git
|
||||||
pkgdesc = Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)
|
pkgdesc = Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)
|
||||||
pkgver = 3.7.0.r0.g7ab14bb
|
pkgver = 3.8.0.r0.g6fa91e8
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://proton-drive.narl.io
|
url = https://proton-drive.narl.io
|
||||||
install = proton-drive.install
|
install = proton-drive.install
|
||||||
@@ -25,8 +25,8 @@ pkgbase = proton-drive-for-linux-git
|
|||||||
optdepends = xdg-utils: "Open folder" action in the tray menu
|
optdepends = xdg-utils: "Open folder" action in the tray menu
|
||||||
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
|
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
|
||||||
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
|
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
|
||||||
provides = proton-drive-for-linux=3.7.0.r0.g7ab14bb
|
provides = proton-drive-for-linux=3.8.0.r0.g6fa91e8
|
||||||
provides = proton-drive-linux=3.7.0.r0.g7ab14bb
|
provides = proton-drive-linux=3.8.0.r0.g6fa91e8
|
||||||
provides = pdfs
|
provides = pdfs
|
||||||
conflicts = proton-drive-linux
|
conflicts = proton-drive-linux
|
||||||
conflicts = proton-drive-for-linux
|
conflicts = proton-drive-for-linux
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Nils Pukropp <contact@narl.io>
|
# Maintainer: Nils Pukropp <contact@narl.io>
|
||||||
|
|
||||||
pkgname=proton-drive-for-linux-git
|
pkgname=proton-drive-for-linux-git
|
||||||
pkgver=3.7.0.r0.g7ab14bb
|
pkgver=3.8.0.r0.g6fa91e8
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)"
|
pkgdesc="Unofficial Proton Drive client: FUSE files-on-demand mount, CLI, GTK4 app, tray (git)"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
pkgbase = proton-drive-for-linux
|
pkgbase = proton-drive-for-linux
|
||||||
pkgdesc = Unofficial Proton Drive client: files-on-demand FUSE mount, CLI, GTK4 app and tray
|
pkgdesc = Unofficial Proton Drive client: files-on-demand FUSE mount, CLI, GTK4 app and tray
|
||||||
pkgver = 3.7.0
|
pkgver = 3.8.0
|
||||||
pkgrel = 1
|
pkgrel = 1
|
||||||
url = https://proton-drive.narl.io
|
url = https://proton-drive.narl.io
|
||||||
install = proton-drive.install
|
install = proton-drive.install
|
||||||
@@ -24,13 +24,13 @@ pkgbase = proton-drive-for-linux
|
|||||||
optdepends = xdg-utils: "Open folder" action in the tray menu
|
optdepends = xdg-utils: "Open folder" action in the tray menu
|
||||||
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
|
optdepends = fzf: search-as-you-type launcher (pdfs-prompt --fzf)
|
||||||
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
|
optdepends = foot: terminal that hosts pdfs-prompt --fzf when started from a keybinding
|
||||||
provides = proton-drive-linux=3.7.0
|
provides = proton-drive-linux=3.8.0
|
||||||
provides = pdfs
|
provides = pdfs
|
||||||
conflicts = proton-drive-linux
|
conflicts = proton-drive-linux
|
||||||
conflicts = proton-drive-for-linux-bin
|
conflicts = proton-drive-for-linux-bin
|
||||||
conflicts = proton-drive-for-linux-git
|
conflicts = proton-drive-for-linux-git
|
||||||
options = !lto
|
options = !lto
|
||||||
source = proton-drive-for-linux-3.7.0.tar.gz::https://github.com/narrrl/proton-drive-linux/archive/refs/tags/v3.7.0.tar.gz
|
source = proton-drive-for-linux-3.8.0.tar.gz::https://github.com/narrrl/proton-drive-linux/archive/refs/tags/v3.8.0.tar.gz
|
||||||
sha256sums = 542c534976e335cde6658de127e1eefffade9057d5332fd33457bc371c7a2737
|
sha256sums = 095186fa108f27ff2b175188bb13466a94cc8ecfd71088df47a41d4d9baa58c1
|
||||||
|
|
||||||
pkgname = proton-drive-for-linux
|
pkgname = proton-drive-for-linux
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Nils Pukropp <contact@narl.io>
|
# Maintainer: Nils Pukropp <contact@narl.io>
|
||||||
|
|
||||||
pkgname=proton-drive-for-linux
|
pkgname=proton-drive-for-linux
|
||||||
pkgver=3.7.0
|
pkgver=3.8.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Unofficial Proton Drive client: files-on-demand FUSE mount, CLI, GTK4 app and tray"
|
pkgdesc="Unofficial Proton Drive client: files-on-demand FUSE mount, CLI, GTK4 app and tray"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
@@ -26,7 +26,7 @@ options=('!lto')
|
|||||||
# Stops the running daemon before removal, so the mount stops mirroring deletes.
|
# Stops the running daemon before removal, so the mount stops mirroring deletes.
|
||||||
install=proton-drive.install
|
install=proton-drive.install
|
||||||
source=("$pkgname-$pkgver.tar.gz::$_repo/archive/refs/tags/v$pkgver.tar.gz")
|
source=("$pkgname-$pkgver.tar.gz::$_repo/archive/refs/tags/v$pkgver.tar.gz")
|
||||||
sha256sums=('542c534976e335cde6658de127e1eefffade9057d5332fd33457bc371c7a2737')
|
sha256sums=('095186fa108f27ff2b175188bb13466a94cc8ecfd71088df47a41d4d9baa58c1')
|
||||||
|
|
||||||
_srcname="proton-drive-linux-$pkgver"
|
_srcname="proton-drive-linux-$pkgver"
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,44 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="0 0 256 256" data-app="drive" role="img" aria-labelledby="drive-title drive-desc">
|
||||||
<svg width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Proton Drive for Linux">
|
<title id="drive-title">Proton Drive for Linux</title>
|
||||||
<defs>
|
<desc id="drive-desc">Frontal violet and pink vector icon with shallow metallic copper backing.</desc>
|
||||||
<linearGradient id="pdl-face" x1="12" y1="12" x2="116" y2="112" gradientUnits="userSpaceOnUse">
|
<defs>
|
||||||
<stop offset="0" stop-color="#A48BFF"/>
|
<linearGradient id="drive-face" x1="36" y1="212" x2="220" y2="54" gradientUnits="userSpaceOnUse">
|
||||||
<stop offset="0.55" stop-color="#7552FF"/>
|
<stop stop-color="#6240DA"/><stop offset=".52" stop-color="#8056EF"/><stop offset="1" stop-color="#D58BDF"/>
|
||||||
<stop offset="1" stop-color="#5B36F2"/>
|
</linearGradient>
|
||||||
</linearGradient>
|
<linearGradient id="drive-rear" x1="26" y1="42" x2="218" y2="220" gradientUnits="userSpaceOnUse">
|
||||||
<linearGradient id="pdl-cloud" x1="0" y1="34" x2="0" y2="88" gradientUnits="userSpaceOnUse">
|
<stop stop-color="#8C68EE"/><stop offset="1" stop-color="#5533B5"/>
|
||||||
<stop offset="0" stop-color="#FFFFFF"/>
|
</linearGradient>
|
||||||
<stop offset="1" stop-color="#ECE6FF"/>
|
<linearGradient id="drive-paper" x1="60" y1="80" x2="180" y2="162" gradientUnits="userSpaceOnUse">
|
||||||
</linearGradient>
|
<stop stop-color="#E7DFFA"/><stop offset="1" stop-color="#BDA5EF"/>
|
||||||
<!-- the cloud, with the arrow cut out of it as negative space -->
|
</linearGradient>
|
||||||
<mask id="pdl-cut" maskUnits="userSpaceOnUse" x="0" y="0" width="128" height="128">
|
<linearGradient id="drive-copper" x1="32" y1="32" x2="232" y2="224" gradientUnits="userSpaceOnUse">
|
||||||
<g fill="#FFFFFF">
|
<stop stop-color="#703E30"/><stop offset=".16" stop-color="#B47456"/>
|
||||||
<circle cx="66" cy="57" r="23"/>
|
<stop offset=".28" stop-color="#E6B296"/><stop offset=".32" stop-color="#F8D8C3"/>
|
||||||
<circle cx="42" cy="68" r="16"/>
|
<stop offset=".37" stop-color="#BB7C5A"/><stop offset=".56" stop-color="#8A4D36"/>
|
||||||
<circle cx="88" cy="69" r="15"/>
|
<stop offset=".69" stop-color="#D69B77"/><stop offset=".75" stop-color="#F2C9AA"/>
|
||||||
<rect x="26" y="68" width="77" height="20" rx="10"/>
|
<stop offset=".81" stop-color="#B87956"/><stop offset="1" stop-color="#713F30"/>
|
||||||
</g>
|
</linearGradient>
|
||||||
<g stroke="#000000" stroke-width="7.5" stroke-linecap="round" stroke-linejoin="round">
|
<linearGradient id="drive-sun" x1="172" y1="82" x2="201" y2="112" gradientUnits="userSpaceOnUse">
|
||||||
<path d="M64 49v26"/>
|
<stop stop-color="#8D513A"/><stop offset=".33" stop-color="#DDA581"/>
|
||||||
<path d="M54.5 65.5l9.5 9.5 9.5-9.5"/>
|
<stop offset=".47" stop-color="#F7D8B8"/><stop offset=".53" stop-color="#D69B74"/>
|
||||||
</g>
|
<stop offset="1" stop-color="#925439"/>
|
||||||
</mask>
|
</linearGradient>
|
||||||
</defs>
|
<linearGradient id="drive-mountain" x1="44" y1="148" x2="186" y2="218" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#D9C9FA"/><stop offset="1" stop-color="#A582E9"/>
|
||||||
<!-- base: a rounded tile with a darker lower edge for depth -->
|
</linearGradient>
|
||||||
<rect x="12" y="16" width="104" height="100" rx="26" fill="#4424C0"/>
|
<linearGradient id="drive-far-mountain" x1="142" y1="152" x2="211" y2="216" gradientUnits="userSpaceOnUse">
|
||||||
<rect x="12" y="12" width="104" height="100" rx="26" fill="url(#pdl-face)"/>
|
<stop stop-color="#E8B4EB"/><stop offset="1" stop-color="#BB7BD7"/>
|
||||||
<rect x="12.5" y="12.5" width="103" height="99" rx="25.5" stroke="#FFFFFF" stroke-opacity="0.2"/>
|
</linearGradient>
|
||||||
|
<clipPath id="drive-photo-clip"><rect x="28" y="54" width="194" height="172" rx="24"/></clipPath>
|
||||||
<!-- cloud shadow, then the cloud itself -->
|
</defs>
|
||||||
<rect y="3" width="128" height="128" fill="#2E1596" fill-opacity="0.3" mask="url(#pdl-cut)"/>
|
<!-- Canonical vector artwork; regenerate platform assets with scripts/render-branding.py. -->
|
||||||
<rect width="128" height="128" fill="url(#pdl-cloud)" mask="url(#pdl-cut)"/>
|
<g id="mark">
|
||||||
|
<path d="M48 48H91Q99 48 105 54L117 66Q123 72 132 72H208Q228 72 228 92V200Q228 220 208 220H48Q28 220 28 200V68Q28 48 48 48Z" fill="url(#drive-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round"/>
|
||||||
|
<path d="M48 48H91Q99 48 105 54L117 66Q123 72 132 72H208Q228 72 228 92V200Q228 220 208 220H48Q28 220 28 200V68Q28 48 48 48Z" fill="url(#drive-rear)" stroke="#5E3CBD" stroke-width=".8"/>
|
||||||
|
<rect x="72" y="82" width="132" height="112" rx="10" fill="url(#drive-paper)" stroke="#EFE9FC" stroke-width="1"/>
|
||||||
|
<rect x="51" y="97" width="140" height="109" rx="10" fill="url(#drive-paper)" stroke="#EFE9FC" stroke-width="1"/>
|
||||||
|
<path d="M48 94H89Q97 94 103 100L115 112Q121 118 130 118H208Q228 118 228 138V206Q228 226 208 226H48Q28 226 28 206V114Q28 94 48 94Z" fill="url(#drive-copper)" transform="translate(6 -6)" stroke="#7D4936" stroke-width=".8" stroke-linejoin="round"/>
|
||||||
|
<path d="M48 94H89Q97 94 103 100L115 112Q121 118 130 118H208Q228 118 228 138V206Q228 226 208 226H48Q28 226 28 206V114Q28 94 48 94Z" fill="url(#drive-face)" stroke="#5936B7" stroke-width=".9"/>
|
||||||
|
<path d="M32 113Q32 98 48 98H89Q95 98 100 103L112 115Q120 122 130 122H208Q224 122 224 138" fill="none" stroke="#F3DDF9" stroke-opacity=".52" stroke-width="1.5" stroke-linecap="round"/>
|
||||||
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -0,0 +1,45 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Lay out the release tarball: built binaries, desktop files, icon, user
|
||||||
|
# service, translations, shell completions and install.sh, under one top-level
|
||||||
|
# directory with a /usr-like tree, then pack it.
|
||||||
|
#
|
||||||
|
# usage: packaging/tarball/build.sh <binary dir> <version> <output dir>
|
||||||
|
# e.g. packaging/tarball/build.sh target/release 3.8.0 dist
|
||||||
|
# Writes <output dir>/proton-drive-linux-<version>-x86_64.tar.gz and prints
|
||||||
|
# its path.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ $# -ne 3 ]; then
|
||||||
|
echo "usage: $0 <binary dir> <version> <output dir>" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
bin_dir="$1"
|
||||||
|
version="$2"
|
||||||
|
out="$3"
|
||||||
|
repo="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||||
|
|
||||||
|
name="proton-drive-linux-$version-x86_64"
|
||||||
|
stage="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$stage"' EXIT
|
||||||
|
root="$stage/$name"
|
||||||
|
|
||||||
|
for exe in pdfs pdfs-app pdfs-tray pdfs-prompt; do
|
||||||
|
install -Dm755 "$bin_dir/$exe" "$root/bin/$exe"
|
||||||
|
done
|
||||||
|
install -Dm644 "$repo/packaging/io.narl.proton-drive-linux.desktop" \
|
||||||
|
"$root/share/applications/io.narl.proton-drive-linux.desktop"
|
||||||
|
install -Dm644 "$repo/packaging/io.narl.proton-drive-linux-tray.desktop" \
|
||||||
|
"$root/etc/xdg/autostart/io.narl.proton-drive-linux-tray.desktop"
|
||||||
|
install -Dm644 "$repo/packaging/io.narl.proton-drive-linux.svg" \
|
||||||
|
"$root/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg"
|
||||||
|
install -Dm644 "$repo/packaging/proton-drive.service" \
|
||||||
|
"$root/lib/systemd/user/proton-drive.service"
|
||||||
|
install -Dm644 "$repo/LICENSE" "$root/share/licenses/proton-drive-linux/LICENSE"
|
||||||
|
"$repo/po/build.sh" "$root/share/locale"
|
||||||
|
"$repo/packaging/completions.sh" "$root/bin/pdfs" "$root/share"
|
||||||
|
install -Dm755 "$repo/packaging/tarball/install.sh" "$root/install.sh"
|
||||||
|
|
||||||
|
mkdir -p "$out"
|
||||||
|
tarball="$(cd "$out" && pwd)/$name.tar.gz"
|
||||||
|
tar -czf "$tarball" -C "$stage" --owner=0 --group=0 "$name"
|
||||||
|
echo "$tarball"
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Install Proton Drive for Linux from this release tarball into your home
|
||||||
|
# directory, or remove it again. Needs no root, so it works on distributions
|
||||||
|
# where the system is read-only, as long as GTK 4, libadwaita, WebKitGTK 6 and
|
||||||
|
# FUSE 3 are on the system.
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat >&2 <<'EOF'
|
||||||
|
usage: ./install.sh [--prefix DIR] [--no-service] [--force]
|
||||||
|
./install.sh --uninstall [--prefix DIR] [--no-service]
|
||||||
|
|
||||||
|
Installs the app, the tray, the search launcher and the `pdfs` command into
|
||||||
|
~/.local (bin/, share/), the background service into ~/.config/systemd/user and
|
||||||
|
the tray's login entry into ~/.config/autostart. Run it again from a newer
|
||||||
|
tarball to update; the running service restarts on the new version.
|
||||||
|
|
||||||
|
--prefix DIR install under DIR instead of ~/.local
|
||||||
|
--uninstall remove what an earlier run installed; your settings, cache
|
||||||
|
and the files in Proton Drive stay
|
||||||
|
--no-service leave systemd alone (no reload, restart or stop)
|
||||||
|
--force install although libraries are missing or a package
|
||||||
|
already installs Proton Drive for Linux
|
||||||
|
EOF
|
||||||
|
exit 2
|
||||||
|
}
|
||||||
|
|
||||||
|
prefix=""
|
||||||
|
uninstall=0
|
||||||
|
service=1
|
||||||
|
force=0
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--prefix) [[ $# -ge 2 ]] || usage; prefix="$2"; shift ;;
|
||||||
|
--prefix=*) prefix="${1#*=}" ;;
|
||||||
|
--uninstall) uninstall=1 ;;
|
||||||
|
--no-service) service=0 ;;
|
||||||
|
--force) force=1 ;;
|
||||||
|
-h | --help) usage ;;
|
||||||
|
*) echo "unknown option: $1" >&2; usage ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
# The copy kept for --uninstall knows where it was installed.
|
||||||
|
if [[ -z "$prefix" && -f "$here/installed-files" ]]; then
|
||||||
|
prefix="$(dirname "$(dirname "$here")")"
|
||||||
|
fi
|
||||||
|
prefix="${prefix:-$HOME/.local}"
|
||||||
|
[[ "$prefix" == /* ]] || prefix="$PWD/$prefix"
|
||||||
|
prefix="${prefix%/}"
|
||||||
|
|
||||||
|
config_home="${XDG_CONFIG_HOME:-$HOME/.config}"
|
||||||
|
unit_dir="$config_home/systemd/user"
|
||||||
|
autostart_dir="$config_home/autostart"
|
||||||
|
data_dir="$prefix/share/proton-drive-linux"
|
||||||
|
manifest="$data_dir/installed-files"
|
||||||
|
unit=proton-drive.service
|
||||||
|
|
||||||
|
say() { printf '%s\n' "$*"; }
|
||||||
|
warn() { printf 'warning: %s\n' "$*" >&2; }
|
||||||
|
die() { printf 'error: %s\n' "$*" >&2; exit 1; }
|
||||||
|
|
||||||
|
systemctl_user() {
|
||||||
|
[[ $service -eq 1 ]] || return 0
|
||||||
|
command -v systemctl >/dev/null || return 0
|
||||||
|
systemctl --user "$@" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove every file listed in the manifest `$1` that is not in the list `$2`
|
||||||
|
# (one path per line), then the directories that leaves empty.
|
||||||
|
remove_listed() {
|
||||||
|
local list="$1" keep="${2:-}" path
|
||||||
|
[[ -f "$list" ]] || return 0
|
||||||
|
while IFS= read -r path; do
|
||||||
|
[[ -n "$path" ]] || continue
|
||||||
|
if [[ -n "$keep" ]] && grep -Fxq -- "$path" <<<"$keep"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
rm -f -- "$path"
|
||||||
|
rmdir -p --ignore-fail-on-non-empty -- "$(dirname -- "$path")" 2>/dev/null || true
|
||||||
|
done <"$list"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $uninstall -eq 1 ]]; then
|
||||||
|
[[ -f "$manifest" ]] || die "nothing installed under $prefix (no $manifest)"
|
||||||
|
# Stopping unmounts My files; queued changes stay and upload on the next start.
|
||||||
|
systemctl_user disable --now "$unit"
|
||||||
|
remove_listed "$manifest"
|
||||||
|
rm -f -- "$manifest" "$data_dir/install.sh"
|
||||||
|
rmdir --ignore-fail-on-non-empty -- "$data_dir" 2>/dev/null || true
|
||||||
|
systemctl_user daemon-reload
|
||||||
|
say "Removed Proton Drive for Linux from $prefix."
|
||||||
|
say "Your settings, cache and sign-in stay; see the uninstall section of docs/INSTALL.md to remove them too."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ -x "$here/bin/pdfs" ]] || die "run install.sh from the unpacked tarball (no bin/pdfs next to it)"
|
||||||
|
|
||||||
|
# A package and this install would each bring a service unit, and the one in
|
||||||
|
# ~/.config wins: the two would run different versions against one database.
|
||||||
|
if [[ $force -eq 0 && ( -e /usr/bin/pdfs || -e /usr/lib/systemd/user/$unit ) ]]; then
|
||||||
|
die "a package already installs Proton Drive for Linux (/usr/bin/pdfs). Remove it first, or keep using it."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Missing libraries would only show when the app does not start.
|
||||||
|
missing="$(for exe in pdfs pdfs-app pdfs-tray pdfs-prompt; do
|
||||||
|
ldd "$here/bin/$exe" 2>&1 | grep -E 'not found' || true
|
||||||
|
done | sort -u)"
|
||||||
|
if [[ -n "$missing" ]]; then
|
||||||
|
printf '%s\n' "$missing" | sed 's/^[[:space:]]*/ /' >&2
|
||||||
|
if grep -q 'GLIBC_' <<<"$missing"; then
|
||||||
|
warn "these binaries need glibc 2.39 or newer (Ubuntu 24.04, Debian 13, Fedora 40)"
|
||||||
|
fi
|
||||||
|
cat >&2 <<'EOF'
|
||||||
|
Install the missing libraries, then run this again:
|
||||||
|
Fedora, Fedora Atomic gtk4 libadwaita webkitgtk6.0 fuse3
|
||||||
|
(on Silverblue and its siblings, layer the COPR package
|
||||||
|
instead: see docs/INSTALL.md)
|
||||||
|
Debian, Ubuntu libgtk-4-1 libadwaita-1-0 libwebkitgtk-6.0-4 fuse3
|
||||||
|
Arch Linux gtk4 libadwaita webkitgtk-6.0 fuse3
|
||||||
|
openSUSE libgtk-4-1 libadwaita-1-0 libwebkitgtk-6_0-4 fuse3
|
||||||
|
EOF
|
||||||
|
[[ $force -eq 1 ]] || die "missing libraries (--force installs anyway)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fusermount="$(command -v fusermount3 || true)"
|
||||||
|
if [[ -z "$fusermount" ]]; then
|
||||||
|
warn "fusermount3 is missing; install fuse3, or My files cannot be mounted"
|
||||||
|
elif [[ ! -u "$fusermount" ]]; then
|
||||||
|
warn "$fusermount is not setuid root; My files may not mount"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Where each file of the tarball goes, as "source<TAB>target" lines.
|
||||||
|
targets() {
|
||||||
|
local file rel
|
||||||
|
while IFS= read -r -d '' file; do
|
||||||
|
rel="${file#"$here"/}"
|
||||||
|
case "$rel" in
|
||||||
|
bin/* | share/*) printf '%s\t%s\n' "$rel" "$prefix/$rel" ;;
|
||||||
|
lib/systemd/user/*) printf '%s\t%s\n' "$rel" "$unit_dir/${rel##*/}" ;;
|
||||||
|
etc/xdg/autostart/*) printf '%s\t%s\n' "$rel" "$autostart_dir/${rel##*/}" ;;
|
||||||
|
esac
|
||||||
|
done < <(find "$here/bin" "$here/share" "$here/lib" "$here/etc" -type f -print0 | sort -z)
|
||||||
|
}
|
||||||
|
|
||||||
|
# A desktop entry and a unit file take a quoted path; double quotes and
|
||||||
|
# backslashes inside it are escaped.
|
||||||
|
quoted() {
|
||||||
|
local path="${1//\\/\\\\}"
|
||||||
|
printf '"%s"' "${path//\"/\\\"}"
|
||||||
|
}
|
||||||
|
|
||||||
|
new_files=""
|
||||||
|
while IFS=$'\t' read -r rel target; do
|
||||||
|
mode=644
|
||||||
|
[[ "$rel" == bin/* ]] && mode=755
|
||||||
|
install -Dm"$mode" -- "$here/$rel" "$target"
|
||||||
|
case "$rel" in
|
||||||
|
share/applications/*.desktop | etc/xdg/autostart/*.desktop)
|
||||||
|
exe="$(sed -n 's/^Exec=\([^ ]*\).*/\1/p' "$target" | head -n1)"
|
||||||
|
sed -i "s|^Exec=$exe|Exec=$(quoted "$prefix/bin/$exe" | sed 's/[&|]/\\&/g')|" "$target"
|
||||||
|
;;
|
||||||
|
lib/systemd/user/*)
|
||||||
|
sed -i "s|^ExecStart=/usr/bin/pdfs|ExecStart=$(quoted "$prefix/bin/pdfs" | sed 's/[&|]/\\&/g')|" "$target"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
new_files+="$target"$'\n'
|
||||||
|
done < <(targets)
|
||||||
|
|
||||||
|
# Drop what an older version installed and this one does not.
|
||||||
|
remove_listed "$manifest" "$new_files"
|
||||||
|
mkdir -p -- "$data_dir"
|
||||||
|
printf '%s' "$new_files" >"$manifest"
|
||||||
|
install -m755 -- "$here/install.sh" "$data_dir/install.sh"
|
||||||
|
|
||||||
|
if command -v gtk-update-icon-cache >/dev/null &&
|
||||||
|
[[ -f "$prefix/share/icons/hicolor/index.theme" ]]; then
|
||||||
|
gtk-update-icon-cache -q -t "$prefix/share/icons/hicolor" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
systemctl_user daemon-reload
|
||||||
|
if [[ $service -eq 1 ]] && command -v systemctl >/dev/null &&
|
||||||
|
systemctl --user is-active -q "$unit" 2>/dev/null; then
|
||||||
|
systemctl --user restart "$unit" && say "Restarted the running service on the new version."
|
||||||
|
fi
|
||||||
|
|
||||||
|
say "Installed Proton Drive for Linux $("$prefix/bin/pdfs" --version 2>/dev/null | awk '{print $NF}') into $prefix."
|
||||||
|
say "Open \"Proton Drive for Linux\" from your applications menu and sign in; the app starts the service."
|
||||||
|
case ":$PATH:" in
|
||||||
|
*":$prefix/bin:"*) ;;
|
||||||
|
*) say "To use \`pdfs\` in a terminal, add $prefix/bin to your PATH." ;;
|
||||||
|
esac
|
||||||
|
say "To update, run install.sh from a newer tarball. To remove: $data_dir/install.sh --uninstall"
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Check a release tarball: install it into a throwaway home, check that every
|
||||||
|
# file landed with its paths rewritten and that the programs run, update it in
|
||||||
|
# place, then uninstall and check nothing is left. Touches no real home and no
|
||||||
|
# systemd (--no-service).
|
||||||
|
#
|
||||||
|
# usage: packaging/tarball/test.sh <tarball>
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "usage: $0 <tarball>" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
tarball="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||||
|
work="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$work"' EXIT
|
||||||
|
|
||||||
|
fail() { echo "FAIL: $*" >&2; exit 1; }
|
||||||
|
|
||||||
|
tar -xzf "$tarball" -C "$work"
|
||||||
|
src="$(find "$work" -mindepth 1 -maxdepth 1 -type d -name 'proton-drive-linux-*')"
|
||||||
|
[ -x "$src/install.sh" ] || fail "no install.sh in the tarball"
|
||||||
|
|
||||||
|
export HOME="$work/home" XDG_CONFIG_HOME="$work/home/.config"
|
||||||
|
mkdir -p "$HOME"
|
||||||
|
prefix="$HOME/.local"
|
||||||
|
"$src/install.sh" --no-service --force >"$work/install.log" 2>&1 ||
|
||||||
|
{ cat "$work/install.log" >&2; fail "install.sh failed"; }
|
||||||
|
|
||||||
|
for exe in pdfs pdfs-app pdfs-tray pdfs-prompt; do
|
||||||
|
[ -x "$prefix/bin/$exe" ] || fail "$exe was not installed"
|
||||||
|
done
|
||||||
|
"$prefix/bin/pdfs" --version >/dev/null || fail "pdfs does not run"
|
||||||
|
app="$prefix/share/applications/io.narl.proton-drive-linux.desktop"
|
||||||
|
tray="$XDG_CONFIG_HOME/autostart/io.narl.proton-drive-linux-tray.desktop"
|
||||||
|
unit="$XDG_CONFIG_HOME/systemd/user/proton-drive.service"
|
||||||
|
grep -qx "Exec=\"$prefix/bin/pdfs-app\"" "$app" || fail "the app's Exec= was not rewritten: $(grep ^Exec= "$app")"
|
||||||
|
grep -qx "Exec=\"$prefix/bin/pdfs-tray\"" "$tray" || fail "the tray's Exec= was not rewritten: $(grep ^Exec= "$tray")"
|
||||||
|
grep -qx "ExecStart=\"$prefix/bin/pdfs\" daemon" "$unit" || fail "ExecStart= was not rewritten: $(grep ^ExecStart= "$unit")"
|
||||||
|
[ -f "$prefix/share/locale/de/LC_MESSAGES/pdfs.mo" ] || fail "no translations"
|
||||||
|
[ -f "$prefix/share/icons/hicolor/scalable/apps/io.narl.proton-drive-linux.svg" ] || fail "no icon"
|
||||||
|
[ -f "$prefix/share/bash-completion/completions/pdfs" ] || fail "no bash completion"
|
||||||
|
[ ! -e "$prefix/share/proton-drive-linux/managed-updates" ] || fail "the update check must stay on offer"
|
||||||
|
uninstaller="$prefix/share/proton-drive-linux/install.sh"
|
||||||
|
[ -x "$uninstaller" ] || fail "install.sh was not kept for --uninstall"
|
||||||
|
|
||||||
|
# An update from the same tarball leaves the same files.
|
||||||
|
before="$(cd "$work/home" && find . -type f | sort)"
|
||||||
|
"$src/install.sh" --no-service --force >"$work/update.log" 2>&1 ||
|
||||||
|
{ cat "$work/update.log" >&2; fail "updating failed"; }
|
||||||
|
after="$(cd "$work/home" && find . -type f | sort)"
|
||||||
|
[ "$before" = "$after" ] || fail "an update changed the set of files: $(diff <(echo "$before") <(echo "$after"))"
|
||||||
|
|
||||||
|
# A file an older version installed and this one does not is removed.
|
||||||
|
stale="$prefix/share/locale/xx/LC_MESSAGES/pdfs.mo"
|
||||||
|
mkdir -p "$(dirname "$stale")" && : >"$stale"
|
||||||
|
echo "$stale" >>"$prefix/share/proton-drive-linux/installed-files"
|
||||||
|
"$src/install.sh" --no-service --force >/dev/null 2>&1
|
||||||
|
[ ! -e "$stale" ] || fail "a file the new version does not ship was left behind"
|
||||||
|
|
||||||
|
# Settings are not the installer's: uninstalling keeps them.
|
||||||
|
mkdir -p "$XDG_CONFIG_HOME/proton-drive-linux"
|
||||||
|
echo '{}' >"$XDG_CONFIG_HOME/proton-drive-linux/config.json"
|
||||||
|
"$uninstaller" --uninstall --no-service >"$work/uninstall.log" 2>&1 ||
|
||||||
|
{ cat "$work/uninstall.log" >&2; fail "uninstall failed"; }
|
||||||
|
left="$(cd "$work/home" && find . -type f | sort)"
|
||||||
|
[ "$left" = "./.config/proton-drive-linux/config.json" ] || fail "uninstall left files behind: $left"
|
||||||
|
|
||||||
|
echo "tarball OK: $(basename "$tarball")"
|
||||||
@@ -18,6 +18,7 @@ crates/pdfs-gui/src/app/pages/preferences_sync.rs
|
|||||||
crates/pdfs-gui/src/app/pages/shared.rs
|
crates/pdfs-gui/src/app/pages/shared.rs
|
||||||
crates/pdfs-gui/src/app/pages/shared_by_me.rs
|
crates/pdfs-gui/src/app/pages/shared_by_me.rs
|
||||||
crates/pdfs-gui/src/app/pages/status.rs
|
crates/pdfs-gui/src/app/pages/status.rs
|
||||||
|
crates/pdfs-gui/src/app/pages/sync_exclusions.rs
|
||||||
crates/pdfs-gui/src/app/pages/takeout.rs
|
crates/pdfs-gui/src/app/pages/takeout.rs
|
||||||
crates/pdfs-gui/src/app/pages/trash.rs
|
crates/pdfs-gui/src/app/pages/trash.rs
|
||||||
crates/pdfs-gui/src/app/pages/verify.rs
|
crates/pdfs-gui/src/app/pages/verify.rs
|
||||||
|
|||||||
@@ -0,0 +1,273 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""Render the vector branding into desktop, Android, iOS and Windows assets.
|
||||||
|
|
||||||
|
Kept identical across the suite; each checkout renders independently.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
from pathlib import Path
|
||||||
|
import re
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import tempfile
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
|
||||||
|
SVG = "{http://www.w3.org/2000/svg}"
|
||||||
|
ANDROID = "{http://schemas.android.com/apk/res/android}"
|
||||||
|
AAPT = "{http://schemas.android.com/aapt}"
|
||||||
|
ET.register_namespace("", SVG[1:-1])
|
||||||
|
ET.register_namespace("android", ANDROID[1:-1])
|
||||||
|
ET.register_namespace("aapt", AAPT[1:-1])
|
||||||
|
HEADER = '<?xml version="1.0" encoding="utf-8"?>\n'
|
||||||
|
GENERATED = '<!-- Generated by scripts/render-branding.py; edit images/logo.svg. -->\n'
|
||||||
|
ROOT = Path(__file__).resolve().parent.parent
|
||||||
|
BACKGROUND = "#F4F0FA"
|
||||||
|
|
||||||
|
|
||||||
|
def run(*args, data=None):
|
||||||
|
return subprocess.run(args, input=data, stdout=subprocess.PIPE, check=True).stdout
|
||||||
|
|
||||||
|
|
||||||
|
def render(svg, size, *, opaque=False):
|
||||||
|
png = run("rsvg-convert", "-w", str(size), data=svg.encode())
|
||||||
|
options = ["-background", BACKGROUND, "-alpha", "remove", "-alpha", "off"] if opaque else []
|
||||||
|
return run("magick", "-", *options, "-strip", "PNG:-", data=png)
|
||||||
|
|
||||||
|
|
||||||
|
def shape_path(node):
|
||||||
|
"""Use the same paths on Android, including rounded rectangles and circles."""
|
||||||
|
tag = node.tag.removeprefix(SVG)
|
||||||
|
a = node.attrib
|
||||||
|
if tag == "path":
|
||||||
|
return a["d"]
|
||||||
|
if tag == "circle":
|
||||||
|
x, y, r = (float(a[k]) for k in ("cx", "cy", "r"))
|
||||||
|
return f"M{x-r:g} {y:g}a{r:g} {r:g} 0 1 0 {2*r:g} 0a{r:g} {r:g} 0 1 0 {-2*r:g} 0Z"
|
||||||
|
if tag == "rect":
|
||||||
|
x, y = float(a.get("x", 0)), float(a.get("y", 0))
|
||||||
|
w, h = float(a["width"]), float(a["height"])
|
||||||
|
rx = min(float(a.get("rx", a.get("ry", 0))), w / 2)
|
||||||
|
ry = min(float(a.get("ry", a.get("rx", 0))), h / 2)
|
||||||
|
if not rx or not ry:
|
||||||
|
return f"M{x:g} {y:g}h{w:g}v{h:g}h{-w:g}Z"
|
||||||
|
return (f"M{x+rx:g} {y:g}H{x+w-rx:g}a{rx:g} {ry:g} 0 0 1 {rx:g} {ry:g}"
|
||||||
|
f"V{y+h-ry:g}a{rx:g} {ry:g} 0 0 1 {-rx:g} {ry:g}"
|
||||||
|
f"H{x+rx:g}a{rx:g} {ry:g} 0 0 1 {-rx:g} {-ry:g}"
|
||||||
|
f"V{y+ry:g}a{rx:g} {ry:g} 0 0 1 {rx:g} {-ry:g}Z")
|
||||||
|
raise ValueError(f"Unsupported SVG shape: {tag}")
|
||||||
|
|
||||||
|
|
||||||
|
def color(value):
|
||||||
|
if value == "none":
|
||||||
|
return "#00000000"
|
||||||
|
if re.fullmatch(r"#[0-9a-fA-F]{6}", value):
|
||||||
|
return "#FF" + value[1:]
|
||||||
|
raise ValueError(f"Unsupported SVG color: {value}")
|
||||||
|
|
||||||
|
|
||||||
|
def xml(element):
|
||||||
|
ET.indent(element, space=" ")
|
||||||
|
return HEADER + GENERATED + ET.tostring(element, encoding="unicode") + "\n"
|
||||||
|
|
||||||
|
|
||||||
|
class Artwork:
|
||||||
|
def __init__(self, master):
|
||||||
|
if master.attrib.get("viewBox") != "0 0 256 256":
|
||||||
|
raise ValueError("The master must use the 256-unit vector grid")
|
||||||
|
self.defs = master.find(f"{SVG}defs")
|
||||||
|
self.mark = master.find(f"{SVG}g[@id='mark']")
|
||||||
|
if self.defs is None or self.mark is None or not list(self.mark):
|
||||||
|
raise ValueError("The master needs defs and a nonempty mark group")
|
||||||
|
self.gradients = {g.attrib["id"]: g for g in self.defs.findall(f"{SVG}linearGradient")}
|
||||||
|
self.clips = {g.attrib["id"]: g for g in self.defs.findall(f"{SVG}clipPath")}
|
||||||
|
self.svg_defs = ET.tostring(self.defs, encoding="unicode")
|
||||||
|
self.svg_mark = ET.tostring(self.mark, encoding="unicode")
|
||||||
|
|
||||||
|
def paint(self, node, name, value):
|
||||||
|
if not value.startswith("url(#"):
|
||||||
|
node.set(ANDROID + name, color(value))
|
||||||
|
return
|
||||||
|
gradient = self.gradients[value[5:-1]]
|
||||||
|
if gradient.attrib.get("gradientUnits") != "userSpaceOnUse":
|
||||||
|
raise ValueError("Android gradients must use userSpaceOnUse")
|
||||||
|
attr = ET.SubElement(node, AAPT + "attr", {"name": "android:" + name})
|
||||||
|
out = ET.SubElement(attr, "gradient", {
|
||||||
|
ANDROID + "type": "linear",
|
||||||
|
**{ANDROID + dst: gradient.attrib[src] for src, dst in
|
||||||
|
(("x1", "startX"), ("y1", "startY"), ("x2", "endX"), ("y2", "endY"))},
|
||||||
|
})
|
||||||
|
for stop in gradient:
|
||||||
|
ET.SubElement(out, "item", {
|
||||||
|
ANDROID + "offset": stop.attrib.get("offset", "0"),
|
||||||
|
ANDROID + "color": color(stop.attrib["stop-color"]),
|
||||||
|
})
|
||||||
|
|
||||||
|
def android_node(self, source, parent, monochrome):
|
||||||
|
tag = source.tag.removeprefix(SVG)
|
||||||
|
a = source.attrib
|
||||||
|
if tag not in {"g", "path", "rect", "circle"}:
|
||||||
|
raise ValueError(f"Unsupported artwork element: {tag}")
|
||||||
|
supported = {"id", "transform", "clip-path"}
|
||||||
|
if tag != "g":
|
||||||
|
supported |= {"d", "x", "y", "width", "height", "rx", "ry", "cx", "cy", "r",
|
||||||
|
"fill", "fill-rule", "fill-opacity", "opacity", "stroke", "stroke-width",
|
||||||
|
"stroke-opacity", "stroke-linecap", "stroke-linejoin"}
|
||||||
|
if set(a) - supported:
|
||||||
|
raise ValueError(f"Unsupported {tag} attributes: {set(a) - supported}")
|
||||||
|
if "transform" in a:
|
||||||
|
match = re.fullmatch(r"translate\(\s*([-\d.]+)[ ,]+([-\d.]+)\s*\)", a["transform"])
|
||||||
|
if not match:
|
||||||
|
raise ValueError("Only explicit x/y translation is supported")
|
||||||
|
parent = ET.SubElement(parent, "group", {
|
||||||
|
ANDROID + "translateX": match[1], ANDROID + "translateY": match[2],
|
||||||
|
})
|
||||||
|
if "clip-path" in a:
|
||||||
|
clip = self.clips[a["clip-path"][5:-1]]
|
||||||
|
parent = ET.SubElement(parent, "group")
|
||||||
|
ET.SubElement(parent, "clip-path", {
|
||||||
|
ANDROID + "pathData": " ".join(shape_path(s) for s in clip),
|
||||||
|
})
|
||||||
|
if tag == "g":
|
||||||
|
for child in source:
|
||||||
|
self.android_node(child, parent, monochrome)
|
||||||
|
return
|
||||||
|
fill = a.get("fill", "#000000")
|
||||||
|
if monochrome and fill == "none":
|
||||||
|
return # Bevel highlights do not belong in the themed silhouette.
|
||||||
|
node = ET.SubElement(parent, "path", {
|
||||||
|
ANDROID + "pathData": shape_path(source),
|
||||||
|
ANDROID + "fillType": "evenOdd" if a.get("fill-rule") == "evenodd" else "nonZero",
|
||||||
|
})
|
||||||
|
self.paint(node, "fillColor", "#FFFFFF" if monochrome else fill)
|
||||||
|
if monochrome:
|
||||||
|
return
|
||||||
|
opacity = float(a.get("opacity", 1))
|
||||||
|
node.set(ANDROID + "fillAlpha", f'{opacity * float(a.get("fill-opacity", 1)):g}')
|
||||||
|
if "stroke" in a:
|
||||||
|
self.paint(node, "strokeColor", a["stroke"])
|
||||||
|
node.set(ANDROID + "strokeWidth", a.get("stroke-width", "1"))
|
||||||
|
node.set(ANDROID + "strokeAlpha", f'{opacity * float(a.get("stroke-opacity", 1)):g}')
|
||||||
|
for src, dst in (("stroke-linecap", "strokeLineCap"), ("stroke-linejoin", "strokeLineJoin")):
|
||||||
|
if src in a:
|
||||||
|
node.set(ANDROID + dst, a[src])
|
||||||
|
|
||||||
|
def vector(self, size=108, scale=.25, *, monochrome=False):
|
||||||
|
# The 256-unit canvas maps to 64dp; all painted corners stay inside
|
||||||
|
# the adaptive icon's central safe circle, including the copper rim.
|
||||||
|
root = ET.Element("vector", {
|
||||||
|
ANDROID + "width": f"{size}dp", ANDROID + "height": f"{size}dp",
|
||||||
|
ANDROID + "viewportWidth": str(size), ANDROID + "viewportHeight": str(size),
|
||||||
|
})
|
||||||
|
shift = size / 2 - 128 * scale
|
||||||
|
group = ET.SubElement(root, "group", {
|
||||||
|
ANDROID + "scaleX": str(scale), ANDROID + "scaleY": str(scale),
|
||||||
|
ANDROID + "translateX": str(shift), ANDROID + "translateY": str(shift),
|
||||||
|
})
|
||||||
|
self.android_node(self.mark, group, monochrome)
|
||||||
|
return xml(root).encode()
|
||||||
|
|
||||||
|
def ios(self):
|
||||||
|
return HEADER + GENERATED + f'''<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 256 256">
|
||||||
|
{self.svg_defs}
|
||||||
|
<rect width="256" height="256" fill="{BACKGROUND}"/>
|
||||||
|
{self.svg_mark}
|
||||||
|
</svg>
|
||||||
|
'''
|
||||||
|
|
||||||
|
def banner(self):
|
||||||
|
return HEADER + GENERATED + f'''<svg xmlns="http://www.w3.org/2000/svg" width="640" height="360" viewBox="0 0 320 180">
|
||||||
|
{self.svg_defs}
|
||||||
|
<rect width="320" height="180" fill="{BACKGROUND}"/>
|
||||||
|
<g transform="translate(8 24) scale(.5)">{self.svg_mark}</g>
|
||||||
|
<g fill="#35245D" font-family="DejaVu Sans">
|
||||||
|
<text x="140" y="82" font-size="22">Proton</text>
|
||||||
|
<text x="138" y="115" font-size="30" font-weight="bold">Stream</text>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
parser.add_argument("--check", action="store_true", help="Verify outputs without writing files")
|
||||||
|
args = parser.parse_args()
|
||||||
|
for command in ("rsvg-convert", "magick"):
|
||||||
|
if not shutil.which(command):
|
||||||
|
parser.error(f"{command} is required")
|
||||||
|
source = ROOT / "images/logo.svg"
|
||||||
|
master = ET.parse(source).getroot()
|
||||||
|
app = master.attrib["data-app"]
|
||||||
|
if app not in {"drive", "stream", "gallery"}:
|
||||||
|
parser.error("Unknown data-app in images/logo.svg")
|
||||||
|
art = Artwork(master)
|
||||||
|
desktop = source.read_bytes()
|
||||||
|
outputs = {}
|
||||||
|
if app in {"drive", "stream"}:
|
||||||
|
slug = "proton-drive-linux" if app == "drive" else "proton-stream"
|
||||||
|
outputs[f"packaging/io.narl.{slug}.svg"] = desktop
|
||||||
|
if app == "drive":
|
||||||
|
cover = ET.parse(ROOT / "images/cover.svg").getroot()
|
||||||
|
slot = cover.find(f"{SVG}g[@id='app-logo']")
|
||||||
|
if slot is None:
|
||||||
|
raise ValueError("The cover needs an app-logo group")
|
||||||
|
for child in list(slot):
|
||||||
|
slot.remove(child)
|
||||||
|
slot.append(ET.fromstring(art.svg_defs))
|
||||||
|
slot.append(ET.fromstring(art.svg_mark))
|
||||||
|
cover_svg = xml(cover)
|
||||||
|
outputs["images/cover.svg"] = cover_svg.encode()
|
||||||
|
outputs["images/cover.png"] = render(cover_svg, 1920)
|
||||||
|
if app in {"stream", "gallery"}:
|
||||||
|
res = "android/app/src/main/res/drawable/"
|
||||||
|
outputs[res + "ic_launcher_foreground.xml"] = art.vector()
|
||||||
|
outputs[res + "ic_launcher_monochrome.xml"] = art.vector(monochrome=True)
|
||||||
|
# A full-bleed neutral surface keeps the violet object legible under
|
||||||
|
# every launcher mask. The foreground retains its own copper depth.
|
||||||
|
background = ET.Element("vector", {
|
||||||
|
ANDROID + "width": "108dp", ANDROID + "height": "108dp",
|
||||||
|
ANDROID + "viewportWidth": "108", ANDROID + "viewportHeight": "108",
|
||||||
|
})
|
||||||
|
ET.SubElement(background, "path", {
|
||||||
|
ANDROID + "fillColor": color(BACKGROUND), ANDROID + "pathData": "M0 0H108V108H0Z",
|
||||||
|
})
|
||||||
|
outputs[res + "ic_launcher_background.xml"] = xml(background).encode()
|
||||||
|
if app == "gallery":
|
||||||
|
outputs["images/icon-512.png"] = render(desktop.decode(), 512)
|
||||||
|
outputs["android/app/src/main/res/drawable/ic_gallery.xml"] = art.vector(256, 1)
|
||||||
|
if app == "stream":
|
||||||
|
outputs["android/app/src/main/res/drawable/ic_notification_stream.xml"] = art.vector(24, 24/256, monochrome=True)
|
||||||
|
outputs["crates/pstr-app/assets/icon-256.png"] = render(desktop.decode(), 256)
|
||||||
|
ios = art.ios()
|
||||||
|
outputs["ios/ProtonStream/Resources/AppIcon.svg"] = ios.encode()
|
||||||
|
outputs["ios/ProtonStream/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon-1024.png"] = render(ios, 1024, opaque=True)
|
||||||
|
with tempfile.TemporaryDirectory(prefix="proton-icons-") as temp:
|
||||||
|
files = []
|
||||||
|
for size in (16, 24, 32, 48, 64, 128, 256):
|
||||||
|
path = Path(temp) / f"{size}.png"
|
||||||
|
path.write_bytes(render(desktop.decode(), size))
|
||||||
|
files.append(str(path))
|
||||||
|
outputs["packaging/windows/proton-stream.ico"] = run("magick", *files, "-strip", "ICO:-")
|
||||||
|
if not shutil.which("fc-match"):
|
||||||
|
parser.error("fontconfig is required to render the Android TV banner")
|
||||||
|
if "DejaVu Sans" not in run("fc-match", "-f", "%{family}", "DejaVu Sans").decode():
|
||||||
|
parser.error("DejaVu Sans is required to render the Android TV banner")
|
||||||
|
outputs["android/app/src/main/res/drawable-nodpi/tv_banner.png"] = render(art.banner(), 640, opaque=True)
|
||||||
|
stale = []
|
||||||
|
for relative, data in outputs.items():
|
||||||
|
target = ROOT / relative
|
||||||
|
if target.exists() and target.read_bytes() == data:
|
||||||
|
continue
|
||||||
|
if args.check:
|
||||||
|
stale.append(relative)
|
||||||
|
else:
|
||||||
|
target.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
target.write_bytes(data)
|
||||||
|
print(f"wrote {relative}")
|
||||||
|
if stale:
|
||||||
|
parser.exit(1, "Branding assets need regeneration:\n" + "\n".join(stale) + "\n")
|
||||||
|
print(f"{'Verified' if args.check else 'Rendered'} {len(outputs)} assets from images/logo.svg")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||