| Copyright | (c) Hazel (Vawlpe) 2022 |
|---|---|
| License | GPL-3.0-or-later |
| Maintainer | vawlpe@gmail.com |
| Stability | experimental |
| Portability | Linux |
| Safe Haskell | None |
| Language | Haskell2010 |
HGreet.Client
Description
To use this module, first get the path to the socket of the greetd daemon from the environment variable GREETD_SOCK. This requires the greetd daemon to be running.
Then you can communicate with greetd using the withSocketDo function of this module, passing it a callback function that will have direct acccess to the open socket.
For a simplified communication scheme you can implement a handler and pass it to handleResponse alongside the socket and command to run on successful authentication.
Documentation
Arguments
| :: Socket | Open socket to the greetd daemon, usually obtained from the callback of a |
| -> Request |
|
| -> IO () | Empty IO action result. |
Arguments
| :: Socket | Open socket to the greetd daemon, usually obtained from the callback of a |
| -> IO Response |
|
Arguments
| :: (Response -> IO PromptResult) | Handler function that will be called for every response from greetd. |
| -> Response | Response from greetd that will be passed to the handler function. |
| -> Socket | Open socket to the greetd daemon, usually obtained from the callback of a |
| -> [String] | List of strings to pass as the command to execute to start session after authentication. |
| -> IO () | Empty IO action result. |
data PromptResult Source #
Constructors
| Success | Successful prompt result. |
| Error | Error prompt result. |
| Info | Info prompt result. |
| Auth String | Auth prompt result. |
Instances
| Eq PromptResult Source # | |
Defined in HGreet.Client | |
| Show PromptResult Source # | |
Defined in HGreet.Client Methods showsPrec :: Int -> PromptResult -> ShowS # show :: PromptResult -> String # showList :: [PromptResult] -> ShowS # | |
| Generic PromptResult Source # | |
Defined in HGreet.Client Associated Types type Rep PromptResult :: Type -> Type # | |
| type Rep PromptResult Source # | |
Defined in HGreet.Client type Rep PromptResult = D1 ('MetaData "PromptResult" "HGreet.Client" "hgreet-0.1.0.0-L18MbcRjDZbE3raonslubm" 'False) ((C1 ('MetaCons "Success" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Error" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Info" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Auth" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) | |