Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

PHP based Linux Notification library

The library can be extended by adapter. Currently we deliver one default adapter which needs external tool "notify-send".

Installation

composer.phar require "cmuench/lib.notify=dev-master"

External tool installation

Ubuntu

Can be installed via apt (universal package)

sudo apt-get install libnotify-bin

Supported Adapters

  • Standard: external libnotify command
  • PHP Module DBus (pecl install dbus)

Example-Usage

<?php

require_once __DIR__ . '/../vendor/autoload.php';

use \CMuench\LibNotify;
use \CMuench\LibNotify\Adapter\DbusModuleAdapter; // dbus adapter if used

$client = new LibNotify\Client();
// $client = new LibNotify\Client(new DbusModuleAdapter());  // use php dbus module

$client->send(
    'Summary',
    'Body text',
    LibNotify\Urgency\Level::CRITICAL(),
    LibNotify\Icon\Library\Gnome\Status::DIALOG_WARNING
);

Icon Library

The icon library was generated by this bash commands:

find /usr/share/icons/gnome/32x32/actions -type f -name "*.png" -exec bash -c 'echo -n "const "; basename {} .png | tr "[:lower:]" "[:upper:]" | tr "-" "_" | tr "\n" "="; echo -n \"{}\"; echo ";" ' \; >> <path_to_php_file>
find /usr/share/icons/Humanity/categories/32 -type f -name "*.svg" -exec bash -c 'echo -n "const "; basename {} .svg | tr "[:lower:]" "[:upper:]" | tr "-" "_" | tr "\n" "="; echo -n \"{}\"; echo ";" ' \; >> <path_to_php_file>

About

Linux desktop notification library

Resources

License

Packages

No packages published

Languages