diff --git a/.gitignore b/.gitignore index 66fd13c..e69de29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +0,0 @@ -# Binaries for programs and plugins -*.exe -*.exe~ -*.dll -*.so -*.dylib - -# Test binary, built with `go test -c` -*.test - -# Output of the go coverage tool, specifically when used with LiteIDE -*.out - -# Dependency directories (remove the comment below to include it) -# vendor/ diff --git a/README.md b/README.md index 2683b3c..70adb22 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,14 @@ # STab Switch Iterm2 tab + +## Introduce +Simple python version for [florianeckerstorfer/alfred-iterm2-tabs](https://github.com/florianeckerstorfer/alfred-iterm2-tabs). +Because php version has terrible cooperation with Alfred + +## Installation +Download [latest](https://github.com/o98k-ok/STab/releases) version, and install it. + +## Acknowledgement +1. Thanks [florianeckerstorfer/alfred-iterm2-tabs](https://github.com/florianeckerstorfer/alfred-iterm2-tabs) +2. [Tabset](https://www.npmjs.com/package/iterm2-tab-set) may help too. +3. [Badges](https://iterm2.com/documentation-badges.html) is amazing too. diff --git a/entry.py b/entry.py new file mode 100644 index 0000000..be5d895 --- /dev/null +++ b/entry.py @@ -0,0 +1,22 @@ +import commands +import json +import sys + + +arg = "" +if len(sys.argv) >= 2: + arg = sys.argv[1] + + +res = [] +out = commands.getoutput('./get-tabs.scpt') +for name in out.split(";"): + if name != "" and arg in name: + res.append({"title":name, "subtitle":"", "arg": name}) + +if len(res) == 0: + res.append({"title":"404", "subtitle":"Not Found"}) + + +print(json.dumps({"items":res})) +