aboutsummaryrefslogtreecommitdiff
path: root/.local/share
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-01-15 16:59:42 +0100
committerlonkaars <loek@pipeframe.xyz>2023-01-15 16:59:42 +0100
commit7a7f77fb1334f4a2d653d2e3bdbea01f5fce7b76 (patch)
treea0c242b8da1997e36cef7743b913d82fd545a381 /.local/share
parentce4dad6ea2d7a46bebc9e7a28ed478c074908b82 (diff)
toggle fcitx5 off in normal mode in vim
Diffstat (limited to '.local/share')
-rwxr-xr-x.local/share/bin/fcitx5-temp-off8
-rwxr-xr-x.local/share/bin/fcitx5-temp-restore7
2 files changed, 15 insertions, 0 deletions
diff --git a/.local/share/bin/fcitx5-temp-off b/.local/share/bin/fcitx5-temp-off
new file mode 100755
index 0000000..b2f8ea9
--- /dev/null
+++ b/.local/share/bin/fcitx5-temp-off
@@ -0,0 +1,8 @@
+#!/bin/sh
+mkdir -p "$XDG_DATA_HOME/fcitx5"
+fcitx5-remote > "$XDG_DATA_HOME/fcitx5/state"
+fcitx5-remote -n > "$XDG_DATA_HOME/fcitx5/ime_name"
+
+fcitx5-remote -c
+fcitx5-remote -s 'keyboard-us'
+
diff --git a/.local/share/bin/fcitx5-temp-restore b/.local/share/bin/fcitx5-temp-restore
new file mode 100755
index 0000000..d00b11c
--- /dev/null
+++ b/.local/share/bin/fcitx5-temp-restore
@@ -0,0 +1,7 @@
+#!/bin/sh
+[ ! -e "$XDG_DATA_HOME/fcitx5/state" ] && exit
+[ ! -e "$XDG_DATA_HOME/fcitx5/ime_name" ] && exit
+
+[ `cat "$XDG_DATA_HOME/fcitx5/state"` = "1" ] && fcitx5-remote -c
+[ `cat "$XDG_DATA_HOME/fcitx5/state"` = "2" ] && fcitx5-remote -o
+cat "$XDG_DATA_HOME/fcitx5/ime_name" | xargs fcitx5-remote -s