I'm using fcitx5 with emacs, to enable entry of Chinese characters. There is a known issue with emacs, where in order to input Chinese characters, one needs to launch emacs using LC_CTYPE=zh_CN.UTF-8 emacs. This works fine, but I would like to make this more permanent (for lack of better word).
One thing I would like to do is change the Desktop Entry file to set LC_CTYPE. The reason I want to change this file is because I have different symlinks pointing to it (like autostart), and would like to launch this entry with the edited LC_CTYPE. Is this possible?
My Desktop Entry file in /usr/share/applications/ looks like this:
[Desktop Entry] Version=1.0 Name=Emacs (GUI) GenericName=Text Editor Comment=GNU Emacs is an extensible, customizable text editor - and more MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; TryExec=/usr/bin/emacs Exec=/usr/bin/emacs %F Icon=emacs Type=Application Terminal=false Categories=Utility;Development;TextEditor; StartupWMClass=Emacs Keywords=Text;Editor;
Exec=/usr/bin/env LC_CTYPE=zh_CN.UTF-8 emacs %F.Execkey's value? i.e., I should updateExectoLC_CTYPE=zh_CN.UTF-8 emacs %F?Exec=/usr/bin/env LC_CTYPE=zh_CN.UTF-8 /usr/bin/emacs %Fline.envtool (usually/usr/bin/env) allows to run any program with added/changed/deleted environment variables. Seeman 1 env.envtool allows to set environment variables, whose names contain characters not allowed in names of shell variables:env -i my-variable:with@shell%disallowed^charactersあいうえお=1 python -c 'import os; print(os.environ)'.~/.local/share/applications, edit that instead and update your symlinks to point there.