|
1 | 1 | # vim:ft=yaml |
2 | 2 |
|
| 3 | +# The commands listed in execute_after will be run after an output |
| 4 | +# configuration was changed. |
3 | 5 | execute_after: |
4 | 6 | - setxkbmap dvorak |
5 | 7 |
|
| 8 | +# These are the rules grobi tries to match to the current output configuration. |
| 9 | +# The rules are evaluated top to bottom, the first matching rule is applied and |
| 10 | +# processing stops. |
| 11 | +# |
| 12 | +# The rules belowe are written for a typical Laptop in mind, which hase several |
| 13 | +# external connectors (HDMI2, HDMI3) in addition to the internal display |
| 14 | +# (LVDS1). It may even be placed in a Docking Station, which adds more outputs |
| 15 | +# that aren't present outside it. |
6 | 16 | rules: |
| 17 | + |
| 18 | + # This is a rule for a docking station. |
7 | 19 | - name: Docking Station |
| 20 | + # grobi takes the list of all the |
| 21 | + # outputs xrandr returns and verifies that HDMI2 and HDMI3 are connected, and |
| 22 | + # DP2-2 is present (but may be disconnected). |
8 | 23 | outputs_connected: [HDMI2, HDMI3] |
9 | 24 | outputs_present: [DP2-2] |
| 25 | + |
| 26 | + # when this rule matches, HDMI2 and HDMI3 are activated in their default |
| 27 | + # resolution and set besides each other in a typical dual-monitor |
| 28 | + # configuration: left is HDMI2, right is HDMI3 |
10 | 29 | configure_row: |
11 | 30 | - HDMI2 |
12 | 31 | - HDMI3 |
| 32 | + |
| 33 | + # atomic instructs grobi to only call xrandr once and configure all the |
| 34 | + # outputs. This does not always work with all graphic cards. |
13 | 35 | atomic: true |
| 36 | + |
| 37 | + # For the output HDMI3, the flag --primary will be added to the xrandr |
| 38 | + # call, so that e.g. the tray icons are displayed on this monitor (requires |
| 39 | + # the window manager to do this). |
14 | 40 | primary: HDMI3 |
15 | 41 |
|
| 42 | + # Additional commands can be specified per rule, in this case we make sure |
| 43 | + # that xautolock is enabled and locks the screen after a while. |
| 44 | + execute_after: |
| 45 | + - xautolock -enable |
| 46 | + |
| 47 | + |
| 48 | + # This is a rule for mobile computing, i.e. outside of the docking station defined above. |
16 | 49 | - name: Mobile |
| 50 | + |
| 51 | + # In order to match, the outputs HDMI2 and HDMI3 may be present, but must be disconnected. |
17 | 52 | outputs_disconnected: |
18 | 53 | - HDMI2 |
19 | 54 | - HDMI3 |
| 55 | + |
| 56 | + # Here, only the internal LCD panel is activated. |
20 | 57 | configure_single: LVDS1 |
21 | 58 |
|
| 59 | + execute_after: |
| 60 | + - xautolock -enable |
| 61 | + |
| 62 | + |
| 63 | + # This is a rule for giving a presentation. |
22 | 64 | - name: VGA Projector |
23 | | - outputs_connected: [LVDS1, VGA1] |
| 65 | + |
| 66 | + # This rule requires that a display is connected to the VGA port. |
| 67 | + outputs_connected: [VGA1] |
| 68 | + |
| 69 | + # And it also requires that none of the outputs called DP2-? are present, |
| 70 | + # this way we can test that the Laptop is not in the Docking Station. |
24 | 71 | outputs_absent: [DP2-?] |
| 72 | + |
| 73 | + # Two displays are enabled side by side: LVDS1 on the left with the default |
| 74 | + # resolution, and VGA1 at the resolution 1024x768 (which hopefully works |
| 75 | + # for all projectors). |
25 | 76 | configure_row: |
26 | 77 | - LVDS1 |
27 | 78 | - VGA1@1024x768 |
| 79 | + |
| 80 | + # The following command makes sure that xautolock won't lock the screen |
| 81 | + # during the presentation. |
28 | 82 | execute_after: |
29 | | - - pkill xautolock |
| 83 | + - xautolock -disable |
| 84 | + |
| 85 | + # If none of the rules above match, it's a good idea to have a fallback rule |
| 86 | + # which enables an output device that is always present, so you can debug |
| 87 | + # what's going on. |
| 88 | + - name: Fallback |
| 89 | + configure_single: eDP1 |
0 commit comments