Skip to content

Commit 3d9c7f3

Browse files
committed
Add option to set the primary output
This closes #4
1 parent cd72d86 commit 3d9c7f3

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

doc/grobi.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ rules:
1111
- HDMI2
1212
- HDMI3
1313
atomic: true
14+
primary: HDMI3
1415

1516
- name: Mobile
1617
outputs_disconnected:

src/cmd/grobi/randr.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ func BuildCommandOutputRow(rule Rule, current Outputs) ([]*exec.Cmd, error) {
370370
args = append(args, "--right-of", lastOutput)
371371
}
372372

373+
if rule.Primary == name {
374+
args = append(args, "--primary")
375+
}
376+
373377
lastOutput = name
374378
enableOutputArgs = append(enableOutputArgs, args)
375379
}

src/cmd/grobi/rule.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ type Rule struct {
1313
ConfigureSingle string `yaml:"configure_single"`
1414
ConfigureCommand string `yaml:"configure_command"`
1515

16+
Primary string `yaml:"primary"`
17+
1618
DisableOrder []string `yaml:"disable_order"`
1719

1820
Atomic bool `yaml:"atomic"`

0 commit comments

Comments
 (0)