Giter Club home page Giter Club logo

notify-rust's Introduction

notify-rust

build Crates.io contributors maintenance

version documentation license

A not so well-named library for displaying desktop notifications.

[dependencies]
notify-rust = "4"

Usage & Documentation

Please see the documentation for current examples.

Simple Notification

use notify_rust::Notification;
Notification::new()
    .summary("Firefox News")
    .body("This will almost look like a real firefox notification.")
    .icon("firefox")
    .show()?;

Persistent Notification

use notify_rust::{Notification, Hint};
Notification::new()
    .summary("Category:email")
    .body("This has nothing to do with emails.\nIt should not go away until you acknowledge it.")
    .icon("thunderbird")
    .appname("thunderbird")
    .hint(Hint::Category("email".to_owned()))
    .hint(Hint::Resident(true)) // this is not supported by all implementations
    .timeout(0) // this however is
    .show()?;

Linux/BSD support

The main audience of this library are Linux/BSD based desktop environments that follow the XDG specification (see gnome dev docs or libnotify docs). These include KDE, Gnome, XFCE, LXDC, Mate (and probably also most others that I haven't personally tested).

Features

images

Enables sending of images with notifications. This is only supported on XDG. This will add the image crate as a dependency as well as lazy_static to determine the supported spec spec-version on startup.

d

Enables the usage of dbus-rs instead of zbus (also XDG only). This is functionally identical to the default feature set. As long as you still compile with default-features this will only enable dbus-rs usage, but not default to it! In order to use the dbus-rs implementation set the environment variable DBUSRS or compile notify-rust with --no-default-features.

macOS support

This library shines on linux and bsd, which is its original target platform. Lately it gained support for macOS thanks to mac-notification-sys. However this only includes a small subset of the current functionality, since NSNotifications don't have as many features.

call for participation: You are a versed macOS UI developer with mad Objective-C skillz? PRSV.

Windows support

Similar to macOS we support windows via the help of winrt-notification.

Commandline tool

Checkout toastify, it exposes most of the functionality of the lib to the commandline.

Contribution

Any help in form of descriptive and friendly issues or comprehensive pull requests are welcome!

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in notify-rust by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Conventions

The Changelog of this library is generated from its commit log, there any commit message must conform with https://www.conventionalcommits.org/en/v1.0.0/. For simplicity you could make your commits with convco.

notify-rust's People

Contributors

allenbenz avatar antonshkurenko avatar danieldulaney avatar guillermoap avatar h4llow3en avatar hoodie avatar ignatenkobrain avatar illegalprime avatar j0ru avatar lucasfernog avatar mic92 avatar nicos68 avatar osa1 avatar palfrey avatar panicbit avatar quintonn avatar renovate-bot avatar renovate[bot] avatar rnestler avatar steveklabnik avatar timvisee avatar tpraxl avatar valpackett avatar vbuell avatar wnklmnn avatar zeenix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

notify-rust's Issues

Memory leak on Mac

I am new to this so sorry if I am missing any information. When sending a notification on a separate thread a program will begin to consume more and more memory. This can be observed by writing a simple program that spawns a thread and then sends a notification from it. I suspect this issue may actually live in mac-notification-sys. I have observed this issue on macOS High Sierra.

Example:

extern crate notify_rust;

use notify_rust::Notification;
use std::thread::{sleep,spawn};
use std::time::Duration;

fn notify() {
   Notification::new()
       .summary("Firefox News")
       .body("This will look like a real notification.")
       .show()
       .unwrap();
}

fn main() {
    println!("Starting loop");
    loop{
        spawn(|| {
            println!("In the thread.");
            notify();
        });
        let dur = Duration::from_secs(5);
        sleep(dur);
    }
}

Implement icons and images

Greatings brave contributor 🧙
Behold! This issue has remained unresolved for many a month. Are you cunning enough to resolve it? Study the ancient scrolls! Challenge the congenialness of the great implementations Gnome, KDE and Unity. Proclaim your victory by filing a pull request.

Good luck traveler!

Actions not working

Waiting for actions using show_and_wait_for_action results in blocking forever (the handler never gets called).

Windows Support?

Do you have any plans to add Windows Support? I am a beginner in Rust and I was looking for a library to send notifications on Windows but I could not find anything.

I read about it a bit and there are system calls that you need to make to send different types of notifications. The WinAPI crate probably has support for all the syscalls we'll need for this library(or if it doesn't has some syscalls, I can create issues for it there and work that out.).
So, It should not be difficult to add windows support in this library.

I can start working on this If you are interested in adding windows support to this library.

Support for other OSes

I noticed the comment over at #10 (comment), which seemed to indicate that there is some interest in supporting notification support for other platforms through the same library. I think that would be really nice too, and having a tracking issue for it is a good start.

Understanding notification image data

I don't seem to understand how to set an image for a notification. The examples provide the following API:

Notification::new().hint(Hint::ImageData(image));
// and
Notification::new().image_data(image);

But there's nothing about it in the documentation. How can I set an image for the notification?
I've tried creating a temporary image and pass the path to Hint::ImagePath or image_path, but the notification won't display it. It might be because the image gets deleted as soon as the program exists the scope.

Please help me understand it.

Allow constructing a notification handle from an existing notification's ID

It would be useful to be able to query the ID of a notification and then construct a NotificationHandle later from the ID. This would make it possible to store the ID in a file and access the notification later, possibly from another process.

An example use case for something like this can be found in notify-send.sh. Currently, I can't replicate this, as notify-rust doesn't expose notifications' IDs.

Cannot handle gdbus CLI notifications

  1. Launch dbus-monitor: dbus-monitor --session "interface='org.freedesktop.Notifications'"
  2. Send notification from the CLI (Change /path/to/icon.png):
gdbus call --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications --method org.freedesktop.Notifications.Notify gdbus "1" /path/to/icon.png Volume "69%" '[]' '{"urgency": <byte 0>}' 'int32 1000' 
  1. Notice dbus-monitor output, specifically that there is an empty array specifying the actions:
   string "gdbus"
   uint32 1
   string "/usr/share/icons/Vibrancy-Colors/status/96/audio-volume-medium.png"
   string "Volume"
   string "69%"
   array [
   ]
   array [
      dict entry(
         string "urgency"
         variant             byte 0
      )
   ]
   int32 1000
  1. Run toastify as a server: toastify server
  2. Repeat Step 2.
  3. Notice toastify crash & that the output from dbus-monitor now shows a string instead of an empty array:
   string "gdbus"
   int32 1
   string "/usr/share/icons/Vibrancy-Colors/status/96/audio-volume-medium.png"
   string "Volume"
   string "69%"
   string "[]"
   array [
      dict entry(
         string "urgency"
         variant             byte 0
      )
   ]
   int32 1000

The libnotify-rust crash happens at line 84 of server.rs.

In the crash case:

(gdb) p action_items
$2 = Str = {"[]"}

In the normal case:

(gdb) p action_items
$1 = (struct Vec<dbus::message::MessageItem> *) 0x7ffff5ffd6d8

What is particularly odd to me is that having toastify server running is enough to completely change the datatype of the message showing up in dbus-monitor.

Removing L83-85 and replacing with let actions:Vec<String> = vec![] fixes the crash, but not the wrong datatype in dbus-monitor.

throw error when build example

  1. run example 1 on rustc 1.16.0-nightly (4ecc85beb 2016-12-28)

2.run cargo run --release

I got the message
rror[E0432]: unresolved importdbus::Error--> /Users/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-3.2.1/src/lib.rs:93:9 | 93 | pub use dbus::Error; | ^^^^^^^^^^^ Did you meanserver::dbus`?

error[E0432]: unresolved import dbus::MessageItem
--> /Users/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-3.2.1/src/util.rs:2:5
|
2 | use dbus::MessageItem;
| ^^^^^^^^^^^^^^^^^ Did you mean server::dbus?

error[E0432]: unresolved import dbus::Connection
--> /Users/leo/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-3.2.1/src/server.rs:15:12
|
15 | use dbus::{Connection, BusType, NameFlag, ConnectionItem, Message, MessageItem};
| ^^^^^^^^^^ Did you mean self::dbus?

and more like following

error[E0412]: unresolved type Message
error[E0433]: failed to resolve. Use of undeclared type or module MessageItem
error[E0433]: failed to resolve. Use of undeclared type or module ConnectionItem

Update to dbus 0.7.x

It looks like the dbus dependency made breaking changes between their 0.6 and 0.7 releases, with a plan to deprecate the current MessageItem-based API.

This is an issue for crates that want to use both notify-rust and a newer version of dbus, because the two versions cannot coexist -- they each attempt to independently link to the dbus native library.

Hint::CustomInt doesn't work well

I'm on archlinux, i3wm, xfce4-notifyd. If I just show the bar there are no problems.
But if I update the value quickly the bar goes crazy. it's not fluid. It even goes back sometimes.

extern crate notify_rust;
fn main() {
    let mut notification = notify_rust::Notification::new().show().unwrap();
    for i in 0..100 {
        notification.hint(notify_rust::Hint::CustomInt("value".to_string(), i));
        std::thread::sleep(std::time::Duration::from_millis(100));
        notification.update();
    }
}

Add a non-blocking alternative to wait_for_action

From what I could gather by looking at the API docs, the only current alternative to wait_for_action is to reinvent the whole thing as part of another event loop, even if all the user wants to do is listen for a few extra D-Bus signals.

It'd really help if wait_for_action were refactored so that it's not necessary to copy-and-paste the relevant bits into dependent projects which want to run more general event loops.

Notifications randomly don't appear on Windows

Most of the time notifications get sent out but occasionally they don't. There doesn't seem to be any relation with how quickly they're sent out. I've tested seconds apart and as much as 20 minutes apart. No errors are reported.

MCVE

# Cargo.toml
[package]
name = "pomo"
version = "0.1.0"
edition = "2018"

[dependencies]
notify-rust = "4.0.0"
// src/main.rs
use notify_rust::{Notification, Timeout};

fn main() {
    Notification::new()
        .appname("Pomo")
        .summary("Break time!")
        .timeout(Timeout::Milliseconds(6000))
        .show()
        .unwrap();
}
  • OS: Windows 10
  • rustc: 1.44.1

to monitor all notification

I couldn't find any discussion tab. That's why I'm creating a new issue.

Can I use this library to observe/monitor all notification?

Thanks.

Change GitHub "About" section to reflect supported OSes?

Right now, the "About" section on GitHub says:

Send Desktop Notifications on linux and bsd

I initially moved on from looking at this library as I was looking for full cross platform support, but I later realized that later in the README it mentions Windows and OSX support. Could the "About" be updated to something reflecting that? A few ideas:

  • Send desktop notifications on all major operating systems
  • Send desktop notifications on Linux, BSD, OSX, and Windows

Change notification icon size

Hi,

thanks for this awesome library !

I was wondering if it was possible to change the size of the icon like so for example

Notification::new()
    .summary("Hello")
    .body("How are you")
    .icon("/path/to/icon.png")
    .icon_size(128) // change the size of the icon
    .show()
    .unwrap();

All dependencies are outdated

Please consider updating the dbus crate from 0.4.1 to 0.6.3.

Currently when compiling there is a warning about a "redundant linker flag" for dbus, that has been resolved in newer versions of the dbus crate.
Also security issues and such, but this redundant linker flag is much more important.
Also image crate from 0.19 to 0.20.0.
Also lazy_static crate from 1.0 to 1.1.0.

Sudo or root

Hi. Unfortunately, in my script i need to use sudo to get root access but notify-rust didn't work when you are using root account or sudo.

cannot build a simple example on mac os x

extern crate notify_rust;
use notify_rust::Notification;

fn main() {

    Notification::new()
        .summary("Timer")
        .body("Done")
        .icon("Emacs")
        .appname("Emacs")
        .timeout(5000)
        .show().unwrap();

}

here's the build output

cargo build --verbose
       Fresh libc v0.1.10
       Fresh dbus v0.1.2
   Compiling timer v0.1.0 (file:///Users/SumProxy/Projects/rust/timer)
     Running `rustc src/main.rs --crate-name timer --crate-type bin -g --out-dir /Users/SumProxy/Projects/rust/timer/target/debug --emit=dep-info,link -L dependency=/Users/SumProxy/Projects/rust/timer/target/debug -L dependency=/Users/SumProxy/Projects/rust/timer/target/debug/deps --extern notify_rust=/Users/SumProxy/Projects/rust/timer/target/debug/deps/libnotify_rust-dbaf7a929546de3e.rlib`
       Fresh notify-rust v3.0.0
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "/Users/SumProxy/Projects/rust/timer/target/debug/timer.0.o" "-o" "/Users/SumProxy/Projects/rust/timer/target/debug/timer" "-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "-Wl,-dead_strip" "-nodefaultlibs" "/Users/SumProxy/Projects/rust/timer/target/debug/deps/libnotify_rust-dbaf7a929546de3e.rlib" "/Users/SumProxy/Projects/rust/timer/target/debug/deps/libdbus-7b7d4fd1995736ee.rlib" "/Users/SumProxy/Projects/rust/timer/target/debug/deps/liblibc-144c435538abd757.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-198068b3.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-198068b3.rlib" "-L" "/Users/SumProxy/Projects/rust/timer/target/debug" "-L" "/Users/SumProxy/Projects/rust/timer/target/debug/deps" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/SumProxy/Projects/rust/timer/.rust/lib/x86_64-apple-darwin" "-L" "/Users/SumProxy/Projects/rust/timer/lib/x86_64-apple-darwin" "-l" "dbus-1" "-l" "c" "-l" "m" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m" "-l" "compiler-rt"
note: ld: warning: directory not found for option '-L/Users/SumProxy/Projects/rust/timer/.rust/lib/x86_64-apple-darwin'
ld: warning: directory not found for option '-L/Users/SumProxy/Projects/rust/timer/lib/x86_64-apple-darwin'
ld: library not found for -ldbus-1
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
Could not compile `timer`.

Caused by:
  Process didn't exit successfully: `rustc src/main.rs --crate-name timer --crate-type bin -g --out-dir /Users/SumProxy/Projects/rust/timer/target/debug --emit=dep-info,link -L dependency=/Users/SumProxy/Projects/rust/timer/target/debug -L dependency=/Users/SumProxy/Projects/rust/timer/target/debug/deps --extern notify_rust=/Users/SumProxy/Projects/rust/timer/target/debug/deps/libnotify_rust-dbaf7a929546de3e.rlib` (exit code: 101)

NotificationClosed not received on timeout from gnome notification-daemon

I'm not sure whether we can fix this or if this is a bug in the gnome notification-daemon but when a notification times out we don't receive a NotificationClosed signal (i.e. the wait_for_close example does not finish when the notification times out).
Note, however, that this works properly with mate-notification-daemon and dunst.

EDIT:
Turns out that notification-daemon only emits NotificationClosed for timeouts when the notification is transient... The spec sadly doesn't mention much on this topic. 😞

Wait ASynchronously

Waiting for actions currently blocks. Offer a non blocking alternative or cfg.

How to get sound_name to work?

I'm on Arch, and have sound-theme-freedesktop installed, and all the sounds can be found in /usr/share/sounds/freedesktop/stereo.

I'm using the convenience method sound_name in the builder pattern and passing "alarm-clock-elapsed", which should play the sound /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga.

However, it just doesn't seem to work. I made sure my sound was all the way up and every other sound is normally working. I understand that not all features may work, but I'm curious as to how anyone else has gotten it working? Am I missing something here?

I've tried on dunst, xfce4-notifyd, lxqt-notificationd, and mate-notification-daemon. https://wiki.archlinux.org/index.php/Desktop_notifications#Notification_servers

"feature `resolver` is required" issues

See https://github.com/hoodie/notify-rust/runs/3625748281?check_suite_focus=true

Error: failed to parse manifest at `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/zvariant_derive-2.8.0/Cargo.toml`
Caused by:
  feature `resolver` is required

  this Cargo does not support nightly features, but if you
  switch to nightly channel you can add
  `cargo-features = ["resolver"]` to enable this feature
Error: The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 101

This is due to zvariant_derive using the Cargo resolver feature from 1.51. You can fix this either by upgrading the version of Rust you build with, or reducing the version requirements on that to something that maybe doesn't use that (haven't looked TBH).

migrate to failure

  • drop error_chain and use failure instead
  • ⚠️ stay compatible with dependent crates!!!!!

Support action to enter text in notification box

I am not sure if it's even possible but I would love to see a feature like this. It opens up a lot of options for an application ex- replying to IMs with mentions without open the App, searching for song and playing from notification directly,

notification size?

Hi, I did already see this ticket: #31 but saw the issue has already been closed and isn't my exact problem. I'm specifically wondering if it's possible to change notification size in general (text size and icon size). On my 4K laptop the notification is extremely tiny - it's way smaller than the notifications I get from any other application - so I don't think it's a system limitation. Any idea of how to bump up the size of the notification? Or maybe just to get it to respect scaling set within a linux system?

I'm using Arch Linux

(De)Serialization

Implement conversion from Notifications to Messages on the client and vice versa on the server side.
This enables much better testing.

subsequent notifications on the same Notification object misbehave

For the rust program, two notification popups will show up, for the C program the existent popup will be updated, which is the expected behavior.

C program:

#include <libnotify/notify.h>

void main() {
	notify_init("Foo");

	NotifyNotification *notification;

	notification = notify_notification_new("", NULL, NULL);
	notify_notification_set_timeout(notification, 1500);
	notify_notification_set_hint(notification, "x-canonical-private-synchronous", g_variant_new_string(""));

	notify_notification_update(notification, "blah", NULL, "audio-volume-medium");
	notify_notification_set_hint(notification, "value", g_variant_new_int32(60));

	notify_notification_show(notification, NULL);
	sleep(1);

	notify_notification_set_hint(notification, "value", g_variant_new_int32(80));

	notify_notification_show(notification, NULL);
}

equivalent rust program:

extern crate notify_rust;
use notify_rust::*;
use std::time::Duration;
use std::thread;

fn main() {
    let mut notify = Notification::new();

    notify
        .appname("Foo")
        .timeout(1500)
        .hint(NotificationHint::Custom(String::from("x-canonical-private-synchronous"), String::from("")))
        .hint(NotificationHint::CustomInt(String::from("value"), 60))
        .summary("blah")
        .icon("audio-volume-medium");

    notify.show().unwrap();

    thread::sleep(Duration::from_millis(1000));

    notify
        .hint(NotificationHint::CustomInt(String::from("value"), 80));

    notify.show().unwrap();
}

Subsequent notifications

I need to show multiple subsequent notifications with different timeouts, for example:

  1. notification 10s timeout, urgency normal
  2. notification 60s timeout, urgency critical
  3. notification 10s timeout, urgency normal

I've found, if I use update() method, it only updates texts, etc, but doesn't update urgency and timeout, if I use close-show, like:

  1. close prev notification, if available
  2. show next one, save it

It closes notifications randomly, sometimes without even showing next one

Running with 'sudo', throws 'D-Bus error'

Hey,

Thank for the project! I am using that in my toy Rust projects. :)

The program crashes when i run it with sudo. Error backtrace is here:

Error(Dbus(D-Bus error: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken. (org.freedesktop.DBus.Error.NoReply)), State { next_error: None, backtrace: InternalBacktrace { backtrace: Some(stack backtrace:
   0: error_chain::backtrace::imp::InternalBacktrace::new::hf39723dd3280a465 (0x55e8475bd668)
   1: <error_chain::State as core::default::Default>::default::heb1b1f6fb40d3c53 (0x55e8475bd3f5)
   2: notify_rust::Notification::show::hc206583a64775c0b (0x55e8475b8dc0)
   3: netlyser::db::notify::h0cabef15b4dafaae (0x55e847576fe9)
   4: netlyser::db::on_hosts_connected::h582bcf0ac31c414e (0x55e847576abf)
   5: netlyser::db::get_notifies::h2da1d8a7154a27a1 (0x55e84757658c)
   6: netlyser::run::run::{{closure}}::hcb8b38a0234e7d3d (0x55e84757e1f2)
   7: std::sys_common::backtrace::__rust_begin_short_backtrace::h05a4a196dc093c28 (0x55e847578048)
   8: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}::h82c7e735bf5113a5 (0x55e847578878)
   9: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hf4b0650defcfcea4 (0x55e847577ff8)
  10: std::panicking::try::do_call::h649352a5dfdd875e (0x55e847599418)
  11: __rust_maybe_catch_panic (0x55e8476e70c9)
  12: <F as alloc::boxed::FnBox<A>>::call_box::h11218ae7ebf5278c (0x55e8475729e2)
  13: std::sys::unix::thread::Thread::new::thread_start::h01a189d1b31d5438 (0x55e8476e63dd)
  14: start_thread (0x7f1dd1e8ca91)
  15: __clone (0x7f1dd1da0cd2)
  16: <unknown> (0x0)) } })', src/libcore/result.rs:997:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: netlyser::db::notify
  10: netlyser::db::on_hosts_connected
  11: netlyser::db::get_notifies
  12: netlyser::run::run::{{closure}}

Thanks! @hoodie

Sudo

Hi bro. I have a problem.
I am working on a pacman wrapper for arch linux so i have to use sudo to launch this package manager.
But unfortunately when i use sudo, your notifier didn't work. If you have a solution ;-)
Good job and great continuation

(sorry for my english :-( )

Support for musl

Compiling for the x86_64-unknown-linux-musl target succeeds, but invoking show() on a notification causes a segfault at runtime.

How would I use notify-rust on musl? Are there any plans to support this?

Give it a try with:

PKG_CONFIG_ALLOW_CROSS=1 cargo run --target="x86_64-unknown-linux-musl" --example simple

notify-cli fails to build on mac os x el capitan

Here's the output

cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading clap v1.4.3
   Compiling ansi_term v0.6.3
   Compiling libc v0.1.10
   Compiling strsim v0.4.0
   Compiling dbus v0.1.2
   Compiling clap v1.4.3
   Compiling notify-rust v3.0.0 (file:///Users/SumProxy/Projects/rust/notify-rust/notify-cli)
   Compiling notify-rust-cli v0.2.0 (file:///Users/SumProxy/Projects/rust/notify-rust/notify-cli)
src/main.rs:97:21: 97:72 error: use of unstable library feature 'result_expect': newly introduced (see issue #27277)
src/main.rs:97             .show().expect("Was not able to send initial test message");
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: in expansion of if let expansion
src/main.rs:79:5: 170:6 note: expansion site
<std macros>:2:1: 2:54 warning: unused result which must be used, #[warn(unused_must_use)] on by default
<std macros>:2 $ dst . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 2:56 note: in expansion of write!
<std macros>:2:1: 2:46 note: expansion site
<std macros>:1:1: 4:66 note: in expansion of writeln!
src/main.rs:159:17: 160:64 note: expansion site
note: in expansion of if let expansion
src/main.rs:114:10: 170:6 note: expansion site
note: in expansion of if let expansion
src/main.rs:106:10: 170:6 note: expansion site
note: in expansion of if let expansion
src/main.rs:79:5: 170:6 note: expansion site
<std macros>:2:1: 2:54 warning: unused result which must be used, #[warn(unused_must_use)] on by default
<std macros>:2 $ dst . write_fmt ( format_args ! ( $ ( $ arg ) * ) ) )
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<std macros>:1:1: 2:56 note: in expansion of write!
<std macros>:2:1: 2:46 note: expansion site
<std macros>:1:1: 4:66 note: in expansion of writeln!
src/main.rs:166:17: 167:64 note: expansion site
note: in expansion of if let expansion
src/main.rs:114:10: 170:6 note: expansion site
note: in expansion of if let expansion
src/main.rs:106:10: 170:6 note: expansion site
note: in expansion of if let expansion
src/main.rs:79:5: 170:6 note: expansion site
error: aborting due to previous error
Could not compile `notify-rust-cli`.

To learn more, run the command again with --verbose.
rustc --version
rustc 1.3.0 (9a92aaf19 2015-09-15)
cargo --version
cargo 0.4.0-nightly (553b363 2015-08-03) (built 2015-08-02)

License of the crate?

There's no license information for the crate. Please add a LICENSE file to the repository.

Mac support

Redirecting from #22 to keep this a little more focused, the Mac support has the following issues:

  1. The following examples don't compile:
  • actions
  • countdown
  • info
  • on_close
  • server
  • update
  • wait_for_closing
  1. Text formatting isn't correct. See the following screenshot for notifications. Note also that clicking the notification takes me to the terminal. I'm not certain if that is the "correct" behavior here.
    screen shot 2017-03-13 at 11 37 07 am
  2. The following examples didn't work correctly:
  • hints (no notifications shown)
  • show_volume (nothing happens)
  • urgency (all notifications are identical and urgency from string doesn't have a title)

Pinging @h4llow3En as they appear to have done most of this work.

Again, there's no mac-specific documentation that I've found, so I'm unsure what I should expect to work or if these are all known issues. So I just posted everything. I'm happy to test code changes and also read over any documentation changes, just let me know. Really excited that cross-platform support is materializing!

make timeout a type

Make Timeout an enum {Default, Never, Milliseconds(u32), Duration} what ever
.timeout() can be made into a generic method, so no breakage, accepting Into<Timeout>.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.