Tweak geoclue for via-nix

This commit is contained in:
clsty
2025-11-03 23:48:07 +08:00
parent bd14c73f9b
commit 47810c95da
2 changed files with 16 additions and 15 deletions
@@ -7,13 +7,16 @@ if pgrep -f 'geoclue-2.0/demos/agent' > /dev/null; then
fi
# List of known possible GeoClue agent paths
AGENT_PATHS="
/usr/libexec/geoclue-2.0/demos/agent
/usr/lib/geoclue-2.0/demos/agent
"
AGENT_PATHS=(
/usr/libexec/geoclue-2.0/demos/agent
/usr/lib/geoclue-2.0/demos/agent
"$HOME/.nix-profile/libexec/geoclue-2.0/demos/agent"
"$HOME/.nix-profile/lib/geoclue-2.0/demos/agent"
/run/current-system/sw/libexec/geoclue-2.0/demos/agent
)
# Find the first valid agent path
for path in $AGENT_PATHS; do
for path in "${AGENT_PATHS[@]}"; do
if [ -x "$path" ]; then
echo "Starting GeoClue agent from: $path"
"$path" & # starts in the background