68 Commits

Author SHA1 Message Date
Jonas Ådahl
9715c92745 gdctl: Fix runtime warning message grammar
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4271>
2025-02-27 13:13:42 +01:00
Jonas Ådahl
de2d19e882 gdctl: Support showing and setting output luminance
`gdctl show` now prints "monitor preferences", which currently consists
of only the luminance setting.

`gdctl prefs` is introduced, where one can run e.g. `gdctl prefs
--monitor DP-1 --luminance 80.0` to set the output luminance of the
monitor connected to DP-1 to 80%.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4271>
2025-02-27 13:13:42 +01:00
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
Daniel van Vugt
85cb10a4b4 meson: Relocate bash_completion_dir to use the configured datadir
Suggested-by: Florian Müllner

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3897
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4235>
2025-02-19 11:52:28 +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
1c4b1096a3 tools/get-state: List color standard names instead of enum values
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4192>
2025-02-01 22:46:08 +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
1cbfc07df0 tests: Add get state D-Bus test using gdctl
Test is ref test like, with gdctl outputs being compared.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4190>
2025-01-30 11:29:39 +00:00
Jonas Ådahl
a9d8aaa6fd gdctl: Install to bin/
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
Sebastian Wick
6fa61a088f core/debug-control: Allow changing the reference luminance of outputs
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3953>
2024-08-30 20:03:43 +00:00
Sebastian Wick
788409e094 tools/debug-control: Handle the service not being exported
This is the default case and we want to tell people how to export it
when they use the script instead of having a python stack trace.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3902>
2024-07-24 21:52:47 +00:00
Peter Hutterer
1f3dcc9201 tools/uncrustify: Fix invalid align_nl_cont value
Option<UNUM>: at tools/uncrustify.cfg:135: Expected unsigned number , for 'align_nl_cont'; got 'false'

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3658>
2024-03-12 12:48:20 +10:00
Bilal Elmoussaoui
baa051dcd2 tools: Remove no longer useful scripts
They are all very old and still assume svn/bugzilla/autotools

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3529>
2024-01-27 09:54:15 +00:00
Sebastian Wick
edfd1880c9 docs: Move the gitlab wiki and other docs to the docs/ directory
Let's try to consolidate our documentation in doc/ in the repo. This
includes some documentation from README.md, the HACKING.md coding style
and the gitlab wiki.

The README.md file now links to all top-level topics (i.e. not reachable
via other topics).

This also includes a few small changes to make things more consistent.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3465>
2024-01-03 20:54:57 +00:00
Jonas Ådahl
adc5489ba7 Add debug controller
The debug controller can optionally, when passing --debug-control,
enable manipulating debug state, so far enabling/disabling HDR, via
D-Bus.

It's always created, in order to have a place to store debug state and
emit signals etc when it changes, but so far, it doesn't have its own
state it tracks, it just mirrors that of the monitor manager.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3432>
2023-12-01 14:25:08 +00:00
Daniel van Vugt
9a2c5d7d74 tools/get-state: Round refresh rates to three decimal places
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2465>
2022-08-19 15:28:56 +00:00
Jonas Ådahl
d692c9e0f5 tools/get-state: Use named arguments in print functions
Makes things a bit more readable not having to guess what the passed
numbers or booleans mean.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Marco Trevisan (Treviño)
d3b26a5914 get-state: Move printing functions into main MonitorConfig class
Data should then be parsed in proper structures that would be used for
both printing and changing them for re-configuring the screen

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Marco Trevisan (Treviño)
3553af257e get-state: Use native Gio APIs to get the current config
Also provide multiple readers into a class that can be expanded to also
configure mutter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Marco Trevisan (Treviño)
b02d746512 get-state: Do not require too-modern python version for match stanza
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Marco Trevisan (Treviño)
40509154fb get-state: Move code into __main__ functions
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Jonas Ådahl
8d8694fd08 tools/get-state: Add --short
Often, most of the output consists of a long list of exposed modes for
each monitor. If --short is passed, only pass modes that has properties.
In practice, this means "preferred" modes, "current" modes, and
similarly special cases, which significantly reduces noise.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Jonas Ådahl
e883046c5f tools/get-state: Change to use argparse
This will make adding more arguments easier.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Jonas Ådahl
4e3932c7ac tests: Add sanity test for get-state.py tool
It'll fail if the type signature of the GetCurrentStat() method is
changed, more or less.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Jonas Ådahl
8a4bec767b tools: Add tool for pretty printing DisplayConfig.GetCurrentState
It can pretty print either output from a `gdbus` call, from e.g. a bug
report, or invoke `gdbus` itself and get the state of the running
compositor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2448>
2022-07-28 09:04:45 +00:00
Sebastian Keller
1c5613728f tools/uncrustify: Remove space between i18n function shortcuts and (
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2149>
2021-12-09 20:59:49 +01:00
Carlos Garnacho
5e88c19748 tools: Add uncrustify config file
This config file seems like a good first stab at honoring the
Mutter code style. More changes might be required once this meets
real world testing.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1924>
2021-08-22 21:26:16 +02:00
Daniel van Vugt
231aadd3f0 tools: Remove obsolete ppa-magic.py 2018-11-30 11:12:12 +08:00
Jasper St. Pierre
ff635bad3b Clean up the source tree
Remove a lot of old, unmaintained files
2014-03-18 20:37:35 -04:00