Browse Source

Tool to switch ibus engine on wayland

pull/17/head
Harish Karumuthil 3 years ago
parent
commit
e043d15ecd
  1. 18
      home/.local/Apps/daily-utils/bin/switch-ibus.mjs
  2. 5
      home/.utils.sh

18
home/.local/Apps/daily-utils/bin/switch-ibus.mjs

@ -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]}`

5
home/.utils.sh

@ -1,5 +0,0 @@
addSsh(){
mkdir -p ~/.ssh && read rsa && echo "$rsa" >> ~/.ssh/authorized_keys
}
Loading…
Cancel
Save