GUI アプリケーションがユーザー モードで systemd サービス (デーモン) として起動できない

GUI アプリケーションがユーザー モードで systemd サービス (デーモン) として起動できない

ユーザーモードで Gui アプリケーションを実行するための systemd サービスを作成しました。

これは、~/.config/systemd/user にある .service ファイルです。

[Unit]
Description=daemon service in user session created for startup ways in linux

[Service]
WorkingDirectory=/home/vipul.gupta/MyWorkspace
ExecStart=/home/vipul.gupta/MyWorkspace/GTKSource
Type=simple

[Install]
WantedBy=graphical-session.target

使用すると GUI ウィンドウが表示されますが、Environment=DISPLAY=:0サービスはユーザー セッションで実行されており、表示にアクセスできるため、これを使用したくありません。

ログは次のとおりです:

Started daemon service in user session created for startup ways in linux
GTKTest[201583]: Unable to init server: Could not connect: Connection refused
GTKTest[201583]: cannot open display:
systemd[72001]: tallyuserdaemon.service: Main process exited, code=exited, status=1/FAILURE
systemd[72001]: tallyuserdaemon.service: Failed with result 'exit-code'.

理由は分かりません。

関連情報