notifications-tray-icon 0.1.0.0 → 0.1.1.0
raw patch · 5 files changed
+17/−16 lines, 5 filesdep ~github
Dependency ranges changed: github
Files
- README.md +2/−5
- app/Main.hs +1/−0
- notifications-tray-icon.cabal +7/−7
- src/StatusNotifier/Item/Notifications/GitHub.hs +4/−3
- src/StatusNotifier/Item/Notifications/OverlayIcon.hs +3/−1
README.md view
@@ -1,4 +1,6 @@ # notifications-tray-icon++[](https://hackage.haskell.org/package/notifications-tray-icon) [](http://stackage.org/lts/package/notifications-tray-icon) [](http://stackage.org/nightly/package/notifications-tray-icon) notifications-tray-icon provides an SNI tray icon that polls a notification source and provides a menu with actions from that notification source. It will@@ -9,8 +11,3 @@ For the time being, github is the only supported notification source. Support for gmail and other sources should be coming soon.--# Installation--For the time being, notifications-tray-icon must be installed from source using-stack.
app/Main.hs view
@@ -166,4 +166,5 @@ ( fullDesc <> progDesc "Run a notification monitoring tray icon" )+ -- TODO: Come up with a better way to hang indefinitely void $ forever $ threadDelay 999999999999999999
notifications-tray-icon.cabal view
@@ -1,13 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.31.2.+-- This file has been generated from package.yaml by hpack version 0.34.4. -- -- see: https://github.com/sol/hpack------ hash: 57d00db35b1fdd85c3ea68c5fdddd0d1d63f7b670e89007b5658006f1f6b1658 name: notifications-tray-icon-version: 0.1.0.0+version: 0.1.1.0 description: Please see the README on GitHub at <https://github.com/IvanMalison/notifications-tray-icon#readme> homepage: https://github.com/IvanMalison/notifications-tray-icon#readme bug-reports: https://github.com/IvanMalison/notifications-tray-icon/issues@@ -35,7 +33,8 @@ Paths_notifications_tray_icon hs-source-dirs: src- default-extensions: OverloadedStrings+ default-extensions:+ OverloadedStrings build-depends: aeson , async@@ -46,7 +45,7 @@ , gi-dbusmenu , gi-gio , gi-glib- , github >=0.22+ , github >=0.24 , hslogger , http-conduit , http-types@@ -64,7 +63,8 @@ Paths_notifications_tray_icon hs-source-dirs: app- default-extensions: OverloadedStrings+ default-extensions:+ OverloadedStrings ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: base >=4.7 && <5
src/StatusNotifier/Item/Notifications/GitHub.hs view
@@ -22,6 +22,7 @@ import qualified GitHub.Auth as Auth import GitHub.Data import GitHub.Endpoints.Activity.Notifications+import GitHub.Request import Network.HTTP.Simple import Network.HTTP.Types import StatusNotifier.Item.Notifications.Util@@ -51,7 +52,7 @@ , ghRefreshSeconds = refreshSeconds } update = do - let getNotificationsFromGitHub = getNotifications auth+ let getNotificationsFromGitHub = executeRequest auth $ getNotificationsR FetchAll logAndShow :: (Show v) => Priority -> String -> v -> IO () logAndShow level message value = ghLog level $ printf message (show value)@@ -63,7 +64,7 @@ let forceRefresh = void $ MV.tryPutMVar forceRefreshVar () delayedRefresh = void $ forkIO $ threadDelay 1000000 >> forceRefresh openNotificationsHTML = openURL "https://github.com/notifications"- markAllRead = markNotificationsAsRead auth+ markAllRead = executeRequest auth markAllNotificationsAsReadR getCurrentNotifications = MV.readMVar notificationsVar buildMenu = do notifications <- getCurrentNotifications@@ -139,7 +140,7 @@ } = do let notificationText = T.pack $ getNotificationSummary notification openHTML = openNotificationHTML auth notification- markAsRead = markNotificationAsRead auth thisNotificationId+ markAsRead = executeRequest auth $ markNotificationAsReadR thisNotificationId menuItem <- menuitemNewWithId $ fromIntegral $ untagId thisNotificationId textVariant <- liftIO $ toGVariant notificationText
src/StatusNotifier/Item/Notifications/OverlayIcon.hs view
@@ -20,6 +20,7 @@ import StatusNotifier.Item.Notifications.Util import qualified StatusNotifier.Watcher.Client as W import System.Log.Logger+import qualified GI.Gio.Objects.Cancellable type UpdateNotifications = Int -> Menuitem -> IO () @@ -52,7 +53,8 @@ root <- menuitemNew currentRoot <- newMVar root - connection <- Gio.busGetSync Gio.BusTypeSession Gio.noCancellable+ connection <- Just <$> GI.Gio.Objects.Cancellable.cancellableNew >>=+ Gio.busGetSync Gio.BusTypeSession Gio.busOwnNameOnConnection connection menuBusText [] Nothing Nothing menuServer <- serverNew menuPathText