deanishe / deanishe/alfred-firefox

Calling the executable directly, not from the workflow

Open
#38 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
361
Forks
19
PR merge metrics
No merged PRs in 30d

Description

I created a copy of the `server.sh` file that runs the executable directly.

```bash
#!/bin/zsh

# This script is a wrapper for the Firefox extension client/RPC server
# to set an Alfred-like environment when it is run by Firefox.

here="${${(%):-%x}:A:h}"

# getvar | Read a value from info.plist
getvar() {
local v="$1"
/usr/libexec/PlistBuddy -c "Print :$v" "${here}/info.plist"
}

export alfred_workflow_bundleid=$( getvar "bundleid" )
export alfred_workflow_version=$( getvar "version" )
export alfred_workflow_name=$( getvar "name" )
export alfred_debug=0 # <----

export alfred_workflow_cache="${HOME}/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/${alfred_workflow_bundleid}"
export alfred_workflow_data="${HOME}/Library/Application Support/Alfred/Workflow Data/${alfred_workflow_bundleid}"

mkdir -p "${alfred_workflow_data}"
mkdir -p "${alfred_workflow_cache}"

exec "${here}/alfred-firefox" $1 $2 $3 $4 $5
```

I'm getting results back in the terminal, but there are lots of log messages, like:

```
> ./run.sh tab-info
01:06:29 ----- Firefox Assistant/0.2.2 (AwGo/0.27.1) ------
01:06:29 loaded URL action "Open in Default Application" from .....
01:16:34 RPC client connected to "Firefox"
{"alfredworkflow":{"variables":{"FF_INDEX":"1","FF_TAB":"2","FF_TITLE":"New Issue ......
01:19:10 ------------------- 4.672601ms -------------------
```

Is there a way to get just the JSON response back, without the extra log messages?
I tried setting the `alfred_debug` variable to 0, don't know if it's related

Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.