Skip to content

Instantly share code, notes, and snippets.

@hacolab
Created January 15, 2020 09:38
Show Gist options
  • Save hacolab/34a40fdb174c5b4d32e50defc59e136f to your computer and use it in GitHub Desktop.
Save hacolab/34a40fdb174c5b4d32e50defc59e136f to your computer and use it in GitHub Desktop.
#!/bin/sh
#+[USAGE] $0
#+[STDOUT]
#+ 0: IME OFF
#+ 1: IME ON
if [ -z "$XMODIFIERS" ]; then
# on CUI
UIM_GET_FILE=$UIM_FEP_GETMODE
if [ -n "$UIM_GET_FILE" ]; then
cat "$UIM_GET_FILE"
else
echo 0
fi
else
# on GUI
if [ "$(fcitx-remote)" = "2" ]; then
echo 1
else
echo 0
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment