Awesome Window Manager

As mentioned in the gtk-tutorial, the Kindle uses the Awesome Window Manager with some tweaks, this means that every window must have a title which follows a specific format.

For example, the Kindle store has a window title of:

L:A_N:application_PC:TS_ID:com.lab126.store

Window titles are actually a key-value store, seperated by an _ character, this means the above title, would translate roughly to pseudo-JSON as:

{
    "L":"A",
    "N":"application",
    "PC":"TS",
    "ID":"com.lab126.store"
}

Below is a list of every key and what it’s role is:

[L]ayer

The L flag is what layer the window should display on, it can be one of 5 values:

ValueDescription
AThe APP layer
CThe CHROME layer
DThe DIALOG layer
KBThe KB (keyboard) layer
SSThe SCREENSAVER layer

Layers are displayed from top to bottom, with applications on the SCREENSAVER layer being above applications on the APP layer.

Generally you will only be using the A and D layer values.

[N]ame

lab126 internally refers to this as the “name/role” of the window, in reality it only represents the role of the window, and should be one of the listed values:

ValueDescription
applicationFor use with the A layer, application windows
dialogFor use with the D layer, dialog windows
titlebarFor backwards compatability,
tiledBottom[SHOULD NOT BE USED IN PRODUCTION - lab_126.application_layer.lua:255]
searchResultFor use with the C layer, seemingly used for search result displays, acts as a modified dialog
pillowAlertAn alert created by Pillow, for use with the D layer, blocks the home button
titleBar
footerBar
topBarSeemingly used for custom search bar apps (use with BARTYPE parameter)
mediaBar
bottomBarREDUNDANT - use topBar role with BARTYPE of B
appToolBarREDUNDANT - use topBar role with BARTYPE of A
keyboardUsed by the Kindle’s keyboard
keyboardExt
activeSS
screenSaver
searchBarUsed by the Kindle’s top bar

You will generally only use application and dialog for this, in conjunction with the A and D layers

[PC] (Persistent Chrome)

Used by the window manager to determine how to handle displaying chrome elements on the Kindle such as the top bar and “search bar”
It’s value is any combination of the following:

ValueDescriptionExample
TShow the Kindle top bar/status bar on modern firmware
SShows the “search bar”
BShows the legacy bottom bar
NShow no bars (same as if PC was ommited entirely)

Examples of combining multiple PC values:

ValueImage
TS
TSB
Window resizing appears to be broken in `TSB`, it is only shown for illustrative purposes and shouldn't be used

[ID] (Identifier)

This is a simple string giving the identifier of the app, it’s value can be anything not containing an underscore (as that is used as a delimiter) and it usually takes an app ID in a format similar to com.lab126.reader (reverse domain name)

Note that the value blankBackground is reserved, it’s purpose is currently unknown but it makes an app invalid

[BARTYPE]

BARTYPE is used with thetopBar role type, it describes the bar’s positioning and takes one of the following values:

ValueDescription
TTop bar type
SSearch bar type
BBottom bar type - “added for kpp chrome footer” - It behaves like top bars in terms of persistence
AApplication bar type - Secondary bar for application specific tools

[O]rientation - Supported App Orientations

Sets the application’s orientation mask for supported orientations, can be any combination of 4 values (IE: ULR or UDLR):

ValueDescription
UUp
DDown
LLeft
RRight

[HIDE]

A flag that can be set to hide the window, the title can be updated without it to show the window

IE:

L:A_N:application_HIDE_ID:org.kindlemodding.hiddenwindow

Note that this flag can take an optional value of background which means this window does not take focus. (actual purpose unknown)

[RC] - Rounded Corners

For use with dialogs, can be used to set rounded corners on a dialog, it can be used as a flag or given an integer value representing the corner radius in pixels of all the corners.

It can also be given the value custom, where any combination of the following 4 keys can be used to set a corner radius for the window:

  • RCTL
  • RCTR
  • RCBL
  • RCBR

Example, setting rounded corners only on the top-left and top-right corners to the default rounded corner radius:

RC:custom_RCTL_RCTR

[M]odality

Used specifically for dialogs, if this flag is present, it dictates the dialog is a modal. It can have an optional value of dismissible, ie:

L:A_N:application_M:dismissable_ID:org.kindlemodding.hiddenwindow

[RKB] - Require KeyBoard

Used specifically for dialogs that require the keyboard, this positions the dialog so that it does not clip with the spawned keyboard. It can seemingly take a numeric value of unknown purpose.

[PALMR] - Palm Rejection

Purpose unknown - only used in conjunction with M:dismissable, seemingly related to palm rejection on dismissal