Skip to content

htngr/tray-hs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tray-hs - bindings to dmikushin/tray, a cross platform Linux/Windows/MacOS tray

Usage

See demo/Main.hs:

import Graphics.Tray

tray :: TrayPtr -> Tray
tray self = Tray 
    { trayIcon = "document-edit-symbolic"
    , trayTooltip = "Hello From Haskell"
    , trayMenu =
       [ defaultMenuItem
           { menuText = Just "Hi"
           , menuIsCheckbox = True
           , menuCallback = modifyItem self $
               \it -> it { menuText = (<> "a") <$> menuText it}
           }
       , defaultMenuItem
           { menuText = Just "Bye"
           , menuCallback = exitTray
           }
        ]
    }

main :: IO ()
main = runTrayLoop tray $
    \_ ->
        return ()

Run with nix run git+http://github.com/htngr/tray-hs?submodules=1

About

tray-hs - bindings to https://github.com/dmikushin/tray, a cross platform Linux/Windows/MacOS tray

Resources

License

Stars

Watchers

Forks

Packages

No packages published