24 Commits

Author SHA1 Message Date
José Expósito
54c606ed8e gdctl: Allow to lease monitors
Add a new option (--for-lease-monitor) to allow to set a monitor that is
not part of any logical monitor as available for lease.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4300>
2025-02-26 08:34:56 +00:00
Jonas Ådahl
1d88f82d0d gdctl: Use Dimenison.__str__() to print mode dimension
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4302>
2025-02-25 12:22:48 +00:00
Jonas Ådahl
078ba5ea88 gdctl: Make MonitorMode.dimension an actual Dimension
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4302>
2025-02-25 12:22:48 +00:00
Jonas Ådahl
c9c7768418 gdctl: Add __str__(self) for Dimension too
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4302>
2025-02-25 12:22:48 +00:00
Jonas Ådahl
414156d0a1 gdctl: Fix printing Position
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4302>
2025-02-25 12:22:48 +00:00
Marco Trevisan (Treviño)
cfdc63df2d tools/gdctl: Make argcomplete optional
While having automatic completions is a very nice feature of gdctl (I
had suggested to use it too :)), it's not something that distros may
have by default and in particular it's not a package in main in ubuntu.

So, make the code less restrictive on completions, since completions is
not a core functionality of the tool and it can definitely work without
them.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4279>
2025-02-15 17:54:20 +01:00
Sebastian Wick
674ebecd00 gdctl: Fix typing and resulting handling of int|None variables
Introduces two new NamedTuples to deal with dimensions and positions.
The position is special in that x and y can be None. This was previously
wrongly declared to be only int. This commit fixes instances mypy found
where None positions were not handled.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4267>
2025-02-14 16:29:47 +00:00
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