Windows tray app for bookmarking folders with quick-action buttons (Explorer, Terminal, Claude, Visual Studio, Redeploy). Features: - Tabs containing columns of bookmarks - Per-row launcher buttons configurable from a header settings panel - Optional auto-start on Windows login - In-app confirm dialogs for destructive actions - Dark theme, frameless tray-anchored popup, pinnable
325 lines
10 KiB
JavaScript
325 lines
10 KiB
JavaScript
const { shell, clipboard, dialog } = require('electron');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const { spawn } = require('child_process');
|
|
|
|
function ensureExists(targetPath) {
|
|
try {
|
|
fs.accessSync(targetPath);
|
|
return { ok: true };
|
|
} catch {
|
|
return { ok: false, error: `Path not found:\n${targetPath}` };
|
|
}
|
|
}
|
|
|
|
function ensureWindows() {
|
|
if (process.platform !== 'win32') {
|
|
return { ok: false, error: 'Windows only.' };
|
|
}
|
|
return { ok: true };
|
|
}
|
|
|
|
async function openInExplorer(targetPath) {
|
|
const exists = ensureExists(targetPath);
|
|
if (!exists.ok) return exists;
|
|
const result = await shell.openPath(targetPath);
|
|
if (result) return { ok: false, error: result };
|
|
return { ok: true };
|
|
}
|
|
|
|
// Reasonable cap for the alias used as a wt --title argument and as a
|
|
// search pattern. Strips control + reserved chars that would break wt's
|
|
// command parser (it splits on `;`).
|
|
function sanitizeTitle(s) {
|
|
if (!s) return '';
|
|
return String(s).replace(/[ |