mirror of https://github.com/harish2704/dotFiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
470 B
18 lines
470 B
#!/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]}`
|
|
|