Dear All, I am trying to setup ibus-rime for Chinese input in guix system 1.2.0, after a lot of googling and trial and error, I found that I cannot set the needed environment variables: export GTK_IM_MODULE="ibus" export QT_IM_MODULE="ibus" export XMODIFIERS="@im=ibus" I have tried putting them in ~/.profile, ~/.pam_environment, ~/.xprofile and it seems they have no effects. If I am not mistaken, guix system now uses gdm as display manager, but I also cannot find a way to set environment variable for gdm sessions. Any help is greatly appreciated. Also, I think a way to let user customize /etc/environment through the system config will be useful, but I do not find a way to do so. Thanks. Regards, Peter
[-- Attachment #1: Type: text/plain, Size: 545 bytes --] Lo Peter <peterloleungyau@gmail.com> writes: > Any help is greatly appreciated. Also, I think a way to let user > customize /etc/environment through the system config will be useful, > but I do not find a way to do so. Try adding something like this to your system services: (simple-service 'my-ibus-ch-env session-environment-service-type '(("GTK_IM_MODULE" . "ibus") ("QT_IM_MODULE" . "ibus"))) -- Das Lernen vieler Dinge lehrt nicht Verständnis. Heraklit, B40 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 511 bytes --]
[-- Attachment #1: Type: text/plain, Size: 1289 bytes --] Peter! Lo Peter 写道: > ~/.pam_environment I don't think we configure PAM to look at this by default. I'm not sure why GDM doesn't load ~/.profile (it may be right not to -- most of these files are abused). I'd never heard of ~/.xprofile. > Any help is greatly appreciated. Also, I think a way to let user > customize /etc/environment through the system config will be > useful, > but I do not find a way to do so. That already exists, but it seems to be wholly undocumented(?). Boo. Also, IIRC blindly plonking (session-environment-service-type '(("FOO" . "bar"))) into your services would only get you the ‘duplicate service’ error. It's meant to be extended. First, define this in your system.scm (above your operating-system): (define environment-service-type (service-type (name 'environment) (default-value '()) (extensions (list (service-extension session-environment-service-type identity))))) Then use it in your services field: (service environment-service-type '(("GTK_IM_MODULE" . "ibus") ("QT_IM_MODULE" . "ibus") ...)) I hope that helps, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 247 bytes --]
[-- Attachment #1: Type: text/plain, Size: 252 bytes --] Michael Rohleder 写道: > (simple-service 'my-ibus-ch-env session-environment-service-type > '(("GTK_IM_MODULE" . "ibus") > ("QT_IM_MODULE" . "ibus"))) ...much simpler. Thanks! Kind regards, T G-R [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 247 bytes --]
Thanks both for the replies.
If I understand correctly, custom environment variables could be added
through some kind of session-environment-service-type, I will try it
out to learn more.
Just for the record, I currently use a custom ~/.xsession script as a
hack to source ~/.xprofile to set the needed environment variables and
also start ibus-daemon, because I really only need i3 (and xfce as a
fallback).
Thanks.
Regards,
Peter
On Sun, Dec 27, 2020 at 10:39 PM Tobias Geerinckx-Rice <me@tobias.gr> wrote:
>
> Michael Rohleder 写道:
> > (simple-service 'my-ibus-ch-env session-environment-service-type
> > '(("GTK_IM_MODULE" . "ibus")
> > ("QT_IM_MODULE" . "ibus")))
>
> ...much simpler. Thanks!
>
> Kind regards,
>
> T G-R