libnotify-0.0.2.1: Haskell binding for Libnotify

Safe HaskellNone

System.Libnotify

Description

System.Libnotify module deals with notification session processing.

Synopsis

Documentation

data Notify a Source

Notification monad. Saves notification context.

data NotifyState Source

Notification state. Contains next rendered notification data.

data NotifyError Source

Libnotify errors.

Constructors

NotifyInitHasFailed

notify_init() has failed.

NewCalledBeforeInit

new has called before notify_init().

Instances

oneShot :: Title -> Body -> Icon -> Maybe [Hint] -> IO (Either NotifyError ())Source

Function for one-time notification with hints perhaps. Should be enough for a vast majority of applications.

withNotifications :: Maybe String -> IO a -> IO (Either NotifyError ())Source

Initializes and uninitializes libnotify API. Any notifications API calls should be wrapped into withNotifications, i.e.

 main = withNotifications (Just "api-name") $ do { ... here are notification API calls ... }

new :: Title -> Body -> Icon -> Notify t -> IO (Either NotifyError (Notification, NotifyState))Source

Creates new notification session. Inside new call one can manage current notification via update or render calls. Returns notification pointer. This could be useful if one wants to update or close the same notification after some time (see continue).

continue :: (Notification, NotifyState) -> Notify a -> IO NotifyStateSource

Continues old notification session.

update :: Maybe Title -> Maybe Body -> Maybe Icon -> Notify BoolSource

Updates notification Title, Body and Icon. User can update notification partially, passing Nothing to arguments that should not changed.

render :: Notify BoolSource

Shows notification to user.

close :: Notify BoolSource

Closes notification.

setTimeout :: Timeout -> Notify ()Source

Sets notification Timeout.

setCategory :: Category -> Notify ()Source

Sets notification Category.

setUrgency :: Urgency -> Notify ()Source

Sets notification Urgency.

addHint :: Hint -> Notify ()Source

Adds Hint to notification.

removeHints :: Notify ()Source

Removes hints from notification.

addAction :: String -> String -> (Notification -> String -> IO ()) -> Notify ()Source

Adds action to notification.

removeActions :: Notify ()Source

Removes actions from notification.

setIconFromPixbuf :: Pixbuf -> Notify ()Source

Sets notification icon from pixbuf

setImageFromPixbuf :: Pixbuf -> Notify ()Source

Sets notification image from pixbuf