Skip to content

Instantly share code, notes, and snippets.

@yangniao23
Created April 19, 2024 03:39
Show Gist options
  • Save yangniao23/dc199c49196ca37c401daa476c751359 to your computer and use it in GitHub Desktop.
Save yangniao23/dc199c49196ca37c401daa476c751359 to your computer and use it in GitHub Desktop.
dbus 経由で fcitx5 でアクティブな入力メソッドを取得する
dbus-send --print-reply=literal --session --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.CurrentInputMethod
@yangniao23
Copy link
Author

fcitx5-skk を使っている場合

   skk

が返ってくる.改行が入っていないことに注意.

別ユーザ (root とか)から別のユーザのものを取ってくる場合,sudo と DBUS_SESSION_BUS_ADDRESS の指定が必要
ユーザ名を user,uidを 1000 として

sudo -u user DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus' 

を先頭に付ける

@yangniao23
Copy link
Author

skk 起動時だけ SandS を有効にしたい,みたいなときに使う

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment