Skip to content

.desktop.app

The app API area of the Liatir API provides methods to retrieve system-level information. Use this API area when you need to access details about the app environment and OS.

Methods

AppInfo structure

The AppInfo object returned by info() contains the following fields:

FieldTypeDescription
archstringThe system architecture (e.g., x64, arm64).
current_dirstringThe current working directory of the app process.
exec_dirstringThe directory where the app executable is located.
exec_pathstringThe full path to the app executable file.
has_main_windowbooleanIndicates whether the app currently has a main window open.
is_debugbooleanIndicates if the app is running in debug mode.
namestringThe display name of the application.
now_unix_msnumberThe current timestamp in milliseconds since Unix epoch.
osstringThe operating system platform (e.g., win32, darwin).
pidnumberThe process ID of the running app instance.
primary_screenAppScreenInfoInformation about the primary display screen.
screensAppScreenInfo[]Array of information objects for all connected display screens.
temp_dirstringThe path to the temporary directory used by the app.
versionstringThe version of the Liatir app.
windowsAppWindowInfo[]Array of information objects for all open app windows.

IMPORTANT

AppInfo fields are always snake_case in both Node and Python, because they come from the JSON response of the Liatir bridge.

AppWindowInfo

FieldTypeDescription
labelstringThe window's label or identifier.
widthnumberThe window's width in pixels.
heightnumberThe window's height in pixels.
xnumberThe x-coordinate of the window.
ynumberThe y-coordinate of the window.
is_fullscreenbooleanWhether the window is fullscreen.
is_maximizedbooleanWhether the window is maximized.
is_minimizedbooleanWhether the window is minimized.
is_visiblebooleanWhether the window is visible.

AppScreenInfo

FieldTypeDescription
namestringThe screen's name or identifier.
widthnumberThe screen's width in pixels.
heightnumberThe screen's height in pixels.
xnumberThe x-coordinate of the screen.
ynumberThe y-coordinate of the screen.
scale_factornumberThe screen's scale factor.

Example Usage

Notes

Efficient usage of info()

Cache the result of info() if you need app details multiple times, as the information is static for the session and repeated calls may be unnecessary.