Skip to content

session

Utils functions to check current macOS session status

Functions:

is_display_asleep

is_display_asleep() -> bool

Function to check if the display is asleep Command: ioreg -n IODisplayWrangler -r

Returns:

  • bool

    True if display is asleep, False otherwise

is_screen_locked

is_screen_locked() -> bool

Function to check if current macOS session is locked

Returns:

  • bool

    True if macOS session is locked (login screen), False otherwise

is_user_logged_in

is_user_logged_in() -> bool

Function to check if the current user is logged in (not on the login window)

Returns:

  • bool

    True if user logged in (not on the login window), False otherwise