Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] mate-display-properties: Command line options for monitors.xml management #710

Open
davidhedlund opened this issue Jul 19, 2023 · 4 comments

Comments

@davidhedlund
Copy link

davidhedlund commented Jul 19, 2023

The source files for mate-display-properties are located in the mate-control-center/capplets/display directory of the MATE source code repository.

Expected behaviour

Generate monitors.xml

This is of highest importance.

  • "$HOME/.config/monitors.xml" is not automatically generated during the installation of GNU/Linux distributions (Ubuntu MATE 23.04, and Trisquel 11 tested).
  • There is no command to generate a default "$HOME/.config/monitors.xml". A script cannot be written that manages mate-display-properties (the Apply button is not pre-selected for example).
  • Solution: mate-display-properties --make-monitors.xml to generate a default "$HOME/.config/monitors.xml" file. The screen resolution can then be modified (regardless of the values) via Bash:
variable_name="width"; variable_value="1920"; sed -i "s/$variable_name.*$variable_name/$variable_name>$variable_value<\/$variable_name/g" "$HOME/.config/monitors.xml"
variable_name="height"; variable_value="1080"; sed -i "s/$variable_name.*$variable_name/$variable_name>$variable_value<\/$variable_name/g" "$HOME/.config/monitors.xml"

Get data from monitors.xml

  • xrandr will only temporarily change the screen resolution with: screen_resolution="1920x1080"; xrandr --output "$(xrandr --listactivemonitors | tail -1 | awk '{ print $NF }')" --mode "$screen_resolution" Adding that to ~/.bashrc will interfere with "$HOME/.config/monitors.xml" that is generated by mate-display-properties
  • There is no command for this, so the resolution cannot be applied from a script. It's not reliable on a copy of
    monitors.xml that is modified by a script.

Google Bard:

"The mate-display-properties --get-xrandr-output-config option was introduced in Mate Display Properties 1.24. This version was released in April 2020.

The option was removed in Mate Display Properties 1.26, which was released in October 2021. This is because the mate-display-properties command was updated in this release to use a new backend that does not support this option.

Here is a script with xrandr that generates identical output of monitors.xml as mate-display-properties:

#!/bin/sh
output_config=$(mate-display-properties --get-xrandr-output-config)

for output in $output_config; do
xrandr --output output−−mode"(mate-display-properties --get-xrandr-mode output)"−−pos"(mate-display-properties --get-xrandr-pos output)"−−rotate"(mate-display-properties --get-xrandr-rotate $output)"
done

"

Actual behaviour

"$HOME/.config/monitors.xml" is generated

Steps to reproduce the behaviour

  • Run mate-display-properties. Change the screen resolution.

MATE general version

1.26.0

Package version

1.26.0

Linux Distribution

Ubuntu MATE 22.04

Link to bugreport of your Distribution (requirement)

Not applicable as this is a feature request.

@davidhedlund davidhedlund changed the title [Feature requesst] mate-display-properties: Command line option to set the screen resolution [Feature request] mate-display-properties: Command line option to set the screen resolution Jul 19, 2023
@davidhedlund davidhedlund changed the title [Feature request] mate-display-properties: Command line option to set the screen resolution [Feature request] mate-display-properties: Add a command line option that sets the screen resolution Jul 19, 2023
@davidhedlund davidhedlund changed the title [Feature request] mate-display-properties: Add a command line option that sets the screen resolution [Feature request] mate-display-properties: Please restore the --get-xrandr-output-config option Jul 23, 2023
@lukefromdc
Copy link
Member

Note that we are a small team and could always use more coders and testers. These feature requests tell us what people are interested in (something commercial software is known to resort to telemetry just to find out!) but to turn them into code requires effort that can range from trivial to a major rewrite. In this case, which of these it is would be determined by exactly what changed in xrandr. Feature removals in libraries maintained by others can be a real headache at times.

Obviously, more team members would speed all work up, as do the outside contributions we get and welcome.

@davidhedlund davidhedlund changed the title [Feature request] mate-display-properties: Please restore the --get-xrandr-output-config option [Feature request] mate-display-properties: Command line options for monitors.xml management Jul 23, 2023
@davidhedlund
Copy link
Author

Note that we are a small team and could always use more coders and testers. These feature requests tell us what people are interested in (something commercial software is known to resort to telemetry just to find out!) but to turn them into code requires effort that can range from trivial to a major rewrite. In this case, which of these it is would be determined by exactly what changed in xrandr. Feature removals in libraries maintained by others can be a real headache at times.

Obviously, more team members would speed all work up, as do the outside contributions we get and welcome.

I might find someone who can help. Which source(s) file is responsible for mate-display-properties ?

@lukefromdc
Copy link
Member

All of mate-control-center/capplets/display relates to it. in Makefile.am we list

mate_display_properties_SOURCES =	\
	xrandr-capplet.c		\
	scrollarea.c			\
	scrollarea.h

and we also build in gresources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants