LukeSmithxyz / mutt-wizard

A system for automatically configuring mutt and isync with a simple interface and safe passwords
GNU General Public License v3.0
2.41k stars 383 forks source link

Error calling StartServiceByName for org.freedesktop.Notifications: Timeout was reached #896

Open se7en-x230 opened 1 year ago

se7en-x230 commented 1 year ago

Arch DWM (your setup) Xorg dunst

for whatever reasons on 2 machines the notification are not working and I can't find out why

noitfy-send/dunstify works with other apps

ngorden commented 1 year ago

To add to this:

  1. This issue only seems to appear when calling mw -Y from st, I've seen the notification work correctly through dwmblocks
  2. The issue seems to pertain to the DISPLAY variable

My systemctl status --user dunst output:

Expand ``` × dunst.service - Dunst notification daemon Loaded: loaded (/usr/lib/systemd/user/dunst.service; static) Active: failed (Result: core-dump) since Sat 2023-01-21 06:47:23 PST; 11min ago Docs: man:dunst(1) Process: 652229 ExecStart=/usr/bin/dunst (code=dumped, signal=TRAP) Main PID: 652229 (code=dumped, signal=TRAP) CPU: 12ms Jan 21 06:47:23 dragon systemd[758]: Starting Dunst notification daemon... Jan 21 06:47:23 dragon dunst[652229]: WARNING: Cannot open X11 display. Jan 21 06:47:23 dragon dunst[652229]: ERROR: [ get_x11_output:0065] Couldn't initialize X11 output. Aborting... Jan 21 06:47:23 dragon systemd-coredump[652233]: Process 652229 (dunst) of user 1000 dumped core. Stack trace of thread 652229: #0 0x00007f5bb54348e5 g_logv (libglib-2.0.so.0 + 0x5e8e5) #1 0x00007f5bb5434b64 g_log (libglib-2.0.so.0 + 0x5eb64) #2 0x00005629cd6dd03d n/a (dunst + 0x1603d) #3 0x00005629cd6d48b8 n/a (dunst + 0xd8b8) #4 0x00007f5bb51f7290 n/a (libc.so.6 + 0x23290) #5 0x00007f5bb51f734a __libc_start_main (libc.so.6 + 0x2334a) #6 0x00005629cd6d4ca5 n/a (dunst + 0xdca5) Stack trace of thread 652231: #0 0x00007f5bb52ddffc __send (libc.so.6 + 0x109ffc) #1 0x00007f5bb56101b8 g_socket_send_with_blocking (libgio-2.0.so.0 + 0x981b8) #2 0x00007f5bb55fb255 g_output_stream_write (libgio-2.0.so.0 + 0x83255) #3 0x00007f5bb55fb255 g_output_stream_write (libgio-2.0.so.0 + 0x83255) #4 0x00007f5bb55fb3d1 g_output_stream_write_all (libgio-2.0.so.0 + 0x833d1) #5 0x00007f5bb55c46dc g_data_output_stream_put_string (libgio-2.0.so.0 + 0x4c6dc) #6 0x00007f5bb5674a62 n/a (libgio-2.0.so.0 + 0xfca62) #7 0x00007f5bb55b8bf3 n/a (libgio-2.0.so.0 + 0x40bf3) #8 0x00007f5bb5621c4c n/a (libgio-2.0.so.0 + 0xa9c4c) #9 0x00007f5bb545e673 n/a (libglib-2.0.so.0 + 0x88673) #10 0x00007f5bb5458e05 n/a (libglib-2.0.so.0 + 0x82e05) #11 0x00007f5bb525a8fd n/a (libc.so.6 + 0x868fd) #12 0x00007f5bb52dcd20 n/a (libc.so.6 + 0x108d20) Stack trace of thread 652230: #0 0x00007f5bb52cf37f __poll (libc.so.6 + 0xfb37f) #1 0x00007f5bb5482bef n/a (libglib-2.0.so.0 + 0xacbef) #2 0x00007f5bb542a132 g_main_context_iteration (libglib-2.0.so.0 + 0x54132) #3 0x00007f5bb542a182 n/a (libglib-2.0.so.0 + 0x54182) #4 0x00007f5bb5458e05 n/a (libglib-2.0.so.0 + 0x82e05) #5 0x00007f5bb525a8fd n/a (libc.so.6 + 0x868fd) #6 0x00007f5bb52dcd20 n/a (libc.so.6 + 0x108d20) ELF object binary architecture: AMD x86-64 Jan 21 06:47:23 dragon systemd[758]: dunst.service: Main process exited, code=dumped, status=5/TRAP Jan 21 06:47:23 dragon systemd[758]: dunst.service: Failed with result 'core-dump'. Jan 21 06:47:23 dragon systemd[758]: Failed to start Dunst notification daemon. ```

notify-send still works outside of the context of mutt-wizard

speedie1337 commented 1 year ago

I have this issue. If I spawn neomutt through a dwm keybind through /bin/sh -c st -e neomutt, I am unable to compose an email using $EDITOR, and if I try to fetch new emails I get the same org.freedesktop.Notifications error. If I spawn neomutt using my shell (zst) in st it all works as expected.

Certainly an interesting issue, and I still have not figured out what causes it. Maybe it's a shell thing, that would explain the $EDITOR variable perhaps not being set.

cld4h commented 1 year ago

I have the same issue and I have fixed it.

I think it's because the DISPLAY environment variable is not set.

To fix this, add this line in .xinitrc file

systemctl --user import-environment DISPLAY

For Luke's voidrice config, it is in $HOME/.config/x11/xinitrc

However, this is only for systemd. Since Luke's LARBS is meant for any Arch or Artix Linux-based system, I guess Luke won't accept adding this line in his xinitrc file. 🤪

reference

speedie1337 commented 1 year ago

Perhaps the shell that spawns notify-send doesn't have $DISPLAY set, but the user shell (that spawned the X11 session) does. In this case another approach to solving this problem would be to spawn X11 using /bin/sh, but if the issue is only present when spawning neomutt using dwm keybinds I would probably just set the dwm shell used to spawn programs to whatever my user shell is. (zsh)

Jocomol commented 1 year ago

Are you using larbs?

speedie1337 commented 1 year ago

No, but I'm using dwm, st and of course mutt-wizard.