Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

feat: add step-by-step guides for Wayland paste setup

Alcahest1352abfd6fbf
diff --git a/resources/linux/after-install.sh b/resources/linux/after-install.sh
index cc6ae1398..a4131f9b3 100755
--- a/resources/linux/after-install.sh
+++ b/resources/linux/after-install.sh
@@ -5,7 +5,7 @@
set -euo pipefail
UDEV_RULE='KERNEL=="uinput", GROUP="input", MODE="0660", TAG+="uaccess"'
-UDEV_RULE_PATH="/etc/udev/rules.d/80-uinput.rules"
+UDEV_RULE_PATH="/etc/udev/rules.d/70-uinput.rules"
SERVICE_PATH="/usr/lib/systemd/user/ydotoold.service"
# Detect the real user (not root) who triggered the install
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 0204f694f..7a6f27a74 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -26,6 +26,8 @@ import {
CircleCheck,
CircleX,
RotateCw,
+ BookOpen,
+ Copy,
} from "lucide-react";
import { useAuth } from "../hooks/useAuth";
import { NEON_AUTH_URL, signOut } from "../lib/neonAuth";
@@ -34,7 +36,15 @@ import MicrophoneSettings from "./ui/MicrophoneSettings";
import PermissionCard from "./ui/PermissionCard";
import PasteToolsInfo from "./ui/PasteToolsInfo";
import TranscriptionModelPicker from "./TranscriptionModelPicker";
-import { ConfirmDialog, AlertDialog } from "./ui/dialog";
+import {
+ ConfirmDialog,
+ AlertDialog,
+ Dialog,
+ DialogContent,
+ DialogHeader,
+ DialogTitle,
+ DialogDescription,
+} from "./ui/dialog";
import { Alert, AlertTitle, AlertDescription } from "./ui/alert";
import { useSettings } from "../hooks/useSettings";
import { useDialogs } from "../hooks/useDialogs";
@@ -765,9 +775,11 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
daemonRunning: boolean;
hasService: boolean;
hasUinput: boolean;
+ hasUdevRule: boolean;
hasGroup: boolean;
allGood: boolean;
} | null>(null);
+ const [ydotoolGuideKey, setYdotoolGuideKey] = useState<string | null>(null);
const refreshYdotoolStatus = useCallback(async () => {
try {
@@ -1956,90 +1968,336 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
"Auto-paste on Wayland requires ydotool. Check the status of each component below.",
})}
/>
- <SettingsPanel>
- {(
- [
- {
- key: "hasYdotool",
- label: "ydotool",
- ok: ydotoolStatus.hasYdotool,
- fix: t("settingsPage.general.waylandPaste.installYdotool", {
- defaultValue:
- "Install with your package manager (apt install ydotool / dnf install ydotool)",
- }),
- },
- {
- key: "hasYdotoold",
- label: "ydotoold",
- ok: ydotoolStatus.hasYdotoold,
- fix: t("settingsPage.general.waylandPaste.installYdotoold", {
- defaultValue:
- "On Ubuntu/Pop!_OS: sudo apt install ydotoold (included in ydotool on Fedora/Arch)",
- }),
- },
- {
- key: "hasUinput",
- label: "/dev/uinput",
- ok: ydotoolStatus.hasUinput,
- fix: t("settingsPage.general.waylandPaste.uinputRule", {
- defaultValue:
- 'Run: echo \'KERNEL=="uinput", GROUP="input", MODE="0660", TAG+="uaccess"\' | sudo tee /etc/udev/rules.d/80-uinput.rules && sudo udevadm control --reload-rules && sudo udevadm trigger /dev/uinput',
- }),
- },
- {
- key: "hasGroup",
- label: t("settingsPage.general.waylandPaste.inputGroup", {
- defaultValue: "input group",
- }),
- ok: ydotoolStatus.hasGroup,
- fix: t("settingsPage.general.waylandPaste.addToGroup", {
- defaultValue:
- "Run: sudo usermod -aG input $USER (logout/login required)",
- }),
- },
- {
- key: "daemonRunning",
- label: t("settingsPage.general.waylandPaste.daemon", {
- defaultValue: "ydotoold daemon",
- }),
- ok: ydotoolStatus.daemonRunning,
- fix: t("settingsPage.general.waylandPaste.startDaemon", {
- defaultValue:
- "Run: systemctl --user enable ydotoold && systemctl --user start ydotoold",
- }),
- },
- ] as const
- ).map((item) => (
- <SettingsPanelRow key={item.key}>
- <div className="flex items-start gap-2">
- {item.ok ? (
- <CircleCheck className="w-4 h-4 text-green-500 mt-0.5 shrink-0" />
- ) : (
- <CircleX className="w-4 h-4 text-red-500 mt-0.5 shrink-0" />
- )}
- <div className="min-w-0">
- <p className="text-sm font-medium">{item.label}</p>
- {!item.ok && (
- <p className="text-xs text-muted-foreground mt-0.5 break-all">
- {item.fix}
- </p>
- )}
+ {(() => {
+ const checks = [
+ {
+ key: "hasYdotool",
+ label: "ydotool",
+ ok: ydotoolStatus.hasYdotool,
+ desc: t("settingsPage.general.waylandPaste.ydotoolDesc", {
+ defaultValue: "Input automation tool for Wayland",
+ }),
+ steps: [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.ydotool.step1Title", {
+ defaultValue: "Install ydotool",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.ydotool.step1Desc", {
+ defaultValue: "Use your distribution's package manager to install ydotool.",
+ }),
+ cmds: [
+ { label: "Ubuntu / Pop!_OS / Debian", cmd: "sudo apt install ydotool" },
+ { label: "Fedora", cmd: "sudo dnf install ydotool" },
+ { label: "openSUSE", cmd: "sudo zypper install ydotool" },
+ ],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.ydotool.step2Title", {
+ defaultValue: "Verify installation",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.ydotool.step2Desc", {
+ defaultValue: "Check that ydotool is available in your PATH.",
+ }),
+ cmds: [{ cmd: "which ydotool" }],
+ },
+ ],
+ },
+ {
+ key: "hasYdotoold",
+ label: "ydotoold",
+ ok: ydotoolStatus.hasYdotoold,
+ desc: t("settingsPage.general.waylandPaste.ydotooldDesc", {
+ defaultValue: "Daemon for ydotool (separate package on Ubuntu/Pop!_OS)",
+ }),
+ steps: [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.ydotoold.step1Title", {
+ defaultValue: "Install ydotoold",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.ydotoold.step1Desc", {
+ defaultValue: "On Ubuntu and Pop!_OS, ydotoold is a separate package. On Fedora, it's included with ydotool.",
+ }),
+ cmds: [
+ { label: "Ubuntu / Pop!_OS / Debian", cmd: "sudo apt install ydotoold" },
+ { label: "Fedora", cmd: "# Already included in the ydotool package" },
+ ],
+ },
+ ],
+ },
+ {
+ key: "hasUinput",
+ label: "/dev/uinput",
+ ok: ydotoolStatus.hasUinput,
+ desc: t("settingsPage.general.waylandPaste.uinputDesc", {
+ defaultValue: "Kernel input device access",
+ }),
+ note: !ydotoolStatus.hasUinput
+ ? ydotoolStatus.hasUdevRule
+ ? t("settingsPage.general.waylandPaste.uinputRuleFound", {
+ defaultValue: "Rule present but not active. A reboot should fix it.",
+ })
+ : t("settingsPage.general.waylandPaste.uinputRuleMissing", {
+ defaultValue: "no udev rule found",
+ })
+ : undefined,
+ steps: ydotoolStatus.hasUdevRule && !ydotoolStatus.hasUinput
+ ? [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.uinput.ruleFoundTitle", {
+ defaultValue: "udev rule already configured",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.uinput.ruleFoundDesc", {
+ defaultValue: "The udev rule for /dev/uinput is already on your system but hasn't taken effect. Try reloading:",
+ }),
+ cmds: [{ cmd: "sudo udevadm control --reload-rules && sudo udevadm trigger /dev/uinput" }],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.uinput.rebootTitle", {
+ defaultValue: "If reloading didn't help, reboot",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.uinput.rebootDesc", {
+ defaultValue: "On some distros, udev changes only apply after a full reboot. Restart your computer and come back to re-check.",
+ }),
+ },
+ ]
+ : [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.uinput.step1Title", {
+ defaultValue: "Create a udev rule",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.uinput.step1Desc", {
+ defaultValue: "This rule grants access to /dev/uinput for users in the input group.",
+ }),
+ cmds: [{ cmd: 'echo \'KERNEL=="uinput", GROUP="input", MODE="0660", TAG+="uaccess"\' | sudo tee /etc/udev/rules.d/70-uinput.rules' }],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.uinput.step2Title", {
+ defaultValue: "Reload udev rules",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.uinput.step2Desc", {
+ defaultValue: "Apply the new rule without rebooting.",
+ }),
+ cmds: [{ cmd: "sudo udevadm control --reload-rules && sudo udevadm trigger /dev/uinput" }],
+ },
+ ],
+ },
+ {
+ key: "hasGroup",
+ label: t("settingsPage.general.waylandPaste.inputGroup", {
+ defaultValue: "input group",
+ }),
+ ok: ydotoolStatus.hasGroup,
+ desc: t("settingsPage.general.waylandPaste.inputGroupDesc", {
+ defaultValue: "User must be in the input group (requires re-login)",
+ }),
+ steps: [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.group.step1Title", {
+ defaultValue: "Add your user to the input group",
+ }),
+ cmds: [{ cmd: "sudo usermod -aG input $USER" }],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.group.step2Title", {
+ defaultValue: "Log out and back in",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.group.step2Desc", {
+ defaultValue: "Group changes only take effect after a new login session. Log out of your desktop and log back in, then reopen OpenWhispr.",
+ }),
+ },
+ ],
+ },
+ {
+ key: "hasService",
+ label: t("settingsPage.general.waylandPaste.service", {
+ defaultValue: "systemd service",
+ }),
+ ok: ydotoolStatus.hasService,
+ desc: t("settingsPage.general.waylandPaste.serviceDesc", {
+ defaultValue: "User service file for auto-starting ydotoold",
+ }),
+ steps: [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.service.step1Title", {
+ defaultValue: "Create the service directory",
+ }),
+ cmds: [{ cmd: "mkdir -p ~/.config/systemd/user" }],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.service.step2Title", {
+ defaultValue: "Create the service file",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.service.step2Desc", {
+ defaultValue: "This creates a user-level systemd service that starts ydotoold automatically when you log in.",
+ }),
+ cmds: [{
+ cmd: `cat > ~/.config/systemd/user/ydotoold.service << 'EOF'
+[Unit]
+Description=ydotoold - ydotool daemon
+After=graphical-session.target
+PartOf=graphical-session.target
+
+[Service]
+ExecStart=/usr/bin/ydotoold
+Restart=on-failure
+RestartSec=1s
+
+[Install]
+WantedBy=graphical-session.target
+EOF`,
+ }],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.service.step3Title", {
+ defaultValue: "Reload and enable",
+ }),
+ cmds: [{ cmd: "systemctl --user daemon-reload && systemctl --user enable ydotoold" }],
+ },
+ ],
+ },
+ {
+ key: "daemonRunning",
+ label: t("settingsPage.general.waylandPaste.daemon", {
+ defaultValue: "ydotoold daemon",
+ }),
+ ok: ydotoolStatus.daemonRunning,
+ desc: t("settingsPage.general.waylandPaste.daemonDesc", {
+ defaultValue: "Background service must be running",
+ }),
+ steps: [
+ {
+ title: t("settingsPage.general.waylandPaste.guide.daemon.step1Title", {
+ defaultValue: "Start the daemon",
+ }),
+ desc: t("settingsPage.general.waylandPaste.guide.daemon.step1Desc", {
+ defaultValue: "Start ydotoold and enable it so it runs on every login.",
+ }),
+ cmds: [{ cmd: "systemctl --user enable ydotoold && systemctl --user start ydotoold" }],
+ },
+ {
+ title: t("settingsPage.general.waylandPaste.guide.daemon.step2Title", {
+ defaultValue: "Verify it's running",
+ }),
+ cmds: [{ cmd: "systemctl --user status ydotoold" }],
+ },
+ ],
+ },
+ ];
+
+ const activeGuide = checks.find((c) => c.key === ydotoolGuideKey);
+
+ return (
+ <>
+ <div className="rounded-xl border border-border overflow-hidden">
+ <div className="divide-y divide-border">
+ {checks.map((item) => (
+ <div key={item.key} className="px-4 py-3">
+ <div className="flex items-center gap-2.5">
+ {item.ok ? (
+ <CircleCheck className="h-4 w-4 shrink-0 text-emerald-500" />
+ ) : (
+ <CircleX className="h-4 w-4 shrink-0 text-red-500" />
+ )}
+ <div className="flex-1 min-w-0">
+ <span className="text-sm font-medium">{item.label}</span>
+ <span className="text-xs text-muted-foreground ml-2">{item.desc}</span>
+ {item.note && (
+ <p className="text-[11px] text-amber-600 dark:text-amber-400 mt-0.5 ml-0">{item.note}</p>
+ )}
+ </div>
+ {!item.ok && (
+ <button
+ onClick={() => setYdotoolGuideKey(item.key)}
+ className="shrink-0 flex items-center gap-1 text-xs px-2.5 py-1 rounded-md border border-border hover:bg-muted transition-colors text-foreground"
+ >
+ <BookOpen className="w-3 h-3" />
+ {t("settingsPage.general.waylandPaste.guide.open", {
+ defaultValue: "Guide",
+ })}
+ </button>
+ )}
+ </div>
+ </div>
+ ))}
</div>
+ {checks.every((c) => c.ok) && (
+ <div className="px-4 py-2.5 bg-emerald-50 dark:bg-emerald-950/30 text-emerald-700 dark:text-emerald-300 text-xs">
+ {t("settingsPage.general.waylandPaste.allGoodDesc", {
+ defaultValue: "ydotool is fully configured. Auto-paste should work correctly.",
+ })}
+ </div>
+ )}
</div>
- </SettingsPanelRow>
- ))}
- <SettingsPanelRow>
- <button
- onClick={refreshYdotoolStatus}
- className="flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors"
- >
- <RotateCw className="w-3 h-3" />
- {t("settingsPage.general.waylandPaste.recheck", {
- defaultValue: "Re-check",
- })}
- </button>
- </SettingsPanelRow>
- </SettingsPanel>
+
+ <button
+ onClick={refreshYdotoolStatus}
+ className="flex items-center gap-1.5 mt-3 text-xs text-muted-foreground hover:text-foreground transition-colors"
+ >
+ <RotateCw className="w-3 h-3" />
+ {t("settingsPage.general.waylandPaste.recheck", {
+ defaultValue: "Re-check",
+ })}
+ </button>
+
+ {/* Step-by-step guide dialog */}
+ <Dialog open={!!activeGuide} onOpenChange={(open) => !open && setYdotoolGuideKey(null)}>
+ <DialogContent className="sm:max-w-lg max-h-[80vh] overflow-y-auto">
+ {activeGuide && (
+ <>
+ <DialogHeader>
+ <DialogTitle className="flex items-center gap-2">
+ <BookOpen className="w-4 h-4" />
+ {activeGuide.label}
+ </DialogTitle>
+ <DialogDescription>{activeGuide.desc}</DialogDescription>
+ </DialogHeader>
+ <div className="space-y-5 mt-2">
+ {activeGuide.steps.map((step, i) => (
+ <div key={i}>
+ <div className="flex items-start gap-3">
+ <span className="shrink-0 w-6 h-6 rounded-full bg-primary text-primary-foreground flex items-center justify-center text-xs font-semibold">
+ {i + 1}
+ </span>
+ <div className="flex-1 min-w-0">
+ <p className="text-sm font-medium">{step.title}</p>
+ {step.desc && (
+ <p className="text-xs text-muted-foreground mt-0.5">{step.desc}</p>
+ )}
+ {step.cmds && step.cmds.length > 0 && (
+ <div className="mt-2 space-y-2">
+ {step.cmds.map((c, j) => (
+ <div key={j}>
+ {c.label && (
+ <p className="text-[11px] text-muted-foreground mb-1">{c.label}</p>
+ )}
+ <div className="flex items-start gap-1.5">
+ <pre className="flex-1 text-[11px] bg-muted/60 rounded-md px-3 py-2 font-mono whitespace-pre-wrap break-all select-all overflow-x-auto">
+ {c.cmd}
+ </pre>
+ <button
+ onClick={() => navigator.clipboard.writeText(c.cmd)}
+ className="shrink-0 p-1.5 rounded-md hover:bg-muted transition-colors text-muted-foreground hover:text-foreground"
+ title={t("settingsPage.general.waylandPaste.copy", { defaultValue: "Copy" })}
+ >
+ <Copy className="w-3.5 h-3.5" />
+ </button>
+ </div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ </>
+ )}
+ </DialogContent>
+ </Dialog>
+ </>
+ );
+ })()}
</div>
)}
</div>
diff --git a/src/components/ui/alert.tsx b/src/components/ui/alert.tsx
index 69a1e9016..135eaf53f 100644
--- a/src/components/ui/alert.tsx
+++ b/src/components/ui/alert.tsx
@@ -8,10 +8,10 @@ const alertVariants = cva(
{
variants: {
variant: {
- default: "bg-neutral-50 border-neutral-200 text-neutral-900 [&>svg]:text-neutral-600",
- destructive: "bg-red-50 border-red-200 text-red-900 [&>svg]:text-red-600",
- success: "bg-emerald-50 border-emerald-200 text-emerald-900 [&>svg]:text-emerald-600",
- warning: "bg-amber-50 border-amber-200 text-amber-900 [&>svg]:text-amber-600",
+ default: "bg-neutral-50 border-neutral-200 text-neutral-900 [&>svg]:text-neutral-600 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-100 dark:[&>svg]:text-neutral-400",
+ destructive: "bg-red-50 border-red-200 text-red-900 [&>svg]:text-red-600 dark:bg-red-950/40 dark:border-red-800 dark:text-red-100 dark:[&>svg]:text-red-400",
+ success: "bg-emerald-50 border-emerald-200 text-emerald-900 [&>svg]:text-emerald-600 dark:bg-emerald-950/40 dark:border-emerald-800 dark:text-emerald-100 dark:[&>svg]:text-emerald-400",
+ warning: "bg-amber-50 border-amber-200 text-amber-900 [&>svg]:text-amber-600 dark:bg-amber-950/40 dark:border-amber-800 dark:text-amber-100 dark:[&>svg]:text-amber-400",
},
},
defaultVariants: {
diff --git a/src/helpers/ensureYdotool.js b/src/helpers/ensureYdotool.js
index cdaead485..e238343d5 100644
--- a/src/helpers/ensureYdotool.js
+++ b/src/helpers/ensureYdotool.js
@@ -57,6 +57,27 @@ function isUinputAccessible() {
}
}
+function udevRuleExists() {
+ const ruleDirs = [
+ "/etc/udev/rules.d",
+ "/usr/lib/udev/rules.d",
+ "/lib/udev/rules.d",
+ ];
+ for (const dir of ruleDirs) {
+ try {
+ const files = fs.readdirSync(dir);
+ for (const file of files) {
+ if (!file.endsWith(".rules")) continue;
+ try {
+ const content = fs.readFileSync(`${dir}/${file}`, "utf-8");
+ if (content.includes("uinput")) return true;
+ } catch {}
+ }
+ } catch {}
+ }
+ return false;
+}
+
function userInInputGroup() {
try {
const result = spawnSync("groups", [], { stdio: "pipe", timeout: 5000 });
@@ -124,7 +145,7 @@ async function ensureYdotool() {
}
if (!hasUinput) {
missing.push(
- '- /dev/uinput is not accessible. Add a udev rule:\n echo \'KERNEL=="uinput", GROUP="input", MODE="0660", TAG+="uaccess"\' | sudo tee /etc/udev/rules.d/80-uinput.rules\n sudo udevadm control --reload-rules && sudo udevadm trigger /dev/uinput'
+ '- /dev/uinput is not accessible. Add a udev rule:\n echo \'KERNEL=="uinput", GROUP="input", MODE="0660", TAG+="uaccess"\' | sudo tee /etc/udev/rules.d/70-uinput.rules\n sudo udevadm control --reload-rules && sudo udevadm trigger /dev/uinput'
);
}
if (!hasGroup) {
@@ -162,6 +183,7 @@ function getYdotoolStatus() {
const daemonRunning = isYdotooldRunning();
const hasService = serviceFileExists();
const hasUinput = isUinputAccessible();
+ const hasUdevRule = udevRuleExists();
const hasGroup = userInInputGroup();
const isWayland =
(process.env.XDG_SESSION_TYPE || "").toLowerCase() === "wayland" ||
@@ -175,6 +197,7 @@ function getYdotoolStatus() {
daemonRunning,
hasService,
hasUinput,
+ hasUdevRule,
hasGroup,
allGood: hasYdotool && hasYdotoold && daemonRunning && hasUinput && hasGroup,
};
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 1dc2828a1..3c757fa72 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -625,6 +625,20 @@ declare global {
) => Promise<{ success: boolean }>;
getHotkeyModeInfo?: () => Promise<{ isUsingGnome: boolean }>;
+ // Wayland paste diagnostics
+ getYdotoolStatus?: () => Promise<{
+ isLinux: boolean;
+ isWayland: boolean;
+ hasYdotool: boolean;
+ hasYdotoold: boolean;
+ daemonRunning: boolean;
+ hasService: boolean;
+ hasUinput: boolean;
+ hasUdevRule: boolean;
+ hasGroup: boolean;
+ allGood: boolean;
+ }>;
+
// Globe key listener for hotkey capture (macOS only)
onGlobeKeyPressed?: (callback: () => void) => () => void;
onGlobeKeyReleased?: (callback: () => void) => () => void;