alexmurray / emacs-snap

GNU Emacs in a snap
https://snapcraft.io/emacs
71 stars 13 forks source link

Strange error with notify-send #15

Closed egh closed 1 year ago

egh commented 4 years ago

I don't understand enough about dbus and snap to know why this is, but I am having a problem with file paths with the notify-send command (used by https://github.com/jwiegley/alert)

If I run this command in my terminal (not from emacs), I get an icon displayed in the alert:

notify-send --icon /snap/emacs/current/usr/share/emacs/27.0.91/etc/images/icons/hicolor/scalable/apps/emacs.svg foo bar

image

However, if I run the command using M-x shell-command or shell or eshell, the icon is not displayed

image

alexmurray commented 4 years ago

I can reproduce this but I am not sure what is causing it at the moment - running this via eshell with strace I see the following failure:

access("/snap/emacs/643/snap/emacs/current/usr/share/emacs/27.0.91/etc/images/icons/hicolor/scalable/apps/emacs.svg", F_OK) = -1 ENOENT (No such file or directory)

Which I guess is why the icon is not being shown there - but if I do the same (ie strace notify-send ...) under bash there is no matching call to access() at all so I am a bit confused what's going on here.

egh commented 4 years ago

I should mention to that this doesn't work with a file in my home directory, either. e.g. notify-send --icon /home/egh/emacs23.svg foo bar shows the same behavior.

It works using the built-in dbus notification in emacs 27:

(require 'notifications)
(notifications-notify :title "foo" :body "bar" :app-icon "/snap/emacs/current/usr/share/emacs/27.0.91/etc/images/icons/hicolor/scalable/apps/emacs.svg")
alexmurray commented 1 year ago

FWIW I have just tried reproducing this using emacs-29 from the beta channel of the snap and it appears to work as expected - can you please try and see if it is fixed using the latest emacs snap builds? Thanks.

egh commented 1 year ago

Confirmed no longer reproducible on emacs 28.2 from snap either. Thanks for checking back!