17 Commits

Author SHA1 Message Date
Jonas Ådahl
b674048184 gdctl: Allow setting color mode
This allows configuring a monitor to enter BT.2100 a.k.a. HDR mode.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
53ae155e03 gdctl: Show color mode
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
23ab763be0 gdctl: Add None friendly named enum helper to create from string
If the string is None, don't create a named enum instance.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:09 +00:00
Jonas Ådahl
4f218537cd gdctl: Make Monitor a dataclass
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
4837d1ce64 gdctl: Make LogicalMonitor a dataclass
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
f9bb7aa2e6 gdctl: Add bash completion integration
This auto-completes things such as available connectors, modes, scales,
transforms, etc.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
c80134d1ba gdctl: Add support for applying configuration
Support defining and applying full configurations, meaning one describes
the whole configuration with one command, fully replacing the active
configuration.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
6750136fd3 gdctl: Introduce and use new named enum
The named enum (NamedEnum) is used to describe a mapping for enum values
to strings. Enums using this define a function that defines the mapping,
and the named enum handles converting from to strings. This replaces
existing manually coded translations.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
2ee918a949 gdctl/monitors-state: Don't keep current state variant around
It's not used by anything, all data is accessed by data structures
derived from the variant.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
7ddaf23130 gdctl: Hook up to o.g.M.DisplayConfig via dedicated class
The "current state" one will use DisplayConfig to query, which
eventually will also do configuration method calls.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
e326aed70e gdctl: Display booleans as yes / no
Slightly more human readible and less programmer speak.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
481f046cd5 gdctl: Store property enum values as real enums
This means declaring an enum class inheriting from enum.Enum.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
34195d905a gdctl: Add LogicalMonitor class
This abstracts what makes a logical monitor. Will make it easy doing
manipulations, and makes the print function a bit more readable.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
00d5a6a0cd gdctl: Always display monitor display name if available
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
cc11b0682b gdtl: Add Monitor class
This makes it possible to avoid dealing directly with the variant when
operating on a monitor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
3469530dec gdctl: Add helpers to get relevant state variants
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00
Jonas Ådahl
a3cfd7bd91 Introduce GNOME Display Control (gdctl) utility
It's based on `get-state.py`, but with the intention to expand its
functionality into not only listing information, but setting and
changing monitor configurations. It's meant to complement monitor
configurations from Settings with something that has more level of
control.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:38 +00:00