mirror of
https://github.com/harish2704/dotFiles.git
synced 2026-09-10 15:21:09 +00:00
Tool to switch ibus engine on wayland
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/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]}`
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
|
|
||||||
addSsh(){
|
|
||||||
mkdir -p ~/.ssh && read rsa && echo "$rsa" >> ~/.ssh/authorized_keys
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user