You are not logged in.
I've successfully moved nearly all my background processes to systemd service files, with the exception of fcitx, an input method manager, mostly used for Chinese.
Starting it in ~/.xinitrc, as "/usr/bin/fcitx &", works just fine. Its configuration files are all under ~/.config/fcitx. I also set the proper environment variables in ~/.bashrc:
export GTK_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
export QT_IM_MODULE=fcitxI'm trying to do the equivalent in a user systemd service file, in ~/.config/systemd/user/fcitx.service. Right now that looks like this:
[Unit]
Description=Fcitx as a systemd service
[Service]
Type=forking
User=%i
ExecStart=/usr/bin/fcitx
Environment=GTK_IM_MODULE=fcitx XMODIFIERS="@im=fcitx" QT_IM_MODULE=fcitx
[Install]
WantedBy=graphical.targetThat starts up with no errors, but fcitx does nothing: it's supposed to switch input methods when I press F7, but it does nothing.
I suspect the Environment section is unnecessary -- it's other processes that need those variables, not fcitx itself. But I've tried it with and without, and having that line in there doesn't make any difference.
Does anyone know why this might not be working? I've tried with different Types, with and without the User specified... I can't think of what else might be wrong.
Thanks!
Eric
Offline
I should have added that fcitx comes with options to run as a daemon, and to *not* run as a daemon. If I put in the -D (don't run as a daemon) option, but leave the Type=forking, then the call to systemctl --user start fcitx hangs and doesn't return. If I leave in the -D but remove the Type=forking, the process starts, but checking its status reports an "XMODIFIERS Error":
(WARN-9009 /build/fcitx/src/fctix-4.3.8.5/src/frontend/xim/xim.c:157) XMODIFIERS Error.I suspect this is the correct way to run the process (with the "no daemon" option, and no Type=forking), but I'm just missing one last piece of the puzzle, related to the environment variables...
Offline