Skip to content

Commit

Permalink
new: python version for iterm-tab
Browse files Browse the repository at this point in the history
Signed-off-by: o98k-ok <hggend@gmail.com>
  • Loading branch information
o98k-ok committed Feb 14, 2022
1 parent fe433e5 commit d8d78f9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
15 changes: 0 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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/
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
22 changes: 22 additions & 0 deletions entry.py
Original file line number Diff line number Diff line change
@@ -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}))

0 comments on commit d8d78f9

Please sign in to comment.