Hyprland
def get_hyprland_connection () Hyprland
class WorkspaceButton
Bases: Button
A button intented to be used with the Workspaces widget
It implements fields specific its usage (e.g. the active, urgent and empty properties)
- Parameters:
- id (int) — the identifier of this button’s workspace
- label (FormattedString | str | None , optional) — lazily evaluated string to be used as the label of this button, the button itself is available via the formatter field button, defaults to None
- image (Gtk.Image | None , optional) — an image widget to be added inside this button, defaults to None
- child (Gtk.Widget | None , optional) — a child widget to put inside this button, defaults to None
- name (str | None , optional) — the name identifer for this widget (useful for styling), defaults to None
- visible (bool , optional) — whether should this widget be visible or not once initialized, defaults to True
- all_visible (bool , optional) — whether should this widget and all of its children be visible or not once initialized, defaults to False
- style (str | None , optional) — inline stylesheet to be applied on this widget, defaults to None
- style_classes (Iterable *[*str ] | str | None , optional) — a list of style classes to be added into this widget once initialized, defaults to None
- tooltip_text (str | None , optional) — the text that should be rendered inside the tooltip, defaults to None
- tooltip_markup (str | None , optional) — same as tooltip_text but it accepts simple markup expressions, defaults to None
- h_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — horizontal alignment of this widget (compared to its parent), defaults to None
- v_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — vertical alignment of this widget (compared to its parent), defaults to None
- h_expand (bool , optional) — whether should this widget fill in all the available horizontal space or not, defaults to False
- v_expand (bool , optional) — whether should this widget fill in all the available vertical space or not, defaults to False
- size (Iterable *[*int ] | int | None , optional) — a fixed size for this widget (not guranteed to get applied), defaults to None
property id int
property active bool
Whether this is the currently active workspace button or not
The style class active should be set if this is the currently active button
- Return type: bool
property urgent bool
Whether the workspace associated with this button is currently urgent or not
The style class urgent should be set if the workspace was marked as urgent
- Return type: bool
property empty bool
Whether the workspace associated with this button is marked as empty or not
The style class empty should be set if the workspace was marked as empty
- Return type: bool
class Workspaces
Bases: EventBox
Implementation of a commonly used workspaces widget for Hyprland
- Parameters:
- buttons (Iterable *[*WorkspaceButton ] | None , optional) — a list of predefined buttons, if a workspace was opened but no button representing it in the given list was found, call the buttons factory function to create a button for that workspace, defaults to None
- buttons_factory (Callable [ *[*int ] , WorkspaceButton | None ] | None , optional) — a factory for creating buttons once they’re needed, the given function will only be called if no button was found for the new workspace in the given list of predefined buttons, the function can return None instead of a button to ignore adding that workspace, defaults to default_buttons_factory
- invert_scroll (bool , optional) — invert the scroll wheel’s direction (for switching via the wheel), defaults to False
- empty_scroll (bool , optional) — scroll through empty workspaces (if found in the list), defaults to False
static default_buttons_factory (workspace_id: int)
The default workspace buttons factory
The button it bakes uses the given workspace ID as its label
def scroll_handler (_, event: EventScroll)
def insert_button None
def reorder_buttons ()
def remove_button None
def lookup_or_bake_button (workspace_id: int) WorkspaceButton | None
class ActiveWindow (formatter: FormattedString = FormattedString("{'Desktop' if not win_title else truncate(win_title, 42)}", truncate=truncate), **kwargs)
Bases: Button
- Parameters:
- label (str | None , optional) — the label’s text to use as the child of this button, defaults to None
- image (Gtk.Image | None , optional) — an image widget to be added inside this button, defaults to None
- child (Gtk.Widget | None , optional) — a child widget to put inside this button, defaults to None
- name (str | None , optional) — the name identifer for this widget (useful for styling), defaults to None
- visible (bool , optional) — whether should this widget be visible or not once initialized, defaults to True
- all_visible (bool , optional) — whether should this widget and all of its children be visible or not once initialized, defaults to False
- style (str | None , optional) — inline stylesheet to be applied on this widget, defaults to None
- style_classes (Iterable *[*str ] | str | None , optional) — a list of style classes to be added into this widget once initialized, defaults to None
- tooltip_text (str | None , optional) — the text that should be rendered inside the tooltip, defaults to None
- tooltip_markup (str | None , optional) — same as tooltip_text but it accepts simple markup expressions, defaults to None
- h_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — horizontal alignment of this widget (compared to its parent), defaults to None
- v_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — vertical alignment of this widget (compared to its parent), defaults to None
- h_expand (bool , optional) — whether should this widget fill in all the available horizontal space or not, defaults to False
- v_expand (bool , optional) — whether should this widget fill in all the available vertical space or not, defaults to False
- size (Iterable *[*int ] | int | None , optional) — a fixed size for this widget (not guranteed to get applied), defaults to None
class Language (keyboard: str = '.*', formatter: FormattedString = FormattedString('{language}'), **kwargs)
Bases: Button
- Parameters:
- label (str | None , optional) — the label’s text to use as the child of this button, defaults to None
- image (Gtk.Image | None , optional) — an image widget to be added inside this button, defaults to None
- child (Gtk.Widget | None , optional) — a child widget to put inside this button, defaults to None
- name (str | None , optional) — the name identifer for this widget (useful for styling), defaults to None
- visible (bool , optional) — whether should this widget be visible or not once initialized, defaults to True
- all_visible (bool , optional) — whether should this widget and all of its children be visible or not once initialized, defaults to False
- style (str | None , optional) — inline stylesheet to be applied on this widget, defaults to None
- style_classes (Iterable *[*str ] | str | None , optional) — a list of style classes to be added into this widget once initialized, defaults to None
- tooltip_text (str | None , optional) — the text that should be rendered inside the tooltip, defaults to None
- tooltip_markup (str | None , optional) — same as tooltip_text but it accepts simple markup expressions, defaults to None
- h_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — horizontal alignment of this widget (compared to its parent), defaults to None
- v_align (Literal [ “fill” , “start” , “end” , “center” , “baseline” ] | Gtk.Align | None , optional) — vertical alignment of this widget (compared to its parent), defaults to None
- h_expand (bool , optional) — whether should this widget fill in all the available horizontal space or not, defaults to False
- v_expand (bool , optional) — whether should this widget fill in all the available vertical space or not, defaults to False
- size (Iterable *[*int ] | int | None , optional) — a fixed size for this widget (not guranteed to get applied), defaults to None