feat(bar): improve path handling on apps widget

This commit improves path handling for commands and icons in the new
Application widget by making use of PathExt::replace_env when loading
the user-specified ApplicationsConfig.

Crucially for scoop users, this means that user-agnostic references to
scoop apps can now be made like this:

```
$Env:USERPROFILE/scoop/apps/zed-nightly/current/zed.exe
```

When attempting to look up an icon for a command, we now split the
command on ".exe", and if this is a complete path to a file, we try to
use it to extract an icon, otherwise we try to resolve a complete path
using "which" before doing the same.
This commit is contained in:
LGUG2Z
2025-04-27 11:44:43 -07:00
parent 10424b696f
commit 17cd0308cb
3 changed files with 50 additions and 25 deletions

1
Cargo.lock generated
View File

@@ -2998,6 +2998,7 @@ dependencies = [
"sysinfo 0.34.2",
"tracing",
"tracing-subscriber",
"which",
"windows 0.61.1",
"windows-core 0.61.0",
"windows-icons 0.1.0 (git+https://github.com/LGUG2Z/windows-icons?rev=0c9d7ee1b807347c507d3a9862dd007b4d3f4354)",