s3rvac / weechat-notify-send

A WeeChat script that sends highlight and message notifications through notify-send.
MIT License
176 stars 19 forks source link

Sending of notifications fails with "OSError: [Errno 2] No such file or directory" #11

Closed KebabLord closed 6 years ago

KebabLord commented 6 years ago

Weechat masterrace here, getting this output when someone mentions me;

python: stdout/stderr (notify_send): Traceback (most recent call last):
python: stdout/stderr (notify_send):   File "/root/.weechat/python/autoload/notify_send.py", line 233, in message_printed_callback
python: stdout/stderr (notify_send):     send_notification(notification)
python: stdout/stderr (notify_send):   File "/root/.weechat/python/autoload/notify_send.py", line 638, in_send_notification
python: stdout/stderr (notify_send):     stdout=devnull,
python: stdout/stderr (notify_send):   File "/usr/lib/python2.7/subprocess.py", line 185, in check_call
python: stdout/stderr (notify_send):     retcode = call(*popenargs, **kwargs)
python: stdout/stderr (notify_send):   File "/usr/lib/python2.7/subprocess.py", line 172, in call
python: stdout/stderr (notify_send):     return Popen(*popenargs, **kwargs).wait()
python: stdout/stderr (notify_send):   File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
python: stdout/stderr (notify_send):     errread, errwrite)
python: stdout/stderr (notify_send):   File "/usr/lib/python/subprocess.py", line 1047, in_execute_child
python: stdout/stderr (notify_send):     raise child_exception
python: stdout/stderr (notify_send): OSError: [Errno 2] No such file or directory
python: error in function "message_printed_callback"
s3rvac commented 6 years ago

Hi. Do you have libnotify installed in your system? You can verify this by running the following command from a terminal:

notify-send --help

If it fails with

notify-send: command not found

then you will need to install it (see README). Let me know if this fixes the issue for you.

KebabLord commented 6 years ago

Yeah, I haven't installed libnotify, but seems like the website's download section is broken. At least I found it on my distro's apt library but I don't know which one to install, can you inform me about which is needed?

libdesktop-notify-perl - Perl module which communicates with the Desktop Notifications framework
libnotify-bin - sends desktop notifications to a notification daemon (Utilities)
libnotify-cil-dev - CLI library for desktop notifications
libnotify-dev - sends desktop notifications to a notification daemon (Development files)
libnotify-doc - sends desktop notifications to a notification daemon (Documentation)
libnotify0.4-cil - CLI library for desktop notifications
libnotify3.0-cil - CLI library for desktop notifications
libnotify3.0-cil-dev - CLI library for desktop notifications
libnotify4 - sends desktop notifications to a notification daemon
profanity - console based XMPP client
python-notify - Python bindings for libnotify
rerun - tool to launch commands and restart them on filesystem changes
ruby-notiffany - Wrapper libray for most popular notification libraries
undistract-me - Notifies user when long-running terminal commands complete via libnotify
vlc-plugin-notify - LibNotify plugin for VLC
libgtk2-notify-perl - Perl interface to libnotify
mango-lassi - Share mouse and pointer with other computers
pidgin-libnotify - display notification bubbles in pidgin
s3rvac commented 6 years ago

You need to install libnotify-bin, which provides /usr/bin/notify-send. Let me know if this fixes the issue for you.

s3rvac commented 6 years ago

I am closing the issue due to inactivity. If the installation of libnotify-bin has not fixed the problem for you, please reopen the issue.

s3rvac commented 6 years ago

BTW, in 16aeda10ff1589cd9478f5e6af5d43c6f46ed292, I have added printing of a more reasonable error message when sending of a notification fails:

Failed to send the notification via notify-send (reason: 'OSError: [Errno 2] No such file or directory').
Ensure that you have notify-send installed in your system.