日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

sublime linux下无法输入中文

發布時間:2024/4/15 linux 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 sublime linux下无法输入中文 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

 

cd ~ vim sublime_imfix.c輸入 #include <gtk/gtkimcontext.h> void gtk_im_context_set_client_window (GtkIMContext *context,GdkWindow *window) {GtkIMContextClass *klass;g_return_if_fail (GTK_IS_IM_CONTEXT (context));klass = GTK_IM_CONTEXT_GET_CLASS (context);if (klass->set_client_window)klass->set_client_window (context, window);g_object_set_data(G_OBJECT(context),"window",window);if(!GDK_IS_WINDOW (window))return;int width = gdk_window_get_width(window);int height = gdk_window_get_height(window);if(width != 0 && height !=0)gtk_im_context_focus_in(context); }

  開始編譯,編譯需要安裝一下依賴,

sudo apt-get install libgtk2.0-dev libglade2-dev firefox-dev libchm-dev libssl-dev

  編譯

gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC

  libsublime-imfix.so拷貝到sublime_text所在安裝文件夾

sudo mv libsublime-imfix.so /opt/sublime_text/

  如果不知道可以,updatedb 然后 locate sublime_text查看路徑。

vim修改 /usr/bin/subl文件#!/bin/sh exec /opt/sublime_text/sublime_text "$@" 為 #!/bin/sh LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text "$@"

  

sudo vim /usr/share/applications/sublime_text.desktop 將[Desktop Entry]中的字符串 Exec=/opt/sublime_text/sublime_text %F 修改為 Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F" 將[Desktop Action Window]中的字符串 Exec=/opt/sublime_text/sublime_text -n 修改為 Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n" 將[Desktop Action Document]中的字符串 Exec=/opt/sublime_text/sublime_text --command new_file 修改為 Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file" 注意: 修改時請注意雙引號"",否則會導致不能打開帶有空格文件名的文件。 此處僅修改了/usr/share/applications/sublime-text.desktop,但可以正常使用了。 opt/sublime_text/目錄下的sublime-text.desktop可以修改,也可不修改。

  

?

轉載于:https://www.cnblogs.com/yangxunwu1992/p/5746038.html

總結

以上是生活随笔為你收集整理的sublime linux下无法输入中文的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。