Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

fix(linux): launch Claude Desktop through its entry only when it exists (#941)

Claudefef453eebb91
diff --git a/windows/README.md b/windows/README.md
index 2fca954d..c80217e9 100644
--- a/windows/README.md
+++ b/windows/README.md
@@ -523,7 +523,7 @@ Linux.
| Gemini CLI | `.gemini\settings.json` | asked in Gemini CLI |
| Antigravity | `.gemini\config\hooks.json` (a `coucou` hook group) | asked in Antigravity |
| Cursor Agent | `.cursor\hooks.json` — Claude Code in Cursor's terminal also goes on the Cursor pill, through the Claude Code hooks | asked in Cursor |
-| Claude Desktop (Windows) | nothing to install: Claude Code sessions from the Claude app are tagged by the relay | asked in the Claude app |
+| Claude Desktop | nothing to install: Claude Code sessions from the Claude app are tagged by the relay | asked in the Claude app |
| OpenCode | plugin `.config\opencode\plugins\coucou.js` | asked in OpenCode |
| Amp | plugin `.config\amp\plugins\coucou.ts` | asked in Amp |
| Hermes Agent | plugin `.hermes\plugins\coucou\` — then `hermes plugins enable coucou` once | asked in Hermes |
@@ -820,4 +820,5 @@ What changes on Linux:
app's native window forward (an XWayland one, such as VS Code's by default,
still can be). There, and for a session under tmux, screen or ssh, whose
terminal is no ancestor, the folder opens in VS Code as before.
-- No **Claude Desktop** pill: the Claude app has no Linux build.
+- The **Claude Desktop** pill opens Anthropic's Linux app (its `.deb`): through
+ its `claude-desktop.desktop` entry, else its binary, else the `claude://` link.
diff --git a/windows/src-tauri/src/lib.rs b/windows/src-tauri/src/lib.rs
index 8c216498..101f645d 100644
--- a/windows/src-tauri/src/lib.rs
+++ b/windows/src-tauri/src/lib.rs
@@ -339,8 +339,8 @@ fn open_session(session_id: Option<String>, path: Option<String>) -> bool {
}
}
-/// The Claude Desktop pill's target: the Claude app (Windows only — it has no
-/// Linux build).
+/// The Claude Desktop pill's target: the Claude app (Windows, and Linux with
+/// Anthropic's .deb).
#[tauri::command]
fn open_claude_desktop() -> bool {
platform::open_claude_desktop()
diff --git a/windows/src-tauri/src/platform/linux.rs b/windows/src-tauri/src/platform/linux.rs
index 8380f6aa..4366b3a6 100644
--- a/windows/src-tauri/src/platform/linux.rs
+++ b/windows/src-tauri/src/platform/linux.rs
@@ -273,7 +273,12 @@ pub fn find_on_path(stem: &str) -> Option<PathBuf> {
/// directly by executable, or via its registered claude:// scheme handler.
pub fn open_claude_desktop() -> bool {
open_claude_with(
- || Command::new("gtk-launch").arg("claude-desktop").spawn().is_ok(),
+ || {
+ // gtk-launch itself starts fine whether the entry exists or not:
+ // look for the entry first, or the fallbacks below never run.
+ desktop_entry_exists("claude-desktop.desktop")
+ && no_console(Command::new("gtk-launch").arg("claude-desktop")).spawn().is_ok()
+ },
|| {
let candidates = [
find_on_path("claude-desktop"),
@@ -283,16 +288,26 @@ pub fn open_claude_desktop() -> bool {
Some(home_dir().join(".local/bin/claude-desktop")),
];
for path in candidates.into_iter().flatten() {
- if path.is_file() && Command::new(path).spawn().is_ok() {
+ if path.is_file() && no_console(&mut Command::new(path)).spawn().is_ok() {
return true;
}
}
false
},
- || Command::new("xdg-open").arg("claude://").spawn().is_ok(),
+ || no_console(Command::new("xdg-open").arg("claude://")).spawn().is_ok(),
)
}
+/// A desktop entry with this file name in the system's or the user's
+/// applications folders (XDG_DATA_HOME, then XDG_DATA_DIRS).
+fn desktop_entry_exists(file: &str) -> bool {
+ let dirs = std::env::var("XDG_DATA_DIRS").unwrap_or_default();
+ let system = if dirs.trim().is_empty() { "/usr/local/share:/usr/share".to_string() } else { dirs };
+ std::iter::once(xdg("XDG_DATA_HOME", ".local/share"))
+ .chain(std::env::split_paths(&system))
+ .any(|dir| dir.join("applications").join(file).is_file())
+}
+
fn open_claude_with(
desktop: impl FnOnce() -> bool,
binary: impl FnOnce() -> bool,