forked from talex5/wayland-proxy-virtwl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ml
52 lines (43 loc) · 1.2 KB
/
config.ml
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
type t = {
tag : string;
xwayland_binary : string;
xrdb : string list; (* Config lines for xrdb *)
xunscale : int;
}
open Cmdliner
let clipname_envvar = "WAYLAND_PROXY_CLIPNAME"
let clipname =
Arg.value @@
Arg.(opt (some string)) None @@
Arg.info
~doc:(Printf.sprintf "Clipboard name to use (to override %s)" clipname_envvar)
["clipname"]
let tag =
Arg.value @@
Arg.(opt string) "" @@
Arg.info
~doc:"Tag to prefix to window titles"
["tag"]
let xwayland_binary =
Arg.value @@
Arg.(opt string) "Xwayland" @@
Arg.info
~doc:"Xwayland binary to execute if an X11 application tries to connect"
["xwayland-binary"]
let xrdb =
Arg.value @@
Arg.(opt_all string) [] @@
Arg.info
~doc:"Initial xrdb config (e.g. 'Xft.dpi:150')"
["xrdb"]
let xunscale =
Arg.value @@
Arg.(opt int) 1 @@
Arg.info
~doc:"Compensate for Wayland's attempts to scale X11 apps (e.g. 2 for a HiDPI display)"
["x-unscale"]
let make_config clipname tag xwayland_binary xrdb xunscale =
Option.iter (Unix.putenv clipname_envvar) clipname;
{ tag; xwayland_binary; xrdb; xunscale }
let cmdliner =
Term.(const make_config $ clipname $ tag $ xwayland_binary $ xrdb $ xunscale)