Skip to content
Libnotify for Crystal
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
crystal_lib
images
spec
src
.gitignore
.travis.yml
LICENSE
Makefile
README.md
shard.yml

README.md

Libnotify for Crystal

Build Status Shard version

Bindings for GNOME's Libnotify.

For the Ruby version see https://rubygems.org/gems/libnotify.

libnotify

Installation

Add this to your application's shard.yml:

dependencies:
  libnotify:
    github: splattael/libnotify.cr
    version: ~> 0.2.0

Linux

apt-get install libnotify # debian
pacman -S libnotify       # archlinux
dnf install libnotify     # fedora

Usage

require "libnotify"

n = Libnotify.show do |notify|
  notify.summary    = "hello"
  notify.body       = "world"
  notify.timeout    = 1.5
  notify.timeout    = 1500
  notify.urgency    = :critical   # :low, :normal, :critical
  notify.append     = false       # default true
  notify.transient  = true        # default false
  notify.icon_path  = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
end

n = Libnotify.new(summary: "big", body: "body text").show
sleep 1
n.body = "hello world"
n.update.show

Development

$ make update
$ make spec

Linux

apt-get install libnotify-dev # debian
pacman -S libnotify           # archlinux
dnf install libnotify         # fedora

Generate libnotify/c.cr

$ git clone https://github.com/crystal-lang/crystal_lib
$ cd crystal_lib
$ ./main < ../libnotify.cr/crystal_lib/libnotify.cr  > ../libnotify.cr/src/libnotify/c.cr

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Release

  • Make sure make spec is green
  • Commit all changes
  • Bump version in src/libnotify/version.cr
  • Adjust version in README.md and shard.yml
  • make release

Contributors

  • splattael Peter Leitzen - creator, maintainer
  • Nephos Arthur Poulet - contributor
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.