YAML output lacks current mode
justinlovinger opened this issue · 5 comments
Output provided by way-displays -y -g
lacks the current mode and has not way to get current resolution.
This is what "current" looks like for me:
CURRENT:
SCALE: 2
ENABLED: TRUE
X: 0
Y: 0
The current mode is present, however it's not well presented and requires some ugly jq or yq to retrieve it.
I this case the current mode is the second:
STATE:
HEADS:
- NAME: DP-1
DESCRIPTION: GIGA-BYTE TECHNOLOGY CO., LTD. M28U 21490B006081 (DP-1)
MAKE: GIGA-BYTE TECHNOLOGY CO., LTD.
MODEL: M28U
SERIAL_NUMBER: 21490B006081
WIDTH_MM: 630
HEIGHT_MM: 360
TRANSFORM: 0
CURRENT:
SCALE: 1.75
ENABLED: TRUE
X: 0
Y: 0
DESIRED:
SCALE: 1.75
ENABLED: TRUE
X: 0
Y: 0
MODES:
- WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 60000
PREFERRED: TRUE
CURRENT: FALSE
- WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 144000
PREFERRED: FALSE
CURRENT: TRUE
- WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 120000
PREFERRED: FALSE
CURRENT: FALSE
...
I'd be very grateful to suggestions on how this could be improved for better usability. I'd be most grateful if you could draft/sketch some YAML that would be more useful.
I see. I had not noticed that. I was expecting mode to be provided as part of the CURRENT
key, like,
STATE:
HEADS:
- NAME: DP-1
DESCRIPTION: GIGA-BYTE TECHNOLOGY CO., LTD. M28U 21490B006081 (DP-1)
MAKE: GIGA-BYTE TECHNOLOGY CO., LTD.
MODEL: M28U
SERIAL_NUMBER: 21490B006081
WIDTH_MM: 630
HEIGHT_MM: 360
TRANSFORM: 0
CURRENT:
SCALE: 1.75
ENABLED: TRUE
X: 0
Y: 0
MODE:
WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 144000
PREFERRED: FALSE
DESIRED:
SCALE: 1.75
ENABLED: TRUE
X: 0
Y: 0
MODES:
- WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 60000
PREFERRED: TRUE
CURRENT: FALSE
- WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 144000
PREFERRED: FALSE
CURRENT: TRUE
- WIDTH: 3840
HEIGHT: 2160
REFRESH_MHZ: 120000
PREFERRED: FALSE
CURRENT: FALSE
This is great, thank you. Tracking at #109
Fixed on master.
@justinlovinger I would be grateful if you could test:
git clone git@github.com:alex-courtis/way-displays.git
cd way-displays
git submodule update --init
make
sudo make install
When you are done you can
sudo make uninstall
Merged and released.