From 11f73e9e6aa6ac3343750590e00b53a6dd70fe2e Mon Sep 17 00:00:00 2001 From: rope Date: Mon, 3 Aug 2026 12:24:16 +0100 Subject: [PATCH] launcher: search ~/Documents and ~/Downloads, not all of $HOME Searching $HOME buried real results under game assets and nixos config files. A missing root is harmless: fd reports it on stderr, which nothing reads, and still searches the rest at exit 0. --- settings/quickshell.nix | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/settings/quickshell.nix b/settings/quickshell.nix index 362bad9..a5c434a 100644 --- a/settings/quickshell.nix +++ b/settings/quickshell.nix @@ -1699,18 +1699,26 @@ in open = false; } - // ── File search: one fd run per settled keystroke, scoped to - // $HOME and nothing above it. No index and no daemon — - // --max-results lets fd exit the moment it has enough, which - // is what keeps this feeling instant, and results are never - // stale the way a nightly updatedb is. + // ── File search: one fd run per settled keystroke. No index + // and no daemon — --max-results lets fd exit the moment it has + // enough, which is what keeps this feeling instant, and + // results are never stale the way a nightly updatedb is. // - // Dotfiles and dot-directories are skipped (fd's default — - // there is deliberately no --hidden here). That is both what - // you want from a launcher and most of the speed: ~/.cache, - // ~/.local/share/Steam, ~/.var and every .git tree are the - // bulk of the files under $HOME and none of them are things - // you search for by name. + // Scoped to ~/Documents and ~/Downloads, not all of $HOME. + // Searching $HOME drowned the results in game assets and + // nixos config files — technically matches, never what was + // being looked for. These two are where documents a person + // goes hunting for by name actually live. + // + // A missing directory is fine: fd reports it on stderr, which + // nothing reads, and still searches the rest at exit 0. + // + // Dotfiles and dot-directories are also skipped (fd's default, + // there is deliberately no --hidden here). + readonly property var fdRoots: [ + Quickshell.env("HOME") + "/Documents", + Quickshell.env("HOME") + "/Downloads" + ] property var fileHits: [] property string fdQuery: "" // A run cut short still flushes whatever stdout it had, and @@ -1761,12 +1769,11 @@ in Commands.fd, "--absolute-path", "--ignore-case", "--type", "f", "--type", "d", "--max-results", String(fdMax), - // node_modules is the one big junk tree that isn't - // hidden, so it still needs naming. The old .git / - // .cache / .steam excludes are gone with --hidden. + // node_modules is the one junk tree that is neither + // hidden nor outside these roots. "--exclude", "node_modules", - pat, Quickshell.env("HOME") - ]; + pat + ].concat(fdRoots); fdProc.running = true; }