astrum is a widgeting system that depends on libcosmic it can run on any wayland compositor that supports the layer-shell protocol.

astrum is made in rust and is configured in lua i reccomend using the lua language server as that is what i will depend on for types and i reccomend getting familiar with the annotation syntax as that is what i will show in documentation

since this project is still a work in progress, you have to build it from source.


if you use nix you can add this as a nix flake input

inputs = {
    astrum.url = "github:vnuxa/astrum"
}

and somewhere in your package list add the following

    astrum.defaultPackage.${pkgs.system}

I also recommend having the lua language server installed in your text editor, since it contains astrum types and descriptions

Start by making ~/.config/astrum/config.lua

Astrum = require("astrum")
App = Astrum:application()
-- you can make windows with App:window()

return App

You will see nothing happening if you run astrum, mainly because its an empty config
You have to make a window in order for astrum to display something


Making windows

Windows are toplevel containers that hold widgets and signals (More on signals later).

App:window("window_name", {
 -- window model goes here
})


Windows have a mandatory view field, which defines what widgets to display
The view field gets ran after signals get processed.

App:window("window_name", {
    view = function()
         return Astrum.widgets:text("hello world!")
    end
})

This will display a window that has a text widget containing "hello world!"


Signals and states

Windows also have an optional signals field, which is a dictionary of signal names and logic that will be processed when the signal is fired

App:window("window_name", {
    view = function()
         return Astrum.widgets:button({
             child = Astrum.widgets:text("press me!")
             on_press = "button_pressed" -- the name of the signal
         })
    end,
    -- the syntax for signals is this
    -- signal_name = function(signal_data) end
    signals = {
        button_pressed = function() -- signal data is unnecessary since we do not send any yet
            print("hello world!")
        end
    }
})

This example will make a window, that has a button which when pressed will print hello world!

Signals are also the main way you change the state within astrum
And view logic is where you define widgets based on state

local state = {
    widget_text = "false"
}

App:window("window_name", {
    view = function()
         return Astrum.widgets:button({
             child = Astrum.widgets:text(state.widget_text)
             on_press = "button_pressed"
         })
    end,

    signals = {
        button_pressed = function()
            if state.widget_text == "false" then
                state.widget_text = "true"
            else
                state.widget_text = "false"
            end
        end
    }
})

This will make a window that has a button with text that toggles between false and true

Since astrum depends on libcosmic, styling is done within lua and not in another language (css for example)


Stylesheets

Although the styling is done within lua, there still are stylesheets

Astrum.style:add_style("style_name", {
-- style body goes here
})

Each widget has its own styling model, though if a widget has multiple styling states (for example buttons on_pressed and on_hovered) there is a default state as well, which overrides the base defaults, if not already specified

You can use stylesheets within widgets via the get_style function

Astrum.widgets:text({
    content = "hello world!",
    style = Astrum.style:get_style("style_name")
})

Subscriptions are the only way to update your state and view logic after an external event occurs.
Subscriptions will trigger every window's view and signal logic (might change in the future, depending on libcosmic)


To use a subscription, you must subscribe to a specific service.
Here is a hyprland workspace changed subscription example:

local state = {
    -- most services have types
    ---@type HyprlandWorkspaces
    workspaces = {}
}

App:window("workspace_example", {
    view = function()
        local row = Widgets:row({})

        for _, workspace in pairs(state.workspaces) do
            row:push(Widgets:text(tostring(workspace.id)))
        end

        return row
    end,
    -- Tells the application to subscribe to the `Hyprland` service
    subscriptions = {
        hyprland = {
            ---Specifies that whenever there is a workspace change, send the following signal that goes by the name of `on_workspace`
            workspaces = "on_workspace"
        }
    }
    signals = {
        on_workspace = function(signal_data)
            -- Signal data is of type `HyprlandWorkspaces`
            state.workspaces = signal_data
        end
    }
})

Advanced subscriptions

These subscriptions do not follow the common subscription syntax or are not autocompleted automatically by the LSP which is why they will be further explained here.

Calls

Calls is a powerful subscription that allows external proccesses to interact with astrum by sending a call signal.
Each key in the calls subscription table will be the call_signal and each value will be the name of the signal that will fire when it recieved the call signal

local called_times = 0

app:window("notification-thing", {
	view = function()
        return widgets:text("recieved call `mycall` ".. called_times.. " times")
	end,
	subscriptions = {
        calls = {
            mycall = "on_call"
        }
	},
	signals = {
        on_call = function(signal_data)
            called_times = called_times + 1
        end
	},
})

This will display a widget that shows the amount of times that it has recieved the mycall call signal
to send this call signal, add --call to the options of astrum (i.e. astrum --call mycall)

You can also send data through the call by adding a : after the call signal name, though note that it has to be in valid lua table

local data = ""

app:window("notification-thing", {
	view = function()
        return widgets:text("call `mycall` has sent data: ".. data)
	end,
	subscriptions = {
        calls = {
            mycall = "on_call"
        }
	},
	signals = {
        on_call = function(signal_data)
            data = signal_data.data
        end
	},
})

and executing the resulting command

astrum --call 'mycall:{data="test"}'

will result in the window text displaying the following

    call `mycall` has send data: test

Keybinds

Custom keybinds in astrum are defined through subscriptions
The index of the keybind susbcription table will be the signal name that it will send to when the specified keys have been pressed.


The first parameter of the value table are the modifiers that need to be pressed, seperated by commas.
The second parameter is a single character or a lowercase name for the keybind (you can see the full list of named keys in the source of the keybind susbcription)


An example implementation:

app:window("notification-thing", {
    keymode = "on_demand",
	subscriptions = {
        keybinds = {
            on_key = { "ctrl,shift", "space"},
            on_key2 = { "ctrl", "d"}
        }
	},
	signals = {
        on_key = function()
            print("ctrl shift and space have been pressed!")
        end,
        on_key2 = function()
            print("ctrl and d have been pressed!")
        end
	},
})

Note: keybinds will not work if the keymode is none

Table of contents

  1. Astrum
  2. AstrumApp
  3. WindowModel

source


Astrum

Propreties:

Methods:

:application()AstrumApp

:toggle_window(window_name)

window_name: string


AstrumApp

Propreties:

Methods:

:window(window_name, window_model)

window_name: string

The unique name of the window

window_model: WindowModel

The model of the window


WindowModel

Propreties:

anchor"bottom"|"left"|"right"|"top"[]?

exclusive_zone(integer|"ignore")?

How much space should the window reserve, set it to "ignore" if you want it to ignore other layers

heightnumber?

If provided, manually set the height of the window

is_popupboolean?

keymode("exclusive"|"none"|"on_demand")?

layer("background"|"bottom"|"top")?

signals({ [string]: fun(signal_data: table) }|{ [string]: fun(signal_data: table) }[])?

A dictionary of signal names and their respective logic that will be processed when the signal is called on. If a table value is provided, it will unpack it. If there are multiple signals with the same name, it will get overriden

subscriptionsSubscriptions?

Connects to an external processes by sending signals. All of the subscriptions are to be provided in a table

see definitions: Subscriptions

viewfun():Widget

Logic that dictates what widgets for the window to render

see definitions: Widget

Methods:


Table of contents

  1. HyprlandSubscription
  2. MprisSubscription
  3. Notification
  4. NotificationSubscription
  5. Subscriptions
  6. SystemTrayItem
  7. SystemTraySubscription

source


HyprlandSubscription

Propreties:

active_clientstring?

Sends a signal whenever the active hyprland client (window) was changed (e.g. active window focus has changed). Outputs a singular HyprlandClient or nil if there is no focus

clientsstring?

Sends a signal whenever a hyprland client (window) was changed (for example: window closed, window opened, window moved). All of the clients ordered by their workspace is provided

workspacesstring?

Sends an signal whenever hyprland workspaces change (e.g. workspace is added, workspace is moved, workspace is destroyed). All of the workspaces are provided

Methods:


MprisSubscription

Propreties:

looping_changedstring?

Sends a signal whenever the player's loop status was changed. New loop status is provided

pausedstring?

Sends a signal whenever the player was paused

playingstring?

Sends a signal whenever the player started playing

shuffle_toggledstring?

Sends a signal whenever the player's shuffle status was changed. New shuffle status is provided

stoppedstring?

Sends a signal whenever the player was stopped

track_changedstring?

Sends a signal whenever the player's track has changed. New metadata is provided

volume_changedstring?

Sends a signal whenever the player's volume was changed. New volume is provided

Methods:


Notification

Propreties:

actionsstring[]

Actions are sent over as a list of pairs. Each even element in the list represents the identifier of the action. Each odd element in the list is the localized string that will be displayed to the user

app_iconstring

The optional program icon of the calling application. Can be blank, indicating no icon.

app_namestring

The optional name of the application sending the notification. Can be blank

bodystring

The optional detailed body text. Can be blank

expire_timeoutnumber

The timeout in milliseconds since the display of the notification and at which the notification should automatically close. If it is -1 it means that there is predefined expire timeout (up to you). If 0 then it never expires.

replaces_idnumber

The optional notification ID that this notification replaces. It is reccomended that the server must atomically (i.e. with no visual cues or flicker) replace the given notification with this one, so that applications can modify noitifications while they still are active. A value of 0 means that it will not replace notifications

summarystring

The summary text briefly describing the notification

Methods:


NotificationSubscription

Propreties:

on_notificationstring

Sends a signal whenever a notification is recieved. The signal_data is of type Notification and contains the data of the notification.

Methods:


Subscriptions

Propreties:

callstable<string, string>?

Sends to a signal when the specified call name (in the index) has been sent

hyprlandHyprlandSubscription?

see definitions: HyprlandSubscription

keybindstable<string, [string|"alt"|"ctrl"|"shift"|"super", string|"alt"|"arrow_down"|"arrow_left"|"arrow_right"...(+34)]>?

List of signal names (the key of the table) that will be sent when pressing down the specified modifiers and a character. The first parameter of the value tuple is modifiers, which are seperated by commas (i.e. "shift,super" would work when shift and super are being pressed). The 2nd parameter is a single character or lowercase name for the keybind

mprisMprisSubscription?

see definitions: MprisSubscription

notificationsNotificationSubscription?

see definitions: Notification NotificationSubscription

system_traySystemTraySubscription?

see definitions: SystemTraySubscription

timetable<number, string>?

Sends a signal whenever a specified amount (the key of the table) is passed

Methods:


SystemTrayItem

Propreties:

category"application_status"|"communications"|"hardware"|"system_services"

The category for this item

icon_namestring?

The name of the icon that should visualise the tray item

icon_pixmapstring?

The id of the pixmap to use.

idstring

A name that is unique for this application

status"active"|"needs_attention"|"passive"|"unknown"

Describes the status for this item or of the associated application

titlestring?

A name that describes the application, can be more descriptive than id, but it is also not nesscessary.

Methods:


SystemTraySubscription

Propreties:

updatestring?

Sends a signal every time items in the tray get updated

Methods:


Table of contents

  1. Widgets

source


Widgets

Propreties:

Methods:

:button(content_or_model, extra_model)Widget

content_or_model: (string|ButtonModel)?

The text to be displayed (shorthand) or the model for the button

extra_model: ButtonModel?

The params for the shorthand. You do not need this if you provide a model in the first argument

:centerbox(model)Widget

model: CenterboxModel?

:column(model)table

model: ColumnModel?

:container(model)Widget

model: ContainerModel

:icon(icon_name_or_model, extra_model)Widget

icon_name_or_model: (string|IconModel)?

The icon name (shorthand) or the model for the icon

extra_model: IconModel?

Extra params for the shorthand. You do not need this if you already provided a model in the first argument

:image(content_or_model, extra_model)Widget

content_or_model: (string|ImageModel)?

The text to be displayed (shorthand) or the model for the image

extra_model: ImageModel?

The params for the shorthand. You do not need this if you provide a model in the first argument

:mouse_area(model)Widget

model: MouseAreaModel

:row(model)table

model: RowModel?

:scrollable(model)Widget

model: ScrollableModel

:signal(signal_name, signal_data)CustomSignal

signal_name: string

signal_data: table

Data to be sent through the signal

:space(width, height)Widget

width: ("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

The width of the empty amount of space. Defaults to "shrink"

height: ("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

The height of the empty emount of space. Defaults to "shrink"

:text(content_or_model, extra_model)Widget

content_or_model: (string|TextModel)?

The text to be displayed (shorthand) or the model for the text

extra_model: TextModel?

Extra params for the shorthand. You do not need this if you provide a model in the first argument

:text_input(content_or_model, placeholder, model)Widget

content_or_model: string|TextInputModel

placeholder: string?

model: TextInputModel?


Table of contents

  1. ButtonModel
  2. CenterboxModel
  3. ColumnModel
  4. ContainerModel
  5. CustomSignal
  6. IconModel
  7. ImageModel
  8. MouseAreaModel
  9. OnScrollSignal
  10. RowModel
  11. ScrollableModel
  12. TextInputModel
  13. TextModel
  14. Widget
  15. WidthHeightWidget

source


ButtonModel

Propreties:

childWidget?

A widget that will be displayed within the button

see definitions: Widget

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

on_press(string|CustomSignal)?

Sends a signal whenever the button is pressed. If a string is provided, it will send no data

see definitions: CustomSignal

padding(number|[number, number, number, number]|[number, number])?

styleButtonAppearance?

Sets the appearance of the button

see definitions: ButtonAppearance

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


CenterboxModel

Propreties:

align_items("center"|"end"|"start")?

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

left_childWidget?

Element to be displayed on the left side of the centerbox

see definitions: Widget

middle_childWidget?

Element to be displayed in the middle of the centerbox

see definitions: Widget

padding(number|[number, number, number, number]|[number, number])?

right_childWidget?

Element to be displayed on the right side of the centerbox

see definitions: Widget

spacingnumber?

The spacing of elements in pixels

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


ColumnModel

Propreties:

align_x("center"|"left"|"right")?

Sets the vertical alignments of the contents of the column

childrenWidget[]?

List of widgets to be rendered within the column

see definitions: Widget

clipboolean?

Sets whether the contents of the column should be clipped on overflow

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

max_widthnumber?

Maximum width of the column in pixels

padding(number|[number, number, number, number]|[number, number])?

spacingnumber?

The spacing between elements in pixels

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


ContainerModel

Propreties:

align_x("center"|"left"|"right")?

Sets the alignment of content on the horizontal axis

align_y("bottom"|"center"|"top")?

Sets the alignment of content on the vertical axis

center_x("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the container and centers the content horizontally

center_y("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the container and centers the content vertically

childWidget?

Element to be displayed within the container

see definitions: Widget

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

max_heightnumber?

Maximum height of the container in pixels

max_widthnumber?

Maximum width of the container in pixels

padding(number|[number, number, number, number]|[number, number])?

styleContainerAppearance?

Sets the appearance of the container

see definitions: ContainerAppearance

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


CustomSignal

Propreties:

signal_datatable

signal_namestring

Methods:


IconModel

Propreties:

content_fit("contain"|"cover"|"fill"|"none"|"scale_down")?

Sets how the content should be fit.

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

icon_namestring?

The name of the icon. icon_name or icon_path is required.

icon_pathstring?

The path to the icon. icon_name or icon_path is required.

sizeinteger?

The size of the icon.

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


ImageModel

Propreties:

border_radius(number|[number, number, number, number])?

The border radius of the image

contentstring?

A path to an image, this field is required

content_fit("contain"|"cover"|"fill"|"none"|"scale_down")?

Sets how the content should be fit. Defaults to contain

filter_method("linear"|"nearest")?

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

opacitynumber?

Sets the opacity of an image. It should be in 0.0 - 1.0 range

rotation(["floating", number]|["solid", number])?

Sets the rotation of the image. floating - element will float while rotating, layout will be the same prior to rotation (default). solid - element will be solid while rotating, layout will be adjusted to fit rotated content

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


MouseAreaModel

Propreties:

childWidget

Element that determines the size of the mouse area

see definitions: Widget

on_double_clickCustomSignal?

Sends a signal when the left mouse button has been pressed twice over a specified area.

see definitions: CustomSignal

on_dragCustomSignal?

Sends a signal when a drag has been initiated over a specified area.

see definitions: CustomSignal

on_enterCustomSignal?

Sends a signal when the mouse has entered a specified area

see definitions: CustomSignal

on_exitCustomSignal?

Sends a signal when the mouse has left a specified area

see definitions: CustomSignal

on_middle_pressCustomSignal?

Sends a signal when the middle mouse button has been pressed over a specified area.

see definitions: CustomSignal

on_pressCustomSignal?

Sends a signal when the left mouse button has been pressed over a specified area.

see definitions: CustomSignal

on_releaseCustomSignal?

Sends a signal when the left mouse button has been released over a specified area.

see definitions: CustomSignal

on_scrollstring?

Sends to a specified signal name, sends direction field in a table that can be either up or down (e.g. OnScrollSignal)

Methods:


OnScrollSignal

Propreties:

direction"down"|"up"

Methods:


RowModel

Propreties:

align_y("bottom"|"center"|"top")?

Sets the vertical alignments of the contents of the row

childrenWidget[]?

List of widgets to be rendered within the row

see definitions: Widget

clipboolean?

Sets whether the contents of the row should be clipped on overflow

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

padding(number|[number, number, number, number]|[number, number])?

spacingnumber?

The spacing between elements in pixels

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


ScrollableModel

Propreties:

childWidget?

Infinite amount of content to be displayed within the scrollable

see definitions: Widget

direction(["both", { vertical: ScrollablePropreties, horizontal: ScrollablePropreties }]|["horizontal", ScrollablePropreties]|["vertical", ScrollablePropreties])?

The direction where the content will be scrolled

see definitions: ScrollablePropreties

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


TextInputModel

Propreties:

always_activeboolean?

If enabled, makes it behave as if it were always focused

line_height(["absolute", number]|["relative", number])?

Sets the line height of the

on_inputstring?

Runs a signal when some text is typed in the text input, sends text in the signal data which contains the new text. Cannot pass through custom signals

on_submit(string|CustomSignal)?

Sends a custom signal when the text input is focused and the enter key is pressed

see definitions: CustomSignal

passwordboolean?

If the text input should be a secure password input

placeholderstring?

Placeholder text for the text input

sizenumber?

Sets the text size of the text input

styleTextInputAppearance?

Sets the appearance of the text input

see definitions: TextInputAppearance

valuestring?

The text of the text input. Needs an external variable paired with on_input in order to change

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Methods:


TextModel

Propreties:

align_x("center"|"left"|"right")?

Sets the horizontal alignment of the text

align_y("bottom"|"center"|"top")?

Sets the vertical alignment of the text

contentstring?

The text that should be displayed

fontFont?

The font of the text

see definitions: Font

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the text

line_heightnumber?

Sets the line height in pixels

sizenumber?

The font size of the text

styleTextAppearance?

Sets the appearance of the text

see definitions: TextAppearance

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


Widget

Propreties:

widget_namestring

Methods:


WidthHeightWidget

Propreties:

height("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the height of the widget

width("fill"|"shrink"|["fill_portion", number]|["fixed", number])?

Sets the width of the widget

Methods:


Table of contents

  1. Font
  2. ScrollablePropreties

source


Font

Propreties:

namestring

The font's name

style("italic"|"normal"|"oblique")?

The style of the font

weight("black"|"bold"|"extrabold"|"extralight"|"light"...(+4))?

The font's weight

Methods:


ScrollablePropreties

Propreties:

anchor("end"|"start")?

Sets the alignment of the scrollable

marginnumber?

Sets the scrollbar margin in pixels

scrollers_widthnumber?

Sets the width of the scroller in pixels

widthnumber?

Sets the width of the scrollbar in pixels

Methods:


Table of contents

  1. MatchUtil
  2. SwitchUtil

source


MatchUtil

Propreties:

armfun(condition: any, result: any):MatchUtil

Checks if the scrutinee is equal to the condition (==)

see definitions: MatchUtil

arm_less_eqfun(condition: any, result: any):MatchUtil

Checks if the scrutinee is less than or equal to the condition (<=)

see definitions: MatchUtil

arm_less_thanfun(condition: any, result: any):MatchUtil

Checks if the scrutinee is less than to the condition (<)

see definitions: MatchUtil

arm_more_eqfun(condition: any, result: any):MatchUtil

Checks if the scrutinee is more than or equal to the condition (>=)

see definitions: MatchUtil

arm_more_thanfun(condition: any, result: any):MatchUtil

Checks if the scrutinee is more than to the condition (>)

see definitions: MatchUtil

collapsefun():any

Collapses the entire match arm, returning either a result, the fallback if no match was found or nothing

defaultfun(result: any):MatchUtil

If none of the arms have a match, it will fallback to this result

see definitions: MatchUtil

Methods:


SwitchUtil

Propreties:

casefun(condition: any, result: fun():any):SwitchUtil

Checks if the scrutinee is equal to the condition (==)

see definitions: SwitchUtil

case_less_eqfun(condition: any, result: fun():any):SwitchUtil

Checks if the scrutinee is less than or equal to the condition (<=)

see definitions: SwitchUtil

case_less_thanfun(condition: any, result: fun():any):SwitchUtil

Checks if the scrutinee is less than to the condition (<)

see definitions: SwitchUtil

case_more_eqfun(condition: any, result: fun():any):SwitchUtil

Checks if the scrutinee is more than or equal to the condition (>=)

see definitions: SwitchUtil

case_more_thanfun(condition: any, result: fun():any):SwitchUtil

Checks if the scrutinee is more than to the condition (>)

see definitions: SwitchUtil

collapsefun()

Evaluates the found case, if no case was found then evaluate the fallback if it is provided

defaultfun(result: fun():any):MatchUtil

If none of the arms have a match, it will fallback to this result

see definitions: MatchUtil

Methods:


Table of contents

  1. Animation
  2. Animations

source


Animation

Propreties:

animation_idnumber

The animation's ID, used for interracting with lilt animations

Methods:

:animate_table(false_table, true_table)

false_table: table

The table to go to when the animation state is false

true_table: table

The table to go to when the animation state is true

:animate_value(false_value, true_value)

false_value: number

The value to transition to when the animation state is false

true_value: number

The value to transition to when the animation state is true

:get_state()boolean

:play()

:toggle(state)

state: boolean?

If provided, change to a specific state


Animations

Propreties:

Methods:

:animate_style(animation, false_style, true_style)

animation: Animation

false_style: string

The classname of the requested style to go to when the animation is false.

true_style: string

The classname of the requested style to go to when the animation is true.

:new(starting_value, time, easing, repeat_amount, reverse, delay)Animation

starting_value: boolean|nil

The state of the animation, default is false

time: number|nil

The amount of seconds it takes for the animation to complete. Default is 1

easing: "ease_in"|"ease_in_back"|"ease_in_bounce"|"ease_in_circ"|"ease_in_cubic"...(+27)

The easing style of the animation, default is "linear"

repeat_amount: number|nil

The amount of times the animation will repeat itself, default is nil

reverse: boolean|nil

Will the animation reverse itself, default is false

delay: number|nil

The delay until the animation will start, in seconds. Default is 0


Table of contents

  1. ButtonAppearance
  2. ButtonStyleSheet
  3. ContainerAppearance
  4. TextAppearance
  5. TextInputAppearance
  6. TextInputStyleSheet

source


ButtonAppearance

Propreties:

backgroundrgba?

The background of the button

see definitions: rgba rgb

border_colorrgba?

The color of the button border

see definitions: rgba rgb

border_radius(number|[number, number, number, number])?

Sets the border radius of the button

border_widthnumber?

Sets the width of the border within the button

icon_colorrgba?

The icon color of the button

see definitions: rgba rgb

outline_colorrgba?

Sets the color of the outline

see definitions: rgba rgb

outline_widthnumber?

An outline placed around the button

overlayrgba?

The background overlay of the button

see definitions: rgba rgb

shadow_offsetVector?

The amount of shadow offset to be applied on the button

see definitions: Vector

text_colorrgba?

The color of the text

see definitions: rgba rgb

Methods:


ButtonStyleSheet

Propreties:

activeButtonAppearance?

The appearance of the button when it is active

see definitions: ButtonAppearance

defaultButtonAppearance

The default appearance for the button, this default style will fill in the other styles if they are not provided

see definitions: ButtonAppearance

disabledButtonAppearance?

The appearance of the button when it is disabled

see definitions: ButtonAppearance

hoveredButtonAppearance?

The appearance of the button when it is hovered

see definitions: ButtonAppearance

pressedButtonAppearance?

The appearance of the button when it is pressed

see definitions: ButtonAppearance

Methods:


ContainerAppearance

Propreties:

backgroundrgba?

The background of the container

see definitions: rgba rgb

borderBorder?

The border of the container

see definitions: Border

icon_colorrgba?

The color of icons within the container

see definitions: rgba rgb

shadowShadow?

see definitions: Shadow

text_colorrgba?

The color of the text

see definitions: rgba rgb

Methods:


TextAppearance

Propreties:

text_colorrgba?

The color of the text

see definitions: rgba rgb

Methods:


TextInputAppearance

Propreties:

backgroundrgba?

The color of the background

see definitions: rgba rgb

border_colorrgba?

The color of the border

see definitions: rgba rgb

border_radiusnumber?

The border radius

border_widthnumber?

The border width

placeholder_colorrgba?

The color of the placeholder text within the text input

see definitions: rgba rgb

selected_fillrgba?

The color of the selected text background within the text input

see definitions: rgba rgb

selected_text_colorrgba?

The color of selected text within the text input

see definitions: rgba rgb

text_colorrgba?

The color of the text within the text input

see definitions: rgba rgb

Methods:


TextInputStyleSheet

Propreties:

activeButtonAppearance?

The appearance of the text input when it is active

see definitions: ButtonAppearance

defaultButtonAppearance

The default appearance of the text input, this default style will fill in the other styles if they are not provided

see definitions: ButtonAppearance

disabledButtonAppearance?

The appearance of the text input when it is disabled

see definitions: ButtonAppearance

errorButtonAppearance?

The appearance of the text input when it is errored

see definitions: ButtonAppearance

focusedButtonAppearance?

The appearance of the text input when it is hovered

see definitions: ButtonAppearance

Methods:


Table of contents

  1. Border
  2. Shadow
  3. Vector
  4. rgb
  5. rgba

source


Border

Propreties:

colorrgba?

The color of the border

see definitions: rgba rgb

radius(number|[number, number, number, number])?

The radius of the border

widthnumber?

The width of the border

Methods:


Shadow

Propreties:

blur_radiusnumber?

The blur radius of the shadow

colorrgba?

The color of the shadow

see definitions: rgba rgb

offsetVector?

The offset of the shadow

see definitions: Vector

Methods:


Vector

Propreties:

xnumber

The X component of the vector

ynumber

the Y component of the vector

Methods:


rgb

Propreties:

bluenumber

Value ranging from 0-255

greennumber

Value ranging from 0-255

rednumber

Value ranging from 0-255

Methods:


rgba

Propreties:

alphanumber

Value ranging from 0.0-1.0

bluenumber

Value ranging from 0-255

greennumber

Value ranging from 0-255

rednumber

Value ranging from 0-255

Methods:


Table of contents

  1. AppModel
  2. ApplicationsService
  3. Greetd
  4. HyprlandClient
  5. HyprlandWorkspace
  6. MprisLoopingChanged
  7. MprisOutput
  8. MprisPlayer
  9. MprisService
  10. MprisShuffleToggled
  11. MprisTrackChanged
  12. MprisVolumeChanged
  13. TimeService
  14. TrackMetadata

source


AppModel

Propreties:

descriptionstring

The description of the app, if it has one

desktopstring

The .desktop file path

executablestring

The apps executable binary path

iconstring

The icon name of the app

idstring

The id of the app. The id is oobtained by the desktop file name

namestring

The name of the app

Methods:


ApplicationsService

Propreties:

Methods:

:get_all_apps()AppModel[]

:launch_app(executable_path)

executable_path: string


Greetd

Propreties:

Methods:

:login(username, attempt, command)"login_failure"|"login_success"

username: string

The username to log in with

attempt: string

The password you need to loog in with

command: string

The command to run if login was successfull


HyprlandClient

Propreties:

at{ x: number, y: number }

The x and y position where the client is on

classstring

The class name of the client

floatingboolean

Is this window floating or not

initial_classstring

The initial_title of the client

initial_titlestring

The initial_title of the client

process_idnumber

The process id of the client

size{ x: number, y: number }

the x and y size of the client

titlestring

The title of the client

workspace_idnumber

The id of the workspace that the client/window is on

Methods:


HyprlandWorkspace

Propreties:

activeboolean

idnumber

Methods:


MprisLoopingChanged

Propreties:

loop_status"None"|"Playlist"|"Track"

playerstring

The players name

Methods:


MprisOutput

Propreties:

playerstring

The players name

Methods:


MprisPlayer

Propreties:

Methods:

:get_volume()number

:next()

:play_pause()

:previous()

:set_loop(status)

status: "None"|"Playlist"|"Track"

:set_shuffle(shuffle)

shuffle: boolean

:set_volume(volume)

volume: number


MprisService

Propreties:

Methods:

:get_player(player_name)MprisPlayer

player_name: string


MprisShuffleToggled

Propreties:

playerstring

The players name

shuffleboolean

Methods:


MprisTrackChanged

Propreties:

playerstring

The players name

trackTrackMetadata|{ empty: boolean }

see definitions: TrackMetadata

Methods:


MprisVolumeChanged

Propreties:

playerstring

The players name

volumenumber

Methods:


TimeService

Propreties:

Methods:

:delay(duration, signal)

duration: number

How much time (in seconds) needs to pass until sending the signal

signal: string|CustomSignal

The signal to send once the specified amount of time has passed


TrackMetadata

Propreties:

album_artistsstring[]

List of artists of the song

album_namestring

The album name of the song playing

lengthnumber

The length of the song in seconds

titlestring

The title of the song playing

Methods: