Arch linux:i3wmで通知が機能しません。 - Dunst:FATAL:X11ディスプレイを開くことができません。

Arch linux:i3wmで通知が機能しません。 - Dunst:FATAL:X11ディスプレイを開くことができません。

私はアーチLinuxとi3wmを使用しています。私の通知は機能しません。dunstコマンドラインに入力すると、次のように応答します。

警告:dunstrcが見つかりません。

私が入力したとき、notify-send --icon=gtk-info Test "This is a test"またはdunstify --action="replyAction,reply" "Message received"私が殺されるまで実行され続けます。crt+c通知は表示されませんが。

このファイルの内容/etc/X11/xinit/xinitrc.d/30-dbus.sh:

#!/bin/bash

# launches a session dbus instance
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && type dbus-launch >/dev/null; then
    eval $(dbus-launch --sh-syntax --exit-with-session)
fi

これは私のものですjournalctl

18:57:43 arch-thinkpad systemd[562]: Starting Dunst notification daemon...
18:57:43 arch-thinkpad dunst[49939]: CRITICAL: Cannot open X11 display.
18:57:43 arch-thinkpad systemd[562]: dunst.service: Main process exited, code=exited, status=1/FAILURE
18:57:43 arch-thinkpad systemd[562]: dunst.service: Failed with result 'exit-code'.
18:57:43 arch-thinkpad systemd[562]: Failed to start Dunst notification daemon.
18:59:43 arch-thinkpad dbus-daemon[708]: [session uid=1000 pid=708] Failed to activate service 'org.freedesktop.Notifications': timed out (service_start_timeout=120000ms)
18:59:43 arch-thinkpad dbus-daemon[708]: [session uid=1000 pid=708] Activating via systemd: service name='org.freedesktop.Notifications' unit='dunst.service' requested by ':1.112' (uid=1000 pid=17718 comm="/usr/lib/electron/electron /usr/bin/caprine ")

プログラムがDunstという通知を表示できるように、この問題をどのように解決できますか?
ご協力ありがとうございます

EDIT1:No dunstrc found.次のコマンドでエラーが修正されました。cp /usr/share/dunst/dunstrc ~/.config/dunst/dunstrc

ベストアンサー1

Dunstをサービスとしてインストールするのではなく、i3設定に追加してください。

編集~/.config/i3/configと追加:

exec --no-startup-id dunst

おすすめ記事