ULOS Manual Pages - uwm(3) | Back
NAME
  uwm - the ULOS Window Manager API
DESCRIPTION
  This manual page describes the API which uwm(1) presents to all applications running under it.  It also presents the expected structure of an application table.
  Applications are loaded from files in /usr/share/apps.  They are expected to return a table containing the following.  All functions are called with their first argument being the window object, which has a sub-field app that is the actual application.
    w
      The width, in characters, of the new window.
    
    h
      The height, in characters, of the new window.
    name
      The name of the window.  Defaults to the filename minus the .lua extension (so, the name of the app at /usr/share/apps/example.lua becomes example unless it is set in this field).
    refresh(gpu: table)
      Refreshes the application.  The provided gpu should be used as though only the application is running, and in fullscreen, since each window is its own GPU proxy (see gpuproxy(3)).  Whether to actually redraw anything is at the application's discretion - for example, the sysmon app only refreshes most of its content once every few seconds.
    click(x:number, y:number)
      Called when a window is clicked.  x and y are relative to the window's position, so the programmer must not compensate for this.
    key(char:number, code:number)
      Called when a key is pressed while the window is focused.
    focus()
      Called when the window is focused.  Not called when the window has just been created.
    unfocus()
      Called when the window is unfocused.
    close([is_shutdown:string])
      Called when the window is closed.  If is_shutdown is "UI_CLOSING", this means that uwm is quitting.
  The following fields are provided in the window object passed as self to the above functions:
    app:table
      The application attached to the window.
    gpu:table
      The GPU proxy associated with the window.
    buffer:number
      The GPU buffer index associated with the window.
  The window manager adds an additional field to the app:
    
    wm:table:
      notify = function(text:string)
        Prompts the user with the specified text and an Ok button.
      menu = function(x:number, y:number, title:string, opts:table)
        Presents the user with a menu at the specified coordinates containing the specified items opts and with the specified title.
COPYRIGHT
  ULOS Window Manager copyright (c) 2021 Ocawesome101 under the DSLv2.
REPORTING BUGS
  Please report bugs at https://github.com/ocawesome101/oc-ulos/issues