1. Download
git clone https://github.com/lyfeyaj/sublime-text-imfix.git
2. Do some processing
cd ~/sublime-text-imfixsudo cp ./lib/libsublime-imfix.so /opt/sublime_text/sudo cp ./src/subl /usr/bin/
So every time you have to input subl to open, very unfriendly.
The desktop file can be modified to perfectly solve the Chinese input.
The original
[Desktop Entry]Version=1.0Type=ApplicationName=Sublime TextGenericName=Text EditorComment=Sophisticated text editor for code, markup and proseExec=/opt/sublime_text/sublime_text %FTerminal=falseMimeType=text/plain;Icon=sublime-textCategories=TextEditor;Development;StartupNotify=trueActions=Window;Document;[Desktop Action Window]Name=New WindowExec=/opt/sublime_text/sublime_text -nOnlyShowIn=Unity;[Desktop Action Document]Name=New FileExec=/opt/sublime_text/sublime_text --command new_fileOnlyShowIn=Unity;
After the transformation
[Desktop Entry]Version=1.0Type=ApplicationName=Sublime TextGenericName=Text EditorComment=Sophisticated text editor for code, markup and proseExec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F"Terminal=falseMimeType=text/plain;Icon=sublime-textCategories=TextEditor;Development;StartupNotify=trueActions=Window;Document;[Desktop Action Window]Name=New WindowExec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n"OnlyShowIn=Unity;[Desktop Action Document]Name=New FileExec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file"OnlyShowIn=Unity;
The Application Launcher "Sublime_text.desktop" has not been marked as trusted. If you do not know the source of this file, it may not be safe to start it. Fix Sublime not support Chinese input problem in Ubuntu.