Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: add custom notes folder path for Obsidian sync

Louis Beaumontc4526a752fce
diff --git a/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx b/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx
index 52e20d034..7d39a19af 100644
--- a/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx
+++ b/screenpipe-app-tauri/components/settings/obsidian-sync-card.tsx
@@ -117,6 +117,7 @@ import { useToast } from "@/components/ui/use-toast";
interface ObsidianSyncSettings {
enabled: boolean;
vaultPath: string;
+ notesPath: string; // Subfolder within vault for notes (e.g., "screenpipe/logs" or "daily/activity")
syncIntervalMinutes: number;
customPrompt: string;
lastSyncTime: string | null;
@@ -133,6 +134,7 @@ interface ObsidianSyncStatus {
const DEFAULT_SETTINGS: ObsidianSyncSettings = {
enabled: false,
vaultPath: "",
+ notesPath: "screenpipe/logs", // Default subfolder
syncIntervalMinutes: 0, // 0 = manual only
customPrompt: "",
lastSyncTime: null,
@@ -516,6 +518,25 @@ export function ObsidianSyncCard() {
)}
</div>
+ {/* Notes Folder Path */}
+ <div className="space-y-2">
+ <Label htmlFor="notes-path" className="flex items-center gap-2">
+ <FolderOpen className="h-4 w-4" />
+ Notes folder (within vault)
+ </Label>
+ <Input
+ id="notes-path"
+ value={settings.notesPath}
+ onChange={(e) =>
+ setSettings((s) => ({ ...s, notesPath: e.target.value }))
+ }
+ placeholder="screenpipe/logs"
+ />
+ <p className="text-xs text-muted-foreground">
+ Subfolder where daily notes will be created (e.g., &quot;daily/screenpipe&quot; or &quot;journals/activity&quot;)
+ </p>
+ </div>
+
{/* Sync Hours */}
<div className="space-y-2">
<Label className="flex items-center gap-2">
diff --git a/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs b/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs
index 356ca5600..b5936db73 100644
--- a/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs
+++ b/screenpipe-app-tauri/src-tauri/src/obsidian_sync.rs
@@ -21,6 +21,9 @@ pub struct ObsidianSyncSettings {
pub enabled: bool,
/// Path to the Obsidian vault
pub vault_path: String,
+ /// Subfolder within vault for notes (e.g., "screenpipe/logs" or "daily/activity")
+ #[serde(default = "default_notes_path")]
+ pub notes_path: String,
/// Sync interval in minutes (0 = manual only)
pub sync_interval_minutes: u32,
/// Custom user prompt to append to system prompt
@@ -31,6 +34,10 @@ pub struct ObsidianSyncSettings {
pub sync_hours: u32,
}
+fn default_notes_path() -> String {
+ "screenpipe/logs".to_string()
+}
+
/// Status of an ongoing or completed sync
#[derive(Debug, Clone, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
@@ -154,15 +161,21 @@ Create/append to the daily log file using this markdown table format:
- Query in chunks to avoid context overflow
- Use curl to fetch data from the API
- Write files using the write tool
-- Create the screenpipe/logs/ subfolder structure
+- Create the subfolder structure if it doesn't exist
"#;
/// Build the full prompt for opencode
fn build_prompt(settings: &ObsidianSyncSettings, start_time: &str, end_time: &str) -> String {
let today = chrono::Utc::now().format("%Y-%m-%d").to_string();
+ let notes_path = if settings.notes_path.is_empty() {
+ "screenpipe/logs".to_string()
+ } else {
+ settings.notes_path.trim_matches('/').to_string()
+ };
let note_path = format!(
- "{}/screenpipe/logs/{}.md",
+ "{}/{}/{}.md",
settings.vault_path.trim_end_matches('/'),
+ notes_path,
today
);