fdo-notify 0.3 → 0.3.1
raw patch · 2 files changed
+14/−4 lines, 2 files
Files
- DBus/Notify.hs +13/−3
- fdo-notify.cabal +1/−1
DBus/Notify.hs view
@@ -25,6 +25,7 @@ , Timeout (..) , Action (..) , Image+ , Icon (..) , Category (..) , UrgencyLevel (..) , Hint (..)@@ -94,7 +95,7 @@ -- |Contents of a notification data Note = Note { appName :: String- , appImage :: Maybe Image+ , appImage :: Maybe Icon , summary :: String , body :: Maybe Body , actions :: [(Action, String)]@@ -130,6 +131,13 @@ newtype Image = Image { bitmap :: String } deriving (Eq, Show) +-- |An Icon is either a path to an image, or a name in an icon theme+data Icon = File FilePath | Icon String+ deriving (Eq, Show)++iconString (File fp) = "file://" ++ fp+iconString (Icon name) = name+ -- |Urgency of the notification. Notifications may be prioritised by urgency. data UrgencyLevel = Low | Normal@@ -141,6 +149,7 @@ | Category Category -- DesktopEntry ApplicationDesktopID | ImageData Image+ | ImagePath Icon | SoundFile FilePath | SuppressSound Bool | X Int32@@ -189,7 +198,7 @@ args = map ($ note) [ toVariant . appName , const $ toVariant (replaceId::Word32)- , toVariant . fromMaybe "" .fmap bitmap . appImage+ , toVariant . fromMaybe "" . fmap iconString . appImage , toVariant . summary , toVariant . fromMaybe "" . fmap flattenBody . body , toVariant . actionsArray . actions@@ -252,7 +261,8 @@ hint :: Hint -> (String, Variant) hint (Urgency u) = ("urgency", toVariant (fromIntegral $ fromEnum u :: Word8)) hint (Category c) = ("category", toVariant $ catName c)- hint (ImageData i) = ("image_data", toVariant $ bitmap i)+ hint (ImagePath p) = ("image-path", toVariant $ iconString p)+ hint (ImageData i) = ("image-data", toVariant $ bitmap i) hint (SoundFile s) = ("sound-file", toVariant s) hint (SuppressSound b) = ("suppress-sound", toVariant b) hint (X x) = ("x", toVariant x)
fdo-notify.cabal view
@@ -1,5 +1,5 @@ name: fdo-notify-version: 0.3+version: 0.3.1 synopsis: Desktop Notifications client description: A library for issuing notifications using FreeDesktop.org's Desktop