Skip to content

Instantly share code, notes, and snippets.

@wrfly
Last active August 29, 2015 14:22
Show Gist options
  • Save wrfly/5f4187be96d93e95ad07 to your computer and use it in GitHub Desktop.
Save wrfly/5f4187be96d93e95ad07 to your computer and use it in GitHub Desktop.
auto fix Chinese input method script
#!/bin/bash
cd /opt/sublime_text &&\
sudo wget "https://gist.githubusercontent.com/wrfly/baf1314ae25f41fe8cde/raw/45c669808bed8eb6d98fe6caa3f730076e5aede3/imfix.c"
sudo apt-get install build-essential libgtk2.0-dev
sudo gcc -shared -o imfix.so imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
sudo sed -i "s/exec/LD_PRELOAD=\/opt\/sublime_text\/imfix.so/" /usr/bin/subl
sudo sed -i "s/\/opt\/sublime_test\/sublime_text/subl/g" /usr/share/applications/sublime_text.desktop
echo "Succeed!"
exit 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment