Module: cwc.screen
Low-Level API to manage output and the tag/workspace system
See also: cuteful.tag
Info:
- Copyright: 2024
- License: GPLv3
-
Originally authored by: Dwi Asmoro Bangun
(Full contributors list available on our github project)
Static module functions
cwc.screen.get () -> cwc_screen[] | Get all screen in the server. | |
cwc.screen.focused () -> cwc_screen | Get current focused screen. | |
cwc.screen.at (x, y) -> cwc_screen | Get screen at specified coordinates. | |
cwc.screen.get_max_workspace () -> integer | Get maximum workspace the compositor can handle. |
Config functions
cwc.screen.set_useless_gaps () | Set useless gaps width. |
Object properties
width | integer | The screen width. | Read only |
height | integer | The screen height. | Read only |
refresh | integer | The screen refresh rate in mHz (may be zero). | Read only |
phys_width | integer | The screen physical width in mm. | Read only |
phys_height | integer | The screen physical height in mm. | Read only |
scale | number | The screen scale. | Read only |
name | string | The name of the screen. | Read only |
description | string | The description of the screen (may be empty). | Read only |
make | string | The make of the screen (may be empty). | Read only |
model | string | The model of the screen (may be empty). | Read only |
serial | string | The serial of the screen (may be empty). | Read only |
enabled | boolean | The screen enabled state. | Read only |
non_desktop | boolean | The screen is non desktop or not. | Read only |
restored | boolean | The screen is restored or not. | Read only |
workarea | table | The workarea/usable area of the screen. | Read only |
layout_mode | integer | The layout mode of the active workspace. | |
allow_tearing | boolean | Whether to allow screen to tear or not. | |
active_tag | integer | Bitfield of currently activated tags. | |
active_workspace | integer | Currently active workspace. | |
max_general_workspace | integer | Maximum general workspace (workspaces that will be shown in the bar). | |
useless_gaps | integer | Set useless gaps width in the active workspace. | |
mwfact | number | Master width factor. |
Object methods
:toggle_tag (idx) | Toggle tag. | |
:strategy_idx (idx) | Change the layout mode strategy. | |
:view_only (idx) | Does the same as setting active_workspace property. | |
:get_containers (visible) -> cwc_container[] | Get containers in this screen. | |
:get_clients (visible) -> cwc_client[] | Get toplevels/clients in this screen. | |
:get_focus_stack (visible) -> cwc_client[] | get focus stack in the output | |
:get_minimized (active) -> cwc_client[] | get minimized stack in the output. |
Signals
screen::new | Emitted when a screen is added. | |
screen::destroy | Emitted when a screen is about to be removed. |
Static module functions
- 🔗 cwc.screen.get () -> cwc_screen[]
-
Get all screen in the server.
Returns:
-
cwc_screen[]
- 🔗 cwc.screen.focused () -> cwc_screen
-
Get current focused screen.
Returns:
-
cwc_screen
- 🔗 cwc.screen.at (x, y) -> cwc_screen
-
Get screen at specified coordinates.
Parameters:
Name Type(s) Description x integer X coordinates y integer Y coordinates Returns:
-
cwc_screen
- 🔗 cwc.screen.get_max_workspace () -> integer
-
Get maximum workspace the compositor can handle.
Returns:
-
integer
count
Config functions
- 🔗 cwc.screen.set_useless_gaps ()
- Set useless gaps width.
Object properties
- 🔗 width integer · read only
-
The screen width.
Constraints:
Default value : Extracted from wlr_output. Negative allowed : false - 🔗 height integer · read only
-
The screen height.
Constraints:
Default value : Extracted from wlr_output. Negative allowed : false - 🔗 refresh integer · read only
-
The screen refresh rate in mHz (may be zero).
Constraints:
Default value : Extracted from wlr_output. Negative allowed : false - 🔗 phys_width integer · read only
-
The screen physical width in mm.
Constraints:
Default value : Extracted from wlr_output. Negative allowed : false - 🔗 phys_height integer · read only
-
The screen physical height in mm.
Constraints:
Default value : Extracted from wlr_output. Negative allowed : false - 🔗 scale number · read only
-
The screen scale.
Constraints:
Default value : Extracted from wlr_output. Negative allowed : false - 🔗 name string · read only
-
The name of the screen.
Constraints:
Default value : screen name extracted from wlr_output. - 🔗 description string · read only
-
The description of the screen (may be empty).
Constraints:
Default value : screen description extracted from wlr_output. - 🔗 make string · read only
-
The make of the screen (may be empty).
Constraints:
Default value : screen make extracted from wlr_output. - 🔗 model string · read only
-
The model of the screen (may be empty).
Constraints:
Default value : screen model extracted from wlr_output. - 🔗 serial string · read only
-
The serial of the screen (may be empty).
Constraints:
Default value : screen serial extracted from wlr_output. - 🔗 enabled boolean · read only
-
The screen enabled state.
Constraints:
Default value : screen enabled state extracted from wlr_output. Valid values : true
orfalse
. - 🔗 non_desktop boolean · read only
-
The screen is non desktop or not.
Constraints:
Default value : Extracted from wlr_output. Valid values : true
orfalse
. - 🔗 restored boolean · read only
-
The screen is restored or not.
Constraints:
Default value : false
Valid values : true
orfalse
. - 🔗 workarea table · read only
-
The workarea/usable area of the screen.
Constraints:
Default value : screen dimension. Table keys: x (integer) y (integer) width (integer) height (integer) Negative allowed : false - 🔗 layout_mode integer
-
The layout mode of the active workspace.
Constraints:
Default value : 0
Negative allowed : false Valid values : Layout mode enum from cuteful. See also:
cuteful.enum.layout_mode layout_mode enum extracted from cwc types.h
. (cuteful.enum)tables - 🔗 allow_tearing boolean
-
Whether to allow screen to tear or not.
Constraints:
Default value : false
Valid values : true
orfalse
.See also:
cwc.client.allow_tearing Allow the client to tear when in fullscreen. (cwc.client) object properties - 🔗 active_tag integer
-
Bitfield of currently activated tags.
Constraints:
Default value : Current active tags. Negative allowed : false - 🔗 active_workspace integer
-
Currently active workspace.
Constraints:
Default value : Current active workspace. Negative allowed : false - 🔗 max_general_workspace integer
-
Maximum general workspace (workspaces that will be shown in the bar).
Constraints:
Default value : 9 Minimum value : 1 - 🔗 useless_gaps integer
-
Set useless gaps width in the active workspace.
Constraints:
Default value : 0 Minimum value : 0 - 🔗 mwfact number
-
Master width factor.
Constraints:
Default value : 0.5 Minimum value : 0.1 Maximum value : 0.9
Object methods
- 🔗 :toggle_tag (idx)
-
Toggle tag.
Parameters:
Name Type(s) Description idx integer Tag index - 🔗 :strategy_idx (idx)
-
Change the layout mode strategy.
Parameters:
Name Type(s) Description idx integer - 🔗 :view_only (idx)
-
Does the same as setting active_workspace property.
Change output view, for tag it'll reset all the activated tag and activate the specified index, for the workspace it'll just regular workspace change.
Parameters:
Name Type(s) Description idx integer Index of the view See also:
active_workspace Currently active workspace. object properties - 🔗 :get_containers (visible) -> cwc_container[]
-
Get containers in this screen.
Ordered by time the container created (first item is newest to oldest).
Parameters:
Name Type(s) Description Default value visible Optional bool Whether get only the visible containers false
Returns:
-
cwc_container[]
array of container
- 🔗 :get_clients (visible) -> cwc_client[]
-
Get toplevels/clients in this screen.
Ordered by time the toplevel mapped (first item is newest to oldest).
Parameters:
Name Type(s) Description Default value visible Optional bool Whether get only the visible toplevel false
Returns:
-
cwc_client[]
array of toplevels
- 🔗 :get_focus_stack (visible) -> cwc_client[]
-
get focus stack in the output
Parameters:
Name Type(s) Description Default value visible Optional bool Whether get only the visible toplevel false
Returns:
-
cwc_client[]
array of toplevels
- 🔗 :get_minimized (active) -> cwc_client[]
-
get minimized stack in the output.
The order is newest minimized to oldest.
Parameters:
Name Type(s) Description Default value active Optional bool Whether to use active_tag as filter false
Returns:
-
cwc_client[]
array of toplevels