Comments (8)
Nice idea, I also have it on my TODO list.
from grobi.
I actually have started to work on it in my fork https://github.com/He-Ro/grobi/tree/add-edid it currently extracts the information and stores it. Now I am looking to change the yaml config parsing, which seems to be a little more involved than I thought because of downwards compatability. My current idea is to replace the simple strings with dictionaries so the following config
rules:
- name: Desktop
outputs_connected: [HDMI2, eDP1]
could become
rules:
- name: Desktop
outputs_connected:
- name: HDMI2
edid: 00ffffff…
- eDP1
But now the elements in the outputs_connected
list can either be a dictionary or a string, for which I need to implement a custom Unmarshaler
. Will have a look at it next week.
from grobi.
I'd recommend extracting the relevant infos from the EDID (really easy to do), display manufacturer, model, serial number. https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#Enhanced_EDID_.28E-EDID.29
The EDID is also exposed via sysfs: find /sys/devices/ -name edid
Most is just ASCII text, you can check with xxd
.
from grobi.
My internal laptop monitor's edid looks like this:
00000000: 00ff ffff ffff ff00 0dae b114 0000 0000 ................
00000010: 0c19 0104 951f 1178 02ff 3592 5552 9529 .......x..5.UR.)
00000020: 2550 5400 0000 0101 0101 0101 0101 0101 %PT.............
00000030: 0101 0101 0101 b43b 804a 7138 3440 503c .......;.Jq84@P<
00000040: 6800 34ad 1000 0018 0000 00fe 004e 3134 h.4..........N14
00000050: 3048 4345 2d45 4141 0a20 0000 00fe 0043 0HCE-EAA. .....C
00000060: 4d4e 0a20 2020 2020 2020 2020 0000 00fe MN. ....
00000070: 004e 3134 3048 4345 2d45 4141 0a20 00a2 .N140HCE-EAA. ..
As a user I would not know which part of it is the serial number and which part the manufacturer.
So my question is, how would the user be supposed to know these values to put them into his or her config? Or are there already tools to display them?
I used the whole edid, because in my mind it is easier to obtain for a user, e.g. with xrandr --props
.
Another possible way could be, that grobi reports these values (manufacturer, serial number, …) and the user can copy them from there.
So that is my reasoning for using the whole edid. If you still like the separation more, then I can implement that, but I would first like to understand how the user obtains that information in order to use it in his or her configuration file.
from grobi.
Hm, I'd rather have grobi print the EDID information in the correct format.
FYI: I'd also like to replace the hard to use YAML config with something better, e.g. HCL.
from grobi.
In HCL you want to use their Parse
method and iterate over the generated parse tree, do I understand that correctly? Otherwise using Unmarshal
again does not solve the problem of different possible values.
Thinking about it again, as this is a breaking change anyway one could just introduce the new format completely and then it should be possible to use Unmarshal
again.
I will play around with it and report back.
from grobi.
That's one possibility, the other is to use https://github.com/mitchellh/mapstructure
I find these articles helpful, although I did not find the time yet to play around with HCL:
http://jen20.com/2015/09/07/using-hcl-part-1.html
http://jen20.com/2015/09/08/using-hcl-part-2.html
from grobi.
FYI, I've switched the repo to the idiomatic Go repo layout, and ditched gb
.
from grobi.
Related Issues (19)
- Listen on RANDR output change events directly HOT 1
- Development still states gb as standard build process HOT 2
- Create config from current layout HOT 2
- Document config location HOT 3
- Including display id fails HOT 2
- Use HCL for configuration file HOT 2
- same-as for mirroring HOT 5
- New release HOT 1
- Unknown state. grobi exists HOT 2
- Why does grobi turn off outputs? HOT 5
- Version number hard-coded as 0.5.2-dev HOT 1
- Set refresh rate? HOT 3
- Can't build with Go 1.15 HOT 1
- Allow configuration of primary screen HOT 1
- Allow configuration of log file in config HOT 1
- Automatically reload config
- Detect suspend / resume events HOT 1
- more config options HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grobi.