mirror of https://github.com/harish2704/dotFiles
3 changed files with 21 additions and 19 deletions
@ -1,18 +0,0 @@ |
|||||
#!/usr/bin/env zx
|
|
||||
|
|
||||
|
|
||||
let engineList = await $`ibus read-config | grep preload-engines | sed "s/preload-engines://g; s/'/\\"/g"` |
|
||||
|
|
||||
engineList = JSON.parse(engineList) |
|
||||
|
|
||||
let currentEngine = await $`ibus engine` |
|
||||
currentEngine = currentEngine.toString().trim() |
|
||||
|
|
||||
let currentEngineIdx = engineList.indexOf(currentEngine); |
|
||||
|
|
||||
let nextEngineIdx = currentEngineIdx+1; |
|
||||
if( nextEngineIdx === engineList.length ){ |
|
||||
nextEngineIdx=0 |
|
||||
} |
|
||||
|
|
||||
await $`ibus engine ${engineList[nextEngineIdx]}` |
|
@ -0,0 +1,20 @@ |
|||||
|
#!/usr/bin/env python |
||||
|
|
||||
|
import subprocess |
||||
|
import json |
||||
|
|
||||
|
def ex(cmd): |
||||
|
return subprocess.getoutput(cmd) |
||||
|
|
||||
|
|
||||
|
engineList = ex('ibus read-config | grep preload-engines | sed "s/preload-engines://g; s/\'/\\"/g"') |
||||
|
engineList = json.loads(engineList) |
||||
|
|
||||
|
currentEngine = ex('ibus engine') |
||||
|
currentEngineIdx = engineList.index(currentEngine); |
||||
|
|
||||
|
nextEngineIdx = currentEngineIdx+1; |
||||
|
if nextEngineIdx == len(engineList): |
||||
|
nextEngineIdx=0 |
||||
|
|
||||
|
ex('ibus engine %s' % engineList[nextEngineIdx]) |
@ -1,4 +1,4 @@ |
|||||
./bin/chromium |
./bin/chromium |
||||
./bin/hari-tools.sh |
./bin/hari-tools.sh |
||||
./bin/bash-session |
./bin/bash-session |
||||
./bin/ibus-next-engine.mjs |
|
||||
|
./bin/ibus-next-engine.py |
||||
|
Loading…
Reference in new issue