Safe Haskell | None |
---|
System.Libnotify
Description
System.Libnotify module deals with notification session processing.
- data Notify a
- data NotifyState
- data NotifyError
- oneShot :: Title -> Body -> Icon -> Maybe [Hint] -> IO (Either NotifyError ())
- withNotifications :: Maybe String -> IO a -> IO (Either NotifyError ())
- new :: Title -> Body -> Icon -> Notify t -> IO (Either NotifyError (Notification, NotifyState))
- continue :: (Notification, NotifyState) -> Notify a -> IO NotifyState
- update :: Maybe Title -> Maybe Body -> Maybe Icon -> Notify Bool
- render :: Notify Bool
- close :: Notify Bool
- setTimeout :: Timeout -> Notify ()
- setCategory :: Category -> Notify ()
- setUrgency :: Urgency -> Notify ()
- addHint :: Hint -> Notify ()
- removeHints :: Notify ()
- addAction :: String -> String -> (Notification -> String -> IO ()) -> Notify ()
- removeActions :: Notify ()
- setIconFromPixbuf :: Pixbuf -> Notify ()
- setImageFromPixbuf :: Pixbuf -> Notify ()
- module System.Libnotify.Types
Documentation
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 |
|
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
continue :: (Notification, NotifyState) -> Notify a -> IO NotifyStateSource
Continues old notification session.
setTimeout :: Timeout -> Notify ()Source
Sets notification Timeout
.
setCategory :: Category -> Notify ()Source
Sets notification Category
.
setUrgency :: Urgency -> Notify ()Source
Sets notification Urgency
.
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
module System.Libnotify.Types