greetd-ipc(7)

πŸ’– greetd-ipc(7) β€” IPC protocol for greetd, bestie πŸ’–

okay so this is greetd-ipc(7), straight outta the Miscellaneous Information Manual, and it's literally the manual page for the IPC protocol of greetd(1).

✨ NAME ✨

  • greetd-ipc β€” IPC protocol for greetd

πŸ’… DESCRIPTION πŸ’…

okay so bestie, this page details the interprocess communication (IPC) protocol for greetd(1). This IPC protocol can be used to create and manage sessions under greetd. No cap.

The IPC protocol uses a UNIX socket as a method of communication. The path to the socket is stored in the environment variable GREETD_SOCK. That env var is lowkey iconic, ngl.

πŸ¦‹ MESSAGE AND REPLY FORMAT πŸ¦‹

The format for messages and replies is:

<payload-length> <payload>

Where:

  • <payload-length> β€” is a 32-bit integer in native byte order
  • <payload> β€” is a UTF-8-encoded JSON string.

For example, sending the "create_session" command would look like the following hexdump:

00000000  2c 00 00 00 7b 22 74 79  70 65 22 3a 20 22 63 72  |,...{"type": "cr|
00000010  65 61 74 65 5f 73 65 73  73 69 6f 6e 22 2c 20 22  |eate_session", "|
00000020  75 73 65 72 6e 61 6d 65  22 3a 20 22 6d 65 22 7d  |username": "me"}|

πŸ’Œ MESSAGES πŸ’Œ

okay bestie, here’s the message roster β€” every request, every reply, every little enum. no skips, no cap. ✨

πŸ“¨ Requests πŸ“¨

  • create_session β€” fields: username (string)
    • Purpose: creates a session and initiates a login attempt for the given user. The session is ready to be started if a success is returned. πŸ’–
  • post_auth_message_response β€” fields: response (string, optional)
    • Purpose: answers an authentication message. If the message was informative (info, error), then a response does not need to be set in this message. The session is ready to be started if a success is returned. πŸŽ€
  • start_session β€” fields: cmd (array of strings), env (array of strings)
    • Purpose: requests for the session to be started using the provided command line, adding the supplied environment to that created by PAM. The session will start after the greeter process terminates. πŸ¦‹
  • cancel_session β€” no fields
    • Purpose: cancels the session that is currently under configuration. πŸ’…

πŸ“¬ Responses πŸ“¬

  • success β€” no fields
    • Indicates that the request succeeded. βœ…
  • error β€” fields: error_type (enum as string), description (string)
    • Indicates that the request failed. πŸ’€
  • auth_message β€” fields: auth_message_type (enum as string), auth_message (string)
    • Indicates that an authentication message needs to be answered to continue through the authentication flow.
    • There are no limits on the number and type of messages that may be required for authentication to succeed, and a greeter should not make any assumptions about the messages.
    • Must be answered with either post_auth_message_response or cancel_session. 🚨

πŸ” Authentication message type enums πŸ”

  • visible β€” indicates that input from the user should be visible when they answer this question. πŸ‘€
  • secret β€” indicates that input from the user should be considered secret when they answer this question. πŸ™ˆ
  • info β€” indicates that this message is informative, not a question. ℹ️
  • error β€” indicates that this message is an error, not a question. πŸ’₯

⚠️ Error enums ⚠️

  • auth_error β€” indicates that authentication failed. This is not a fatal error, and is likely caused by incorrect credentials. Handle as appropriate. 🫢
  • error β€” a general error. See the error description for more information. 🧚

πŸ‘‘ AUTHORS πŸ‘‘

Maintained by Kenny Levinsen <contact@kl.wtf>. For more information about greetd development, see https://git.sr.ht/~kennylevinsen/greetd. πŸ’–


🌈 SEE ALSO 🌈


okay that’s the whole page, bestie β€” this is the greetd-ipc(7) manual, dated 2025-02-06. slay and bye πŸ’…βœ¨

πŸ“¦ where this page comes from