jay-compositor 1.13.0

The Jay compositor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# Command-Line Interface

Jay provides a comprehensive CLI for controlling the compositor, managing
displays, input devices, clients, and more. All subcommands communicate with
the running compositor over the Wayland protocol unless otherwise noted.

> [!TIP]
> Generate shell completions for tab-completion support:
>
> ```shell
> ~$ jay generate-completion bash > ~/.local/share/bash-completion/completions/jay
> ~$ jay generate-completion zsh > ~/.zfunc/_jay
> ~$ jay generate-completion fish > ~/.config/fish/completions/jay.fish
> ~$ jay generate-completion elvish  # pipe to appropriate location
> ~$ jay generate-completion powershell  # pipe to appropriate location
> ```

Every subcommand accepts a global `--log-level` option (`trace`, `debug`,
`info`, `warn`, `error`, `off`) that controls the verbosity of the CLI tool itself.

---

## JSON Output

Most query and status commands can output machine-readable JSON instead of
human-readable text. Pass the global `--json` flag before the subcommand:

```shell
~$ jay --json randr
~$ jay --json clients
~$ jay --json idle
```

Each command prints one or more JSON objects, one per line (JSONL format). This
makes it easy to process with tools like `jq`:

```shell
~$ jay --json randr | jq '.drm_devices[].connectors[].name'
~$ jay --json clients | jq 'select(.pid != null) | .pid'
```

By default, fields that are empty arrays, `null`, or `false` are omitted from
the output to reduce noise. To include every field, pass `--all-json-fields`:

```shell
~$ jay --all-json-fields --json randr
```

### Supported Commands

The following commands support `--json`:

`jay clients`
: One JSON object per client.

`jay color-management status`
: Color management enabled/available status.

`jay config path`
: The config file path as a JSON string.

`jay idle status`
: Idle interval, grace period, and inhibitors.

`jay input show`, `jay input seat <seat> show`, `jay input device <id> show`
: Seats and input devices with all properties.

`jay log --path`
: The log file path as a JSON string.

`jay pid`
: The compositor PID as a JSON number.

`jay randr show`
: DRM devices, connectors, outputs, modes, and display properties.

`jay seat-test`
: Streaming JSONL -- one JSON object per input event (key, pointer, touch,
  gesture, tablet, switch).

`jay tree query`
: One JSON object per root node, with children nested recursively.

`jay version`
: The version string as a JSON value.

`jay xwayland status`
: Xwayland scaling mode and implied scale.

> [!TIP]
> Mutating commands (e.g., `jay idle set`, `jay randr output ... enable`)
> produce no output, so `--json` has no effect on them.

---

## Running

### `jay run`

Start the compositor.

```shell
~$ jay run
```

Optionally specify which backends to try (comma-separated, tried in order):

```shell
~$ jay run --backends x11,metal,headless
```

The default order is `x11,metal`. The first backend that can be started is
used. `metal` is the native DRM/KMS backend for bare-metal sessions.

### `jay quit`

Stop the running compositor.

```shell
~$ jay quit
```

### `jay pid`

Print the PID of the running compositor.

```shell
~$ jay pid
```

### `jay version`

Print the Jay version.

```shell
~$ jay version
```

---

## Configuration

### `jay config init`

Generate a configuration file pre-populated with all defaults.

```shell
~$ jay config init
```

If a config already exists, pass `--overwrite` to replace it (the old file is
backed up):

```shell
~$ jay config init --overwrite
```

> [!IMPORTANT]
> Once a config file exists, the entire built-in default configuration is
> replaced -- not merged. An empty config file means no shortcuts, no startup
> actions, nothing. Always use `jay config init` to start with a working
> configuration.

### `jay config path`

Print the path to the config file.

```shell
~$ jay config path
```

### `jay config open-dir`

Open the configuration directory with `xdg-open`.

```shell
~$ jay config open-dir
```

---

## Display & Graphics

All display and GPU commands live under `jay randr`.

### Showing Current Settings

```shell
~$ jay randr
~$ jay randr show
~$ jay randr show --modes      # include all available modes
~$ jay randr show --formats    # include all available framebuffer formats
```

### GPU / Card Commands

Set the primary (render) GPU:

```shell
~$ jay randr card card0 primary
```

Set the graphics API:

```shell
~$ jay randr card card0 api vulkan
~$ jay randr card card0 api opengl
```

Toggle direct scanout:

```shell
~$ jay randr card card0 direct-scanout enable
~$ jay randr card card0 direct-scanout disable
```

Adjust the page-flip margin (in milliseconds, default 1.5):

```shell
~$ jay randr card card0 timing set-flip-margin 1.5
```

### Output Commands

Enable or disable an output:

```shell
~$ jay randr output DP-1 enable
~$ jay randr output DP-1 disable
```

Set the position:

```shell
~$ jay randr output DP-1 position 1920 0
```

Set the scale (fractional scaling supported):

```shell
~$ jay randr output DP-1 scale 1.5
~$ jay randr output DP-1 scale --round-to-float 1.333
```

Set the mode (width, height, refresh rate in Hz):

```shell
~$ jay randr output DP-1 mode 2560 1440 144.0
```

Set the transform:

```shell
~$ jay randr output DP-1 transform rotate-90
~$ jay randr output DP-1 transform none
```

Available transforms: `none`, `rotate-90`, `rotate-180`, `rotate-270`, `flip`,
`flip-rotate-90`, `flip-rotate-180`, `flip-rotate-270`.

Override the non-desktop setting:

```shell
~$ jay randr output DP-1 non-desktop true
~$ jay randr output DP-1 non-desktop default
```

Configure VRR (variable refresh rate):

```shell
~$ jay randr output DP-1 vrr set-mode always
~$ jay randr output DP-1 vrr set-mode variant3
~$ jay randr output DP-1 vrr set-cursor-hz 240
~$ jay randr output DP-1 vrr set-cursor-hz none
```

VRR modes: `never`, `always`, `variant1` (one or more fullscreen apps),
`variant2` (single fullscreen app), `variant3` (single fullscreen app with
game/video content type). Pass `none` to `set-cursor-hz` to remove the cursor
Hz cap.

Configure tearing:

```shell
~$ jay randr output DP-1 tearing set-mode variant3
```

Tearing modes: `never`, `always`, `variant1` (one or more applications
displayed fullscreen), `variant2` (single application displayed fullscreen),
`variant3` (default -- single displayed application that requested tearing).

Set the framebuffer format:

```shell
~$ jay randr output DP-1 format set xrgb8888
```

Set the output color space and EOTF (for HDR):

```shell
~$ jay randr output DP-1 colors set bt2020 pq
~$ jay randr output DP-1 colors set default default
```

Set the brightness (in cd/m^2, or `default`):

```shell
~$ jay randr output DP-1 brightness 203
~$ jay randr output DP-1 brightness default
```

Set the blend space:

```shell
~$ jay randr output DP-1 blend-space linear
~$ jay randr output DP-1 blend-space srgb
```

Enable or disable native gamut usage:

```shell
~$ jay randr output DP-1 use-native-gamut true
~$ jay randr output DP-1 use-native-gamut false
```

### Virtual Outputs

```shell
~$ jay randr virtual-output create my-virtual-display
~$ jay randr virtual-output remove my-virtual-display
```

---

## Input

All input commands live under `jay input`.

### Showing Input Devices

```shell
~$ jay input
~$ jay input show
~$ jay input show -v    # verbose output with device details
```

### Seat Commands

Show seat information:

```shell
~$ jay input seat default show
~$ jay input seat default show -v
```

Set keyboard repeat rate (repeats per second, initial delay in ms):

```shell
~$ jay input seat default set-repeat-rate 25 600
```

Set the keymap from RMLVO names:

```shell
~$ jay input seat default set-keymap-from-names -l de
~$ jay input seat default set-keymap-from-names -l us -v intl -o compose:ralt
```

Set the keymap from a file (or stdin):

```shell
~$ jay input seat default set-keymap /path/to/keymap.xkb
```

Both `set-keymap` and `set-keymap-from-names` accept a `--shortcuts-group`
option to pin shortcut resolution to a specific group index:

```shell
~$ jay input seat default set-keymap-from-names -l us,ru -o grp:ctrl_space_toggle --shortcuts-group 0
```

Retrieve the current keymap:

```shell
~$ jay input seat default keymap > current.xkb
```

Toggle hardware cursor:

```shell
~$ jay input seat default use-hardware-cursor true
~$ jay input seat default use-hardware-cursor false
```

Set cursor size:

```shell
~$ jay input seat default set-cursor-size 24
```

Configure the simple (XCompose-based) input method:

```shell
~$ jay input seat default simple-im enable
~$ jay input seat default simple-im disable
~$ jay input seat default simple-im reload
```

### Device Commands

Show device information:

```shell
~$ jay input device 42 show
```

Set acceleration profile and speed:

```shell
~$ jay input device 42 set-accel-profile flat
~$ jay input device 42 set-accel-profile adaptive
~$ jay input device 42 set-accel-speed -0.5
```

Configure tap behavior:

```shell
~$ jay input device 42 set-tap-enabled true
~$ jay input device 42 set-tap-drag-enabled true
~$ jay input device 42 set-tap-drag-lock-enabled false
```

Set left-handed mode:

```shell
~$ jay input device 42 set-left-handed true
```

Set natural scrolling:

```shell
~$ jay input device 42 set-natural-scrolling true
```

Set pixels per scroll-wheel step:

```shell
~$ jay input device 42 set-px-per-wheel-scroll 30.0
```

Set the multiplier for non-wheel scroll events:

```shell
~$ jay input device 42 set-px-scroll-multiplier 2.0
```

Set the transform matrix (2x2):

```shell
~$ jay input device 42 set-transform-matrix 1.0 0.0 0.0 1.0
```

Set the calibration matrix (2x3, for touchscreens):

```shell
~$ jay input device 42 set-calibration-matrix 1.0 0.0 0.0 0.0 1.0 0.0
```

Set the click method:

```shell
~$ jay input device 42 set-click-method clickfinger
~$ jay input device 42 set-click-method button-areas
~$ jay input device 42 set-click-method none
```

Toggle middle button emulation:

```shell
~$ jay input device 42 set-middle-button-emulation true
```

Set a per-device keymap:

```shell
~$ jay input device 42 set-keymap /path/to/keymap.xkb
~$ jay input device 42 set-keymap-from-names -l de
~$ jay input device 42 keymap > device.xkb
```

The `--shortcuts-group` option is also available for per-device keymaps:

```shell
~$ jay input device 42 set-keymap-from-names -l us,de --shortcuts-group 0
```

Attach / detach a device from a seat:

```shell
~$ jay input device 42 attach default
~$ jay input device 42 detach
```

Map a device to a specific output:

```shell
~$ jay input device 42 map-to-output DP-1
~$ jay input device 42 remove-mapping
```

---

## Idle & Locking

### `jay idle`

Show idle status, including the current interval, grace period, and active
inhibitors:

```shell
~$ jay idle
~$ jay idle status
```

### `jay idle set`

Set the idle interval. Durations can be specified in flexible formats:

```shell
~$ jay idle set 10m
~$ jay idle set 1m 30s
~$ jay idle set disabled
```

### `jay idle set-grace-period`

Set the grace period (screens go black but are not locked/disabled):

```shell
~$ jay idle set-grace-period 30s
~$ jay idle set-grace-period disabled
```

### `jay unlock`

Unlock the compositor. This is useful when the screen locker crashes and the
session remains locked. Run it from another TTY or via SSH. You must set
`WAYLAND_DISPLAY` to the socket of the Jay compositor:

```shell
~$ WAYLAND_DISPLAY=wayland-1 jay unlock
```

---

## Logging

### `jay log`

Open the log file in `less`:

```shell
~$ jay log
~$ jay log -f        # follow mode (like tail -f)
~$ jay log -e        # jump to end of log
~$ jay log --path    # print the log file path instead
```

### `jay set-log-level`

Change the log level at runtime:

```shell
~$ jay set-log-level debug
~$ jay set-log-level info
```

Available levels: `trace`, `debug`, `info`, `warn`, `error`, `off`.

---

## Screenshots

### `jay screenshot`

Take a screenshot of the entire display:

```shell
~$ jay screenshot
~$ jay screenshot --format png
~$ jay screenshot --format qoi
~$ jay screenshot my-screenshot.png
```

If no filename is given, the screenshot is saved as
`%Y-%m-%d-%H%M%S_jay.<ext>` in the current directory. The filename supports
strftime format specifiers.

---

## Clients & Windows

### `jay clients`

List all connected clients:

```shell
~$ jay clients
~$ jay clients show all
```

Show a specific client by ID:

```shell
~$ jay clients show id 42
```

Interactively select a window and show its client:

```shell
~$ jay clients show select-window
```

Kill a client by ID:

```shell
~$ jay clients kill id 42
```

Interactively select a window and kill its client:

```shell
~$ jay clients kill select-window
```

### `jay tree query`

Inspect the compositor's surface tree:

```shell
~$ jay tree query root
~$ jay tree query -r root                    # recursive
~$ jay tree query -r --all-clients root      # show client details for every node
~$ jay tree query workspace-name main
~$ jay tree query select-workspace
~$ jay tree query select-window
```

---

## Xwayland

### `jay xwayland`

Show Xwayland status (scaling mode, implied scale):

```shell
~$ jay xwayland
~$ jay xwayland status
```

### `jay xwayland set-scaling-mode`

```shell
~$ jay xwayland set-scaling-mode default
~$ jay xwayland set-scaling-mode downscaled
```

In `downscaled` mode, X11 windows are rendered at the highest integer scale and
then downscaled, which can improve sharpness on HiDPI displays.

---

## Color Management

### `jay color-management`

Show color management status:

```shell
~$ jay color-management
~$ jay color-management status
```

### `jay color-management enable / disable`

```shell
~$ jay color-management enable
~$ jay color-management disable
```

---

## Other Commands

### `jay control-center`

Open the [Control Center](control-center.md) GUI:

```shell
~$ jay control-center
```

### `jay portal`

Run the Jay desktop portal (provides screen sharing and other XDG desktop
portal interfaces):

```shell
~$ jay portal
```

Normally the portal is started automatically. This command is for running it
manually or debugging.

### `jay seat-test`

Test input events from a seat. Prints all keyboard, pointer, touch, gesture,
tablet, and switch events to stdout:

```shell
~$ jay seat-test
~$ jay seat-test default
~$ jay seat-test -a              # test all seats simultaneously
```

### `jay run-privileged`

Run a program with access to a privileged Wayland socket:

```shell
~$ jay run-privileged my-program --arg1
```

### `jay run-tagged`

Run a program with a tagged Wayland connection. All Wayland connections from the
spawned process tree will carry the specified tag, which can be matched in
[client rules](window-rules.md):

```shell
~$ jay run-tagged my-tag firefox
```

### `jay generate-completion`

Generate shell completion scripts:

```shell
~$ jay generate-completion bash
~$ jay generate-completion zsh
~$ jay generate-completion fish
~$ jay generate-completion elvish
~$ jay generate-completion powershell
```