Comment 3 for bug 315090

Revision history for this message
wvengen (wvengen) wrote :

A little information for implementing the cycling feature in disper.

== The idea from a user perspective ==
There will be an option to give ensembles of options through which disper will cycle. The current state is detected, and the next one activated. The exact notation is not finished, but it can be for example:
  # toggle between single, clone and extend
  disper --cycle "-s", "-c", "-e"
  # cycle through three monitors
  disper --cycle "-d CRT-0 -s", "-d DFP-0 -s", "-d DFP-1 -s"
When a configuration is requested for which no monitors are connected, that one is probably skipped. So the latter would behave as `disper --cycle "-d CRT-0 -s", "-d DFP-0 -s"` when DFP-1 is not connected. How exactly this should behave is still uncertain.

An alternative syntax might be
  # cycle between DFP-only, extend and secondary-only
  disper -s -d DFP-0 --cycle -e -d DFP-0,CRT-1 --cycle -S
so multiple ensembles would be separated by the option --cycle.

== What would be needed for development ==
1. Split off option parsing so that different option-ensembles can be parsed separately
2. Integrate into getopt parsing routines
3. Detect the current state (may be quite some work)
4. Compare the current state with the option-ensembles (probably quite some work)
5. Decide which option-ensembles are valid for the detected hardware state
6. Activate the next one in line

If you have suggestions or remarks, please feel free to make them. I don't have the time right now to get this done, but once the design is clear it will be easier to implement it step-by-step.