Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

Six launcher entries, and each app's window known to the desktop as its app

Yashwanth Kamireddic6d9d62ac96c
diff --git a/packaging/apps/dev.quince.client.Calendar.desktop b/packaging/apps/dev.quince.client.Calendar.desktop
new file mode 100644
index 0000000..cf19a35
--- /dev/null
+++ b/packaging/apps/dev.quince.client.Calendar.desktop
@@ -0,0 +1,15 @@
+# One of Pomander's six apps, on its own in the launcher. Its window says this file's name as
+# its app ID (src-tauri/src/apps.rs), so a dock shows it as this app. All six run in one
+# Pomander: one sign-in, one library.
+[Desktop Entry]
+Type=Application
+Name=Calendar
+GenericName=Calendar for iCloud
+Comment=Your iCloud calendars, on this computer
+Exec=pomander --app calendar
+Icon=dev.quince.client
+Terminal=false
+Categories=Office;
+Keywords=Pomander;iCloud;events;schedule;
+StartupNotify=true
+StartupWMClass=dev.quince.client.Calendar
diff --git a/packaging/apps/dev.quince.client.Contacts.desktop b/packaging/apps/dev.quince.client.Contacts.desktop
new file mode 100644
index 0000000..cdf9748
--- /dev/null
+++ b/packaging/apps/dev.quince.client.Contacts.desktop
@@ -0,0 +1,15 @@
+# One of Pomander's six apps, on its own in the launcher. Its window says this file's name as
+# its app ID (src-tauri/src/apps.rs), so a dock shows it as this app. All six run in one
+# Pomander: one sign-in, one library.
+[Desktop Entry]
+Type=Application
+Name=Contacts
+GenericName=Contacts for iCloud
+Comment=Your iCloud contacts, on this computer
+Exec=pomander --app contacts
+Icon=dev.quince.client
+Terminal=false
+Categories=Office;
+Keywords=Pomander;iCloud;people;address;
+StartupNotify=true
+StartupWMClass=dev.quince.client.Contacts
diff --git a/packaging/apps/dev.quince.client.Drive.desktop b/packaging/apps/dev.quince.client.Drive.desktop
new file mode 100644
index 0000000..4bb7ad9
--- /dev/null
+++ b/packaging/apps/dev.quince.client.Drive.desktop
@@ -0,0 +1,15 @@
+# One of Pomander's six apps, on its own in the launcher. Its window says this file's name as
+# its app ID (src-tauri/src/apps.rs), so a dock shows it as this app. All six run in one
+# Pomander: one sign-in, one library.
+[Desktop Entry]
+Type=Application
+Name=Drive
+GenericName=Drive for iCloud
+Comment=iCloud Drive, on this computer
+Exec=pomander --app drive
+Icon=dev.quince.client
+Terminal=false
+Categories=Office;
+Keywords=Pomander;iCloud;files;folders;documents;
+StartupNotify=true
+StartupWMClass=dev.quince.client.Drive
diff --git a/packaging/apps/dev.quince.client.Notes.desktop b/packaging/apps/dev.quince.client.Notes.desktop
new file mode 100644
index 0000000..de9faef
--- /dev/null
+++ b/packaging/apps/dev.quince.client.Notes.desktop
@@ -0,0 +1,15 @@
+# One of Pomander's six apps, on its own in the launcher. Its window says this file's name as
+# its app ID (src-tauri/src/apps.rs), so a dock shows it as this app. All six run in one
+# Pomander: one sign-in, one library.
+[Desktop Entry]
+Type=Application
+Name=Notes
+GenericName=Notes for iCloud
+Comment=Notes from iCloud, on this computer
+Exec=pomander --app notes
+Icon=dev.quince.client
+Terminal=false
+Categories=Office;
+Keywords=Pomander;iCloud;notes;memo;
+StartupNotify=true
+StartupWMClass=dev.quince.client.Notes
diff --git a/packaging/apps/dev.quince.client.Photos.desktop b/packaging/apps/dev.quince.client.Photos.desktop
new file mode 100644
index 0000000..fec2d7c
--- /dev/null
+++ b/packaging/apps/dev.quince.client.Photos.desktop
@@ -0,0 +1,15 @@
+# One of Pomander's six apps, on its own in the launcher. Its window says this file's name as
+# its app ID (src-tauri/src/apps.rs), so a dock shows it as this app. All six run in one
+# Pomander: one sign-in, one library.
+[Desktop Entry]
+Type=Application
+Name=Photos
+GenericName=Photos for iCloud
+Comment=iCloud Photos, on this computer
+Exec=pomander --app photos
+Icon=dev.quince.client
+Terminal=false
+Categories=Office;
+Keywords=Pomander;iCloud;pictures;images;gallery;
+StartupNotify=true
+StartupWMClass=dev.quince.client.Photos
diff --git a/packaging/apps/dev.quince.client.Reminders.desktop b/packaging/apps/dev.quince.client.Reminders.desktop
new file mode 100644
index 0000000..8afc6ef
--- /dev/null
+++ b/packaging/apps/dev.quince.client.Reminders.desktop
@@ -0,0 +1,15 @@
+# One of Pomander's six apps, on its own in the launcher. Its window says this file's name as
+# its app ID (src-tauri/src/apps.rs), so a dock shows it as this app. All six run in one
+# Pomander: one sign-in, one library.
+[Desktop Entry]
+Type=Application
+Name=Reminders
+GenericName=Reminders for iCloud
+Comment=Reminders from iCloud, on this computer
+Exec=pomander --app reminders
+Icon=dev.quince.client
+Terminal=false
+Categories=Office;
+Keywords=Pomander;iCloud;todo;tasks;lists;
+StartupNotify=true
+StartupWMClass=dev.quince.client.Reminders
diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD
index bfe2405..0cf4598 100644
--- a/packaging/arch/PKGBUILD
+++ b/packaging/arch/PKGBUILD
@@ -84,4 +84,8 @@ package() {
"$pkgdir/usr/share/applications/dev.quince.client.desktop"
install -Dm644 src-tauri/icons/icon.png \
"$pkgdir/usr/share/icons/hicolor/512x512/apps/dev.quince.client.png"
+ # The six apps, each its own launcher entry (pomander --app notes, …).
+ for entry in packaging/apps/*.desktop; do
+ install -Dm644 "$entry" "$pkgdir/usr/share/applications/$(basename "$entry")"
+ done
}
diff --git a/packaging/aur/PKGBUILD b/packaging/aur/PKGBUILD
index 47dbdbb..395a8f4 100644
--- a/packaging/aur/PKGBUILD
+++ b/packaging/aur/PKGBUILD
@@ -90,4 +90,8 @@ package() {
"$pkgdir/usr/share/applications/dev.quince.client.desktop"
install -Dm644 src-tauri/icons/icon.png \
"$pkgdir/usr/share/icons/hicolor/512x512/apps/dev.quince.client.png"
+ # The six apps, each its own launcher entry (pomander --app notes, …).
+ for entry in packaging/apps/*.desktop; do
+ install -Dm644 "$entry" "$pkgdir/usr/share/applications/$(basename "$entry")"
+ done
}
diff --git a/packaging/dev.quince.client.desktop.in b/packaging/dev.quince.client.desktop.in
index bdc0bdb..4ac08bc 100644
--- a/packaging/dev.quince.client.desktop.in
+++ b/packaging/dev.quince.client.desktop.in
@@ -13,3 +13,28 @@ Categories={{categories}}
Keywords=iCloud;calendar;reminders;notes;contacts;sync;
StartupNotify=true
StartupWMClass={{exec}}
+Actions=notes;reminders;calendar;contacts;drive;photos;
+
+[Desktop Action notes]
+Name=Notes
+Exec={{exec}} --app notes
+
+[Desktop Action reminders]
+Name=Reminders
+Exec={{exec}} --app reminders
+
+[Desktop Action calendar]
+Name=Calendar
+Exec={{exec}} --app calendar
+
+[Desktop Action contacts]
+Name=Contacts
+Exec={{exec}} --app contacts
+
+[Desktop Action drive]
+Name=Drive
+Exec={{exec}} --app drive
+
+[Desktop Action photos]
+Name=Photos
+Exec={{exec}} --app photos
diff --git a/src-tauri/src/apps.rs b/src-tauri/src/apps.rs
index 567ece6..7e0abf8 100644
--- a/src-tauri/src/apps.rs
+++ b/src-tauri/src/apps.rs
@@ -58,9 +58,8 @@ pub fn open(app: &AppHandle, key: &str) {
return;
};
if let Some(w) = app.get_webview_window(&label(key)) {
- w.show().ok();
w.unminimize().ok();
- w.set_focus().ok();
+ show(&w);
return;
}
let made = WebviewWindowBuilder::new(
@@ -84,16 +83,35 @@ pub fn open(app: &AppHandle, key: &str) {
if crate::tiling_compositor() {
window.set_decorations(false).ok();
}
+ // Shown by its window_ready once drawn; if that never comes (a page slow to load, a
+ // keyring that does not answer), shown anyway — never a launch that opens nothing.
+ let w = window.clone();
+ tauri::async_runtime::spawn(async move {
+ tokio::time::sleep(std::time::Duration::from_secs(3)).await;
+ if !w.is_visible().unwrap_or(true) {
+ show(&w);
+ }
+ });
+}
+
+/// An app's window put on screen, and — now that it is there — told its own app ID: GTK
+/// takes a window's app ID only once the window is shown (measured: set before, it was
+/// silently dropped and the window went on saying the program's name).
+pub fn show(window: &tauri::WebviewWindow) {
+ window.show().ok();
+ window.set_focus().ok();
#[cfg(target_os = "linux")]
- {
- let id = app_id(app, key);
+ if let Some(key) = window.label().strip_prefix("app-") {
+ let id = app_id(window.app_handle(), key);
let w = window.clone();
- app.run_on_main_thread(move || own_app_id(&w, &id)).ok();
+ window
+ .app_handle()
+ .run_on_main_thread(move || own_app_id(&w, &id))
+ .ok();
}
}
-/// On Wayland, the window says it is its app, not Pomander as a whole. Set before it is first
-/// shown, so a dock and the compositor's rules see it as that app from the start.
+/// On Wayland, the window says it is its app, not Pomander as a whole.
#[cfg(target_os = "linux")]
fn own_app_id(window: &tauri::WebviewWindow, id: &str) {
use glib::translate::ToGlibPtr;
@@ -107,7 +125,6 @@ fn own_app_id(window: &tauri::WebviewWindow, id: &str) {
let Ok(gtk_window) = window.gtk_window() else {
return;
};
- gtk_window.realize();
let Some(gdk_window) = gtk_window.window() else {
return;
};
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 8de1efc..6111495 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -4020,8 +4020,7 @@ pub(crate) fn tiling_compositor() -> bool {
fn window_ready(app: tauri::AppHandle, window: tauri::WebviewWindow, needs_you: Option<bool>) {
// An app's own window (Notes, Reminders…): shown once it has drawn.
if window.label() != "main" {
- window.show().ok();
- window.set_focus().ok();
+ apps::show(&window);
return;
}
// Opened as one app from its launcher entry: the whole-library window stays put away.
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index a84868d..882f8e5 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -61,7 +61,13 @@
],
"desktopTemplate": "../packaging/dev.quince.client.desktop.in",
"files": {
- "/usr/share/metainfo/dev.quince.client.metainfo.xml": "../packaging/dev.quince.client.metainfo.xml"
+ "/usr/share/metainfo/dev.quince.client.metainfo.xml": "../packaging/dev.quince.client.metainfo.xml",
+ "/usr/share/applications/dev.quince.client.Notes.desktop": "../packaging/apps/dev.quince.client.Notes.desktop",
+ "/usr/share/applications/dev.quince.client.Reminders.desktop": "../packaging/apps/dev.quince.client.Reminders.desktop",
+ "/usr/share/applications/dev.quince.client.Calendar.desktop": "../packaging/apps/dev.quince.client.Calendar.desktop",
+ "/usr/share/applications/dev.quince.client.Contacts.desktop": "../packaging/apps/dev.quince.client.Contacts.desktop",
+ "/usr/share/applications/dev.quince.client.Drive.desktop": "../packaging/apps/dev.quince.client.Drive.desktop",
+ "/usr/share/applications/dev.quince.client.Photos.desktop": "../packaging/apps/dev.quince.client.Photos.desktop"
}
},
"rpm": {
@@ -71,7 +77,13 @@
],
"desktopTemplate": "../packaging/dev.quince.client.desktop.in",
"files": {
- "/usr/share/metainfo/dev.quince.client.metainfo.xml": "../packaging/dev.quince.client.metainfo.xml"
+ "/usr/share/metainfo/dev.quince.client.metainfo.xml": "../packaging/dev.quince.client.metainfo.xml",
+ "/usr/share/applications/dev.quince.client.Notes.desktop": "../packaging/apps/dev.quince.client.Notes.desktop",
+ "/usr/share/applications/dev.quince.client.Reminders.desktop": "../packaging/apps/dev.quince.client.Reminders.desktop",
+ "/usr/share/applications/dev.quince.client.Calendar.desktop": "../packaging/apps/dev.quince.client.Calendar.desktop",
+ "/usr/share/applications/dev.quince.client.Contacts.desktop": "../packaging/apps/dev.quince.client.Contacts.desktop",
+ "/usr/share/applications/dev.quince.client.Drive.desktop": "../packaging/apps/dev.quince.client.Drive.desktop",
+ "/usr/share/applications/dev.quince.client.Photos.desktop": "../packaging/apps/dev.quince.client.Photos.desktop"
}
},
"appimage": {