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:
1 parent
371fbf715e
commit
b93944793d
2 files changed
+6
-12
No files matched your search
@@ -65,16 +65,11 @@ cd 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.
|
||||
|
||||
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
|
||||
export PYTHONPATH="$HOME/.local/share/clip-vault:$PYTHONPATH"
|
||||
clip-vault-daemon &
|
||||
```
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ cp "$sourceDir/config.default.json" "$installDir/config.default.json"
|
||||
|
||||
cat > "$binDir/clip-vault" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
exec python3 -m clip_vault.cli "\$@"
|
||||
exec env PYTHONPATH=$installDir python3 -m clip_vault.cli "\$@"
|
||||
EOF
|
||||
chmod +x "$binDir/clip-vault"
|
||||
|
||||
cat > "$binDir/clip-vault-daemon" <<EOF
|
||||
#!/usr/bin/env bash
|
||||
exec python3 -m clip_vault.daemon
|
||||
exec env PYTHONPATH=$installDir python3 -m clip_vault.daemon
|
||||
EOF
|
||||
chmod +x "$binDir/clip-vault-daemon"
|
||||
|
||||
@@ -26,12 +26,11 @@ cat > "$autostartDir/clip-vault.desktop" <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Clip Vault
|
||||
Exec=env PYTHONPATH=$installDir $binDir/clip-vault-daemon
|
||||
Exec=$binDir/clip-vault-daemon
|
||||
X-GNOME-Autostart-enabled=true
|
||||
EOF
|
||||
|
||||
echo "installed. PYTHONPATH must include $installDir when running clip-vault/clip-vault-daemon by hand:"
|
||||
echo " export PYTHONPATH=$installDir:\$PYTHONPATH"
|
||||
echo "installed."
|
||||
echo " clip-vault-daemon & # starts tray + clipboard watcher"
|
||||
echo " clip-vault list # view history from the CLI"
|
||||
echo "config file: ~/.config/clip-vault/config.json (edit webhooks there)"
|
||||
Reference in new issue
Block a user