fix: set PYTHONPATH in the generated clip-vault wrappers

The clip-vault and clip-vault-daemon wrappers ran python3 -m without a
PYTHONPATH, so they failed with ModuleNotFoundError from any shell that
did not export it by hand. Both now set it the same way the notif-vault
wrappers do, which also lets the autostart entry call the daemon
directly instead of wrapping it in env.
This commit is contained in:
dualfroz committed 2026-08-05 20:37:41 +02:00
1 parent 371fbf715e
commit b93944793d
2 files changed
+6 -12

No files matched your search

+2 -7
View File
@@ -65,16 +65,11 @@ cd clip-vault
``` ```
This copies the package into `~/.local/share/clip-vault`, drops `clip-vault` This copies the package into `~/.local/share/clip-vault`, drops `clip-vault`
and `clip-vault-daemon` wrappers into `~/.local/bin`, and adds an autostart and `clip-vault-daemon` wrappers into `~/.local/bin` (both wrappers set
`PYTHONPATH` themselves, so they work from any shell), and adds an autostart
entry so the daemon starts with your session. entry so the daemon starts with your session.
One rough edge worth knowing: the two wrapper scripts do **not** set
`PYTHONPATH` themselves, so running them by hand from a fresh shell needs it
exported first. The autostart entry sets it for you, so this only affects
manual runs.
```bash ```bash
export PYTHONPATH="$HOME/.local/share/clip-vault:$PYTHONPATH"
clip-vault-daemon & clip-vault-daemon &
``` ```
+4 -5
View File
@@ -12,13 +12,13 @@ cp "$sourceDir/config.default.json" "$installDir/config.default.json"
cat > "$binDir/clip-vault" <<EOF cat > "$binDir/clip-vault" <<EOF
#!/usr/bin/env bash #!/usr/bin/env bash
exec python3 -m clip_vault.cli "\$@" exec env PYTHONPATH=$installDir python3 -m clip_vault.cli "\$@"
EOF EOF
chmod +x "$binDir/clip-vault" chmod +x "$binDir/clip-vault"
cat > "$binDir/clip-vault-daemon" <<EOF cat > "$binDir/clip-vault-daemon" <<EOF
#!/usr/bin/env bash #!/usr/bin/env bash
exec python3 -m clip_vault.daemon exec env PYTHONPATH=$installDir python3 -m clip_vault.daemon
EOF EOF
chmod +x "$binDir/clip-vault-daemon" chmod +x "$binDir/clip-vault-daemon"
@@ -26,12 +26,11 @@ cat > "$autostartDir/clip-vault.desktop" <<EOF
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Name=Clip Vault Name=Clip Vault
Exec=env PYTHONPATH=$installDir $binDir/clip-vault-daemon Exec=$binDir/clip-vault-daemon
X-GNOME-Autostart-enabled=true X-GNOME-Autostart-enabled=true
EOF EOF
echo "installed. PYTHONPATH must include $installDir when running clip-vault/clip-vault-daemon by hand:" echo "installed."
echo " export PYTHONPATH=$installDir:\$PYTHONPATH"
echo " clip-vault-daemon & # starts tray + clipboard watcher" echo " clip-vault-daemon & # starts tray + clipboard watcher"
echo " clip-vault list # view history from the CLI" echo " clip-vault list # view history from the CLI"
echo "config file: ~/.config/clip-vault/config.json (edit webhooks there)" echo "config file: ~/.config/clip-vault/config.json (edit webhooks there)"